Varsuuk
February 12th, 2021, 15:44
I added code to recalculate HP based on any change +- in Con bonus if Constitution was changed. Previously, if I changed con, it only used the new value in future rolls (including applying for all HD previously rolled)
This works, but as in other number input controls I worked with like pc level - it triggers a change each time a digit is typed. For PC Level, I added the <delaykeyupdate /> tag and this resulted in on onValueChanged() only being called on hitting enter or the control losing focus.
I played around first, while not loaded, I changed a specific PC's con on both the campaign db (below) and mod (next code section) to include " <delaykeyupdate />". But no love, it still prints:
Character's hitpoints changed from 38 to 30 (Constitution changed from 11 to 1)
Original score was 11. I was trying to type 12 in the box.
Any tips, things to look at?
(From the campaign db.xml: )
...
<cas>
</cas>
<charsheet>
<id-00001>
<aac>
...
<clilist1>
<cha>
...
</cha>
<con>
<alt_sort_order type="number">5</alt_sort_order>
<clichatcommand type="string">/mod 0</clichatcommand>
<delaykeyupdate>
</delaykeyupdate>
<description type="formattedtext">
<p>Constitution</p>
</description>
(In the .mod file where I store several CAS "rolls", including a category for "Attributes" I have: )
...
<reference static="true">
<cas>
<category name="Attributes" baseicon="0" decalicon="0">
<str>
...
</dex>
<con>
<alt_sort_order type="number">5</alt_sort_order>
<clichatcommand type="string">/mod 1</clichatcommand>
<delaykeyupdate />
<description type="formattedtext">
<p>Constitution</p>
</description>
<locked type="number">1</locked>
<name type="string">Constitution</name>
This works, but as in other number input controls I worked with like pc level - it triggers a change each time a digit is typed. For PC Level, I added the <delaykeyupdate /> tag and this resulted in on onValueChanged() only being called on hitting enter or the control losing focus.
I played around first, while not loaded, I changed a specific PC's con on both the campaign db (below) and mod (next code section) to include " <delaykeyupdate />". But no love, it still prints:
Character's hitpoints changed from 38 to 30 (Constitution changed from 11 to 1)
Original score was 11. I was trying to type 12 in the box.
Any tips, things to look at?
(From the campaign db.xml: )
...
<cas>
</cas>
<charsheet>
<id-00001>
<aac>
...
<clilist1>
<cha>
...
</cha>
<con>
<alt_sort_order type="number">5</alt_sort_order>
<clichatcommand type="string">/mod 0</clichatcommand>
<delaykeyupdate>
</delaykeyupdate>
<description type="formattedtext">
<p>Constitution</p>
</description>
(In the .mod file where I store several CAS "rolls", including a category for "Attributes" I have: )
...
<reference static="true">
<cas>
<category name="Attributes" baseicon="0" decalicon="0">
<str>
...
</dex>
<con>
<alt_sort_order type="number">5</alt_sort_order>
<clichatcommand type="string">/mod 1</clichatcommand>
<delaykeyupdate />
<description type="formattedtext">
<p>Constitution</p>
</description>
<locked type="number">1</locked>
<name type="string">Constitution</name>