PDA

View Full Version : How to duplicate a value from a tab to another...



thomazrb
February 13th, 2013, 01:05
Hi people,

I'm trying to make a ruleset using the foundations core ruleset as a base.

Until now everything is ok... but...

In character sheet... I have some tabs...

In main tab (charsheet_mail.xml) i have the class
<windowclass name="charsheet_main"> and inside of it i have the attibute strenght... (and a lot of other things... frames etc).


<jpgnumberfield name="strength">
<anchored>
<to>frame_attributes</to>
<position>insidetopleft</position>
<offset>25,20</offset>
<size>
<width>28</width>
</size>
</anchored>
<frame>
<name>bonus</name>
<offset>5,5,5,5</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,5,5,5</offset>
</keyeditframe>
<font>sheetnumber</font>
</jpgnumberfield>


something like it...

if i need this value i can call in a script a function window.strenght.getValue()

Now... i'm making a new tab... inventory (charsheet_inventory.xml) and a new class
<windowclass name="charsheet_inventoryitem">.

How i get the strenght value from the charsheet_main class? The function window.strenght.getValue() doesn't work.

Tnks for the help.

Moon Wizard
February 13th, 2013, 07:04
You can use:
DB.getValue(window.getDatabaseNode(), "strength", 10);

Cheers,
JPG

thomazrb
February 13th, 2013, 23:31
It worked. Tnks for the fast reply moon_wizard!

Moon Wizard
February 14th, 2013, 00:42
I've been working hard to add APIs to make common tasks faster like this one, so I'm glad that it was relatively painless. Now if I only had more time to write manuals... ;)

Cheers,
JPG