Do onUpdate and onChildUpdate work for formattedtext nodes?
I am coding an extension for Fantasy Grounds (Classic, but I don't think the difference matters for this issue) that sits atop the GURPS ruleset, which is in turn based upon the CoreRPG ruleset. I am trying to detect changes on a formattedtext node contained within various objects contained within list nodes, e.g.:
Code:
function onInit()
DB.addHandler("charsheet.*.abilities.skilllist.*", "onChildUpdate", onSkillUpdooted);
end
function onSkillUpdooted(nSkill)
ChatManager.SystemMessage("Aww yiss, I caught an update!");
end
My data's structure in db.xml looks something like this:
Code:
<root>
<charsheet>
<id-00001>
<abilities>
<skilllist>
<id-00001>
<!-- buncha nodes -->
<text type="formattedtext">
<h>Butt-Kicking (DX/VH)</h>
<p>Its dangerous to go alone, take this skill with you</p>
<linklist>
<!-- links are here -->
</linklist>
</text>
<!-- moar nodes -->
I pick up changes to all the other nodes in the skilllist item, as one might expect. Since the structure of the data seems to indicate that the formattedtext node is a list of "runs" then I thought this would solve my problem:
Code:
function onInit()
DB.addHandler("charsheet.*.abilities.skilllist.*", "onChildUpdate", onSkillUpdooted);
DB.addHandler("charsheet.*.abilities.skilllist.*.text.*", "onChildUpdate", onSkillTextUpdooted);
end
function onSkillUpdooted(nSkill)
ChatManager.SystemMessage("Aww yiss, I caught an update!");
end
function onSkillTextUpdooted(nUpdatedRun)
ChatManager.SystemMessage("Tarnation! This never fires! Whyyyyyyy?");
end
FWIW I also tried picking up changes like this, because I like playing Battleship...
Code:
DB.addHandler("charsheet.*.abilities.skilllist.*.text", "onUpdate", onTheOffChanceThisWorks);
DB.addHandler("charsheet.*.abilities.skilllist.*.text", "onChildUpdate", onTheOffChanceThisWorks);
DB.addHandler("charsheet.*.abilities.skilllist.*.text.*", "onUpdate", onTheOffChanceThisWorks);
Anyone have any secrets about how I can pickup changes in that node? Or am I just going to be sad and make people press a magic button to get the text to be parsed again when it changes.