PDA

View Full Version : Multiple windowlists and scrollers on the same sheet



Ghingis
January 24th, 2006, 03:38
I am creating a custom ruleset and am stuck trying to create two windowlist controls on the same sheet. When I right click to add a new item, two items show up, one in each windowlist.

Here is the sheet:

<windowclass name="charsheet_combat">
<frame name="frame_charsheet_combat"></frame>
<datasource name="charsheet"></datasource>
<defaultsize height="685" width="550"></defaultsize>
<sheetdata>
<windowlist class="charsheet_armour_entry" name="armour_list">
<allowcreate></allowcreate>
<allowdelete></allowdelete>
<nestdata/>
<bounds rect="53,413,447,50"></bounds>
</windowlist>
<scroller>
<bounds rect="453,467,45,11"></bounds>
<target name="armour_list"></target>
<button normal="button_scroller" pressed="button_scroller_down"></button>
</scroller>
<windowlist class="charsheet_weapon_entry" name="weapon_list">
<allowcreate></allowcreate>
<allowdelete></allowdelete>
<nestdata/>
<bounds rect="53,540,447,60"></bounds>
</windowlist>
<scroller>
<bounds rect="453,603,45,11"></bounds>
<target name="weapon_list"></target>
<button normal="button_scroller" pressed="button_scroller_down"></button>
</scroller>
</sheetdata>
</windowclass>
<windowclass name="charsheet_armour_entry">
<frame name="frame_charsheet_combat_armour_entry"></frame>
<defaultsize height="20" width="447"></defaultsize>
<sheetdata>
<stringcontrol name="name">
<bounds rect="0,0,50,20"></bounds>
<tabtarget next="race" prev="previousCareer"></tabtarget>
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="charsheet_weapon_entry">
<frame name="frame_charsheet_combat_weapon_entry"></frame>
<defaultsize height="20" width="447"></defaultsize>
<sheetdata></sheetdata>
</windowclass>


Here are the frame definitions:

<framedef name="frame_charsheet_combat_armour_entry">
<bitmap file="rulesets\Warhammer\frames\WH_charsheet_combat_armo ur_entry.png"></bitmap>
<topleft rect="0,0,0,0"></topleft>
<top rect="0,0,0,0"></top>
<topright rect="0,0,0,0"></topright>
<left rect="0,0,0,0"></left>
<middle rect="0,0,447,20"></middle>
<right rect="0,0,0,0"></right>
<bottomleft rect="0,0,0,0"></bottomleft>
<bottom rect="0,0,0,0"></bottom>
<bottomright rect="0,0,0,0"></bottomright>
</framedef>
<framedef name="frame_charsheet_combat_weapon_entry">
<bitmap file="rulesets\Warhammer\frames\WH_charsheet_combat_weap on_entry.png"></bitmap>
<topleft rect="0,0,0,0"></topleft>
<top rect="0,0,0,0"></top>
<topright rect="0,0,0,0"></topright>
<left rect="0,0,0,0"></left>
<middle rect="0,0,447,20"></middle>
<right rect="0,0,0,0"></right>
<bottomleft rect="0,0,0,0"></bottomleft>
<bottom rect="0,0,0,0"></bottom>
<bottomright rect="0,0,0,0"></bottomright>
</framedef>

Thanks in advance
Ghingis

Bumamgar
January 24th, 2006, 15:37
Several issues:

1) Your scrollers are outside of the bounds of the windowlists themselves. This may function, but it wastes space.

2) Your windowclasses for your scrollwindows don't define a datasource. This means they use the "charsheet" data source instead of their own sub-nodes. I suspect this is causing new "charsheet" nodes to be created as sub-nodes of the main "charsheet". I wouldn't be surprised if your db.xml isn't a mess due to this.

I find it helps to invision the data structure first, and then build the character sheet on top of that.

For example, I provide a class scrollwindow and a weapon scroll window on the main page of my character sheet.

My goal is to have a data structure that looks like:

<node name="charsheet">
<node name="MyCharacter">
<intvalue name="charisma">12</intvalue>
<!-- a bunch of other top level stats -->
<node name="class_level">
<node name="00001">
<stringvalue name="class">Rogue</stringvalue>
<intvalue name="level">4</intvalue>
</node>
<node name="00002">
<stringvalue name="class">Fighter</stringvalue>
<intvalue name="level">3</intvalue>
</node>
</node>
<node name="weapons">
<node name="00001">
<intvalue name="ammo">32</intvalue>
<intvalue name="atk1">13</intvalue>
<intvalue name="atk2">8</intvalue>
<intvalue name="atk3">0</intvalue>
<intvalue name="atk4">0</intvalue>
<stringvalue name="bonusdmg"></stringvalue>
<stringvalue name="crit">20x3</stringvalue>
<stringvalue name="damage">1d6</stringvalue>
<stringvalue name="hand">M</stringvalue>
<intvalue name="range">60</intvalue>
<stringvalue name="type">P</stringvalue>
<stringvalue name="weapondesc">Short Bow</stringvalue>
</node>
</node>
</node>
</node>

Then, I layout the windowclasses to support that data structure:

<root>
<windowclass name="charsheet_levelentry">
<datasource name="class_level" />
<frame name="charsheet_levelentry" />
<defaultsize width="192" height="20" />
<sheetdata>
<stringcontrol name="class">
<bounds rect="3,0,149,20" />
</stringcontrol>
<numbercontrol name="level">
<bounds rect="161,1,30,18" />
</numbercontrol>
</sheetdata>
</windowclass>

<windowclass name="charsheet_weaponentry">
<datasource name="weapons" />
<frame name="charsheet_weaponentry" />
<defaultsize width="497" height="42" />
<sheetdata>
<stringcontrol name="weapondesc">
<bounds rect="3,0,149,20" />
<tabtarget next="atk1" prev="" />
</stringcontrol>
<numbercontrol name="atk1">
<bounds rect="161,1,30,18" />
<displaysign />
<noreset />
<description field="weapondesc" />
<tabtarget next="atk2" prev="weapondesc" />
</numbercontrol>
<numbercontrol name="atk2">
<bounds rect="190,1,30,18" />
<displaysign />
<noreset />
<hideonvalue value="0" />
<description field="weapondesc" />
<tabtarget next="atk3" prev="atk1" />
</numbercontrol>
<numbercontrol name="atk3">
<bounds rect="219,1,30,18" />
<displaysign />
<noreset />
<hideonvalue value="0" />
<description field="weapondesc" />
<tabtarget next="atk4" prev="atk2" />
</numbercontrol>
<numbercontrol name="atk4">
<bounds rect="248,1,30,18" />
<displaysign />
<noreset />
<hideonvalue value="0" />
<description field="weapondesc" />
<tabtarget next="damage" prev="atk3" />
</numbercontrol>
<stringcontrol name="damage">
<bounds rect="283,1,59,18" />
<center />
<tabtarget next="crit" prev="atk4" />
</stringcontrol>
<stringcontrol name="crit">
<bounds rect="347,1,59,18" />
<center />
<tabtarget next="bonusdmg" prev="damage" />
</stringcontrol>
<stringcontrol name="bonusdmg">
<bounds rect="437,1,59,18" />
<bounds rect="437,1,59,18" />
<center />
<tabtarget next="hand" prev="crit" />
</stringcontrol>
<stringcontrol name="hand">
<bounds rect="190,21,30,18" />
<center />
<tabtarget next="type" prev="bonusdmg" />
</stringcontrol>
<stringcontrol name="type">
<bounds rect="248,21,30,18" />
<center />
<tabtarget next="range" prev="hand" />
</stringcontrol>
<numbercontrol name="range">
<bounds rect="306,21,30,18" />
<center />
<hideonvalue value="0" />
<tabtarget next="ammo" prev="type" />
</numbercontrol>
<numbercontrol name="ammo">
<bounds rect="364,21,30,18" />
<bounds rect="364,21,30,18" />
<center />
<hideonvalue value="0" />
<tabtarget next="weapondesc" prev="range" />
</numbercontrol>
</sheetdata>
</windowclass>

<windowclass name="charsheet_main">
<frame name="charsheet_main_new" />
<datasource name="charsheet" />
<defaultsize width="550" height="685" />
<sheetdata>

<windowlist class="charsheet_levelentry" name="levellist">
<allowcreate />
<allowdelete />
<nestdata />
<bounds rect="322,133,192,80" />
<sort fields="class,level" />
</windowlist>
<scroller>
<bounds rect="469,186,45,27" />
<target name="levellist" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>

<windowlist class="charsheet_weaponentry" name="weaplist">
<allowcreate />
<allowdelete />
<nestdata />
<bounds rect="15,498,497,165" />
</windowlist>
<scroller>
<bounds rect="467,635,45,27" />
<target name="weaplist" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>

</sheetdata>
</windowclass>
Hopefully that helps...

Ghingis
January 24th, 2006, 17:03
Thank you so much for that suggestions. This is my first ruleset and have not even looked at the db.xml file yet. One additional follow up question, what is the purpose of <nestdata/>?

Bumamgar
January 24th, 2006, 17:33
Ged could answer better, but I believe it is what tells Fantasy Grounds to create sub-nodes under the "charsheet" data node for the items in the list.

I could be wrong :)

Goblin-King
January 26th, 2006, 10:04
Bumamgar has it right. A <nestdata /> tag will tell FG to store the information under the current level (i.e. the current sheet node) rather than the global level. This seems to be overly complex and inflexible at the moment, since many users have indicated problems with this. The setup will be slightly altered in 1.06 for better control and maybe make it a bit easier to grasp.