Inoto
April 8th, 2024, 02:47
I have a checkbox on a window -- charsheet_main -- and I'm trying to get that checkbox to also tick another checkbox on a different window -- charsheet_abilities -- when its value is set to checked.
I'm using Ruleset Wizard and building the project off of the CoreRPG ruleset and I can't figure out how to dereference and get the correct reference point for the checkbox on the charsheet_abilities window.
I know from the CoreRPG ruleset that I'm working off of this model:
<root>
<windowclass name="charsheet">
<sheetdata>
<sub_charsheet_overview name="overview"/>
<sub_charsheet name="main">
<class>charsheet_main</class>
</sub_charsheet>
<sub_charsheet name="abilities">
<class>charsheet_abilities</class>
</sub_charsheet>
<sub_charsheet name="inventory">
<class>charsheet_inventory</class>
</sub_charsheet>
<sub_charsheet name="notes">
<class>charsheet_notes</class>
</sub_charsheet>
</sheetdata>
So I know there's a parent window 'charsheet' and it has the window I'm working from 'charsheet_main' and I can see there's the sibling node 'charsheet_abilities', but I can't navigate to it and grab the control I want to edit.
Here's everything I have tried in the context of the charsheet_main window. Results are after the ';' :
--Debug.chat(window.getDatabaseNode().getName()); = id-00001
--Debug.chat(window.getDatabaseNode().getParent().ge tName()); = charsheet
--Debug.chat(window.getDatabaseNode().getParent().ge tChild('id-00002')); = nil
--Debug.chat(window.getDatabaseNode().getParent().ge tControls()); = nil
--Debug.chat(parentcontrol.getName()); = nil
--Debug.chat(window.parentcontrol); subwindow = {name = s'main',x,y,w,h = 15,20,695,508}
--Debug.chat(window.subwindow); nil
--Debug.chat(window.parentcontrol.getName()); s'main'
--Debug.chat(window.parentcontrol.window.parentcontr ol); nil
--Debug.chat(window.getDatabaseNode().getParent().pa rentcontrol.getName()); nil
--Debug.chat(window.getDatabaseNode().getParent().su bwindow); nil
--Debug.chat(window.getDatabaseNode().getParent()); databasenode = {charsheet}
--Debug.chat(window.getDatabaseNode().getParent().ge tChildCategories()); { }
--Debug.chat(window.getDatabaseNode().getParent().ge tChildList()); {#1 = databasenode = { charsheet.id-00001 }}
--Debug.chat(window.getDatabaseNode().getParent().ge tNodeName()); s'charsheet'
--Debug.chat(window.getDatabaseNode().getParent().ge tPath()); s'charsheet'
--Debug.chat(window.getDatabaseNode().getNodeName()) ; s'charsheet.id-00001'
--Debug.chat(window.linguistics_checkbox.getValue()) ; error nil index attempt
--Debug.chat(window.getDatabaseNode().getText()); blank
--Debug.chat(window.getDatabaseNode().getType()); s'node'
--Debug.chat(window.getDatabaseNode().getValue()); nil
--Debug.chat(window.getDatabaseNode().getParent().ge tControls()); nil method
What I'm confused by is that when I attempt to navigate to charsheet_main from the charsheet_abilities window, I get that both siblings are on the same node somehow:
--Debug.chat(window.parentcontrol.getName()); s'abilities'
--Debug.chat(window.getDatabaseNode().getParent().ge tPath()); s'charsheet'
--Debug.chat(window.getDatabaseNode().getNodeName()) ; s'charsheet.id-00001'
Specifically, both windows say they are on node: charsheet.id-00001, but I get different getName() results depending upon which window I'm executing from.
I know from playing the 5E ruleset that you can edit controls on other windows via actions on a separate window: Submitting a class for a new character allows you to choose starting skills which then update the checkboxes under the skills section -- pretty much exactly what I'm trying to do. I just can't find any good information on the developer guides for what I'm supposed to do.
I'm using Ruleset Wizard and building the project off of the CoreRPG ruleset and I can't figure out how to dereference and get the correct reference point for the checkbox on the charsheet_abilities window.
I know from the CoreRPG ruleset that I'm working off of this model:
<root>
<windowclass name="charsheet">
<sheetdata>
<sub_charsheet_overview name="overview"/>
<sub_charsheet name="main">
<class>charsheet_main</class>
</sub_charsheet>
<sub_charsheet name="abilities">
<class>charsheet_abilities</class>
</sub_charsheet>
<sub_charsheet name="inventory">
<class>charsheet_inventory</class>
</sub_charsheet>
<sub_charsheet name="notes">
<class>charsheet_notes</class>
</sub_charsheet>
</sheetdata>
So I know there's a parent window 'charsheet' and it has the window I'm working from 'charsheet_main' and I can see there's the sibling node 'charsheet_abilities', but I can't navigate to it and grab the control I want to edit.
Here's everything I have tried in the context of the charsheet_main window. Results are after the ';' :
--Debug.chat(window.getDatabaseNode().getName()); = id-00001
--Debug.chat(window.getDatabaseNode().getParent().ge tName()); = charsheet
--Debug.chat(window.getDatabaseNode().getParent().ge tChild('id-00002')); = nil
--Debug.chat(window.getDatabaseNode().getParent().ge tControls()); = nil
--Debug.chat(parentcontrol.getName()); = nil
--Debug.chat(window.parentcontrol); subwindow = {name = s'main',x,y,w,h = 15,20,695,508}
--Debug.chat(window.subwindow); nil
--Debug.chat(window.parentcontrol.getName()); s'main'
--Debug.chat(window.parentcontrol.window.parentcontr ol); nil
--Debug.chat(window.getDatabaseNode().getParent().pa rentcontrol.getName()); nil
--Debug.chat(window.getDatabaseNode().getParent().su bwindow); nil
--Debug.chat(window.getDatabaseNode().getParent()); databasenode = {charsheet}
--Debug.chat(window.getDatabaseNode().getParent().ge tChildCategories()); { }
--Debug.chat(window.getDatabaseNode().getParent().ge tChildList()); {#1 = databasenode = { charsheet.id-00001 }}
--Debug.chat(window.getDatabaseNode().getParent().ge tNodeName()); s'charsheet'
--Debug.chat(window.getDatabaseNode().getParent().ge tPath()); s'charsheet'
--Debug.chat(window.getDatabaseNode().getNodeName()) ; s'charsheet.id-00001'
--Debug.chat(window.linguistics_checkbox.getValue()) ; error nil index attempt
--Debug.chat(window.getDatabaseNode().getText()); blank
--Debug.chat(window.getDatabaseNode().getType()); s'node'
--Debug.chat(window.getDatabaseNode().getValue()); nil
--Debug.chat(window.getDatabaseNode().getParent().ge tControls()); nil method
What I'm confused by is that when I attempt to navigate to charsheet_main from the charsheet_abilities window, I get that both siblings are on the same node somehow:
--Debug.chat(window.parentcontrol.getName()); s'abilities'
--Debug.chat(window.getDatabaseNode().getParent().ge tPath()); s'charsheet'
--Debug.chat(window.getDatabaseNode().getNodeName()) ; s'charsheet.id-00001'
Specifically, both windows say they are on node: charsheet.id-00001, but I get different getName() results depending upon which window I'm executing from.
I know from playing the 5E ruleset that you can edit controls on other windows via actions on a separate window: Submitting a class for a new character allows you to choose starting skills which then update the checkboxes under the skills section -- pretty much exactly what I'm trying to do. I just can't find any good information on the developer guides for what I'm supposed to do.