PDA

View Full Version : List members of a control



xelab
February 27th, 2023, 14:35
Hi,

again a simple question: how do I list members of a GUI control? And how do I access its parent?


For DB nodes that would be:

--print children of database node:
for _,nodeChild in pairs(getDatabaseNode().getChildren()) do
Debug.chat(nodeChild.getNodeName())
end


-- get parrent node
node.getChild("..");

But how to do the same for control?
e.g. <windowclass name="power_item_header" ruleset="5E"> has usepower, actionsmini, etc. as members

Trenloe
February 27th, 2023, 14:58
<Windowinstance>.getControls: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644858/windowinstance#getControls

See the various script scope variables you can use here: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644496/Ruleset+-+Scripting#Script-Block-Scope

If there's anything specific to a control/object then it will be detailed in the API guide: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644535/Developer+Guide+-+Ruleset+API+Reference

xelab
February 27th, 2023, 20:44
Thank you!