AslanBlitz
August 25th, 2006, 20:10
I've been trying to work out if it's possible to create nested lists. For instance, when someone clicks on the Races button, I would like to have the players able to select the race they want to get information on, like they can with classes. I'm even looking for the same layout. However, I would also like to keep the selection of races separate from the classes (thus the reason I'm trying for nested lists). I only have rudimentary XML knowledge, and although I can do basic modifications and can learn fairly quickly, I thought I'd ask if this is doable prior to spending several hours tinkering with the XML files. :) Thanks for any help in this regard.
AslanBlitz
Toadwart
August 25th, 2006, 21:24
What you are suggesting is definately possible.
I might be wrong (not able to look at a ruleset right now) but I thing the race info is just in a big formattedtext entry. If you put it into an xml structure similar to the class info you can display it in the same way as the classes.
AslanBlitz
August 27th, 2006, 22:04
Thank you for the response Toadwart. :) So I attempted to make the change. Things got a little more hairy when I figured out why things weren't working the way I wanted.
In the d20_reference.xml file is where the parameters for what each window does. I decided to do some cutting and pasting to fix it up. First, I wanted to separate races and classes. Because I didn't want to tinker with Photoshop to change the referenceroot.png (yet), I just made a separate windowclass for races. I wanted the Races button on the main page under Character Options to be static, while I wanted the classes to scroll (that way I can add other classes / prestige classes to the list but the races button will never scroll with the classes). I did this in the windowclass "referenceroot" using the Common Modifiers section as reference.
<windowclass name="referenceroot">
<frame name="referenceroot" />
<defaultsize width="480" height="398" />
<sheetdata>
<windowopencontrol name="openracelist">
<icon normal="button_openwindow2" pressed="button_openwindow2down" />
<bounds rect="33,43,200,25" />
<class name="racelist" />
<description text="Races" />
</windowopencontrol>
<stringcontrol>
<bounds rect="63,43,170,20" />
<static value="Races" />
<link handler="openracelist" underlineoffset="-2" />
</stringcontrol>
<windowlist class="classsmall">
<bounds rect="33,68,200,325" />
</windowlist>
<windowlist class="equipmentsmall">
<bounds rect="253,43,200,50" />
</windowlist>
<windowlist class="featssmall">
<bounds rect="253,107,200,25" />
</windowlist>
<windowopencontrol name="openmodifiers">
<icon normal="button_openwindow2" pressed="button_openwindow2down" />
<bounds rect="253,132,200,25" />
<class name="modifierlist" />
<description text="Modifiers" />
</windowopencontrol>
<stringcontrol>
<bounds rect="283,132,170,20" />
<static value="Common Modifiers" />
<link handler="openmodifiers" underlineoffset="-2" />
</stringcontrol>
<windowlist class="houserulesmall">
<bounds rect="253,189,200,25" />
</windowlist>
</sheetdata>
</windowclass>
I then tried to use the windowclass "class" as a reference to create two more windowclasses, "racelist" and "racedesc."
<windowclass name="racedesc">
<datasource name="race" />
<frame name="referencebox" />
<dynamic resize="vertical" />
<defaultsize width="540" height="650" />
<minimize icon="minimized_reference" />
<sheetdata>
<windowopencontrol>
<icon normal="button_dragtarget" />
<bounds rect="25,20,20,20" />
<class name="racedesc" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="50,20,300,20" />
</stringcontrol>
<formattedtextcontrol name="text">
<bounds rect="25,50,-30,-20" />
<font normal="chatfont" bold="narratorfont" italic="chatitalicfont" bolditalic="chatbolditalicfont" title="titlefont" />
<linkicon link="button_openwindow" emptylink="button_emptytarget" />
<footer image="footer_wide" />
</formattedtextcontrol>
</sheetdata>
</windowclass>
<windowclass name="racelist">
<datasource name="race" />
<frame name="referencebox" />
<dynamic resize="vertical" />
<defaultsize width="540" height="650" />
<minimize icon="minimized_reference" />
<sheetdata>
<windowopencontrol>
<icon normal="button_dragtarget" />
<bounds rect="25,20,20,20" />
<class name="racelist" />
</windowopencontrol>
<stringcontrol name="title">
<bounds rect="50,20,-25,20" />
<static value="Races" />
</stringcontrol>
<windowopencontrol name="openracedesc">
<icon normal="button_openwindow2" pressed="button_openwindow2down" />
<bounds rect="50,45,25,25" />
<class name="racedesc" />
<description field="Race Description" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="80,45,170,20" />
<link handler="openracedesc" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>
What I want is for someone to click on the Races button and it would take you to the "racelist" window. Then I want to have the "racelist" window have a list of the different races and when you select one, it would go to the "racedesc" window.
Thus far, the Races link from the Character Options section of the main reference window links properly to "racelist." In the "racelist" window, the title Races shows up with that shadowy button to the left of it, like the way all the windows work. Underneath that, there is a button that you can click on to take you to the "racedesc" window. That works as well. However, the "racelist" window is not reading anything from the races.xml that I created. I went with something simple just for testing purposes. I then added the appropraite line to the base.xml (<staticdata source="rulesets\Dragonlance\database\races.xml" />). Yes, the ruleset I'm going to program in is for 3.5E Dragonlance.
<root>
<node name="race">
<node name="civilizedhuman">
<stringvalue name="name" value="Civilized Human" />
</node>
</node>
</root>
The first node name in races.xml is "race" which is the datasource name that the "racelist" windowclass references. My problem is that the "racelist" window doesn't display any information. So I'm wondering how badly I messed up the coding to get this to happen and if anyone can help me out / tell me there is a simpler way to do this.
Oh, and as a side note, the "racedesc" window, when you try to access the pop-up menu via a right-click, crashes the program. This is also something I am unsure of how to resolve, although I haven't really tried to tinker with that yet, so it's not as important at the moment. If anyone has time to let me know about this as well, it'd be an added bonus.
Toadwart
August 28th, 2006, 04:13
I'm at work right now so can't get into too much detail but the first step is to use "windowlist" rather than a "windowopen" within the racelist window in order to display one entru for each race.
You will have to define another (race_small) class that defines what is displayed for each record in the list. Something as simple as a windowopencontrol with a string control next to it.
Also note: because your data is nested you need to include a nestdata(?I think thats what it's called) tag within the windowlist.
I'll try to take a better look at it after work but might not get time today...
Cheers
Toadwart
Toadwart
August 29th, 2006, 10:04
The class definitions below should get the list of races working.
<windowclass name="race_small">
<datasource name="race" />
<defaultsize width="200" height="20" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow" pressed="button_emptytarget" />
<bounds rect="0,0,20,20" />
<class name="racedesc" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-1,20" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="racedesc">
<datasource name="race" />
<frame name="referencebox" />
<dynamic resize="vertical" />
<defaultsize width="540" height="650" />
<minimize icon="minimized_reference" />
<sheetdata>
<windowopencontrol>
<icon normal="button_dragtarget" />
<bounds rect="25,20,20,20" />
<class name="racedesc" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="50,20,300,20" />
</stringcontrol>
<formattedtextcontrol name="text">
<bounds rect="25,50,-30,-20" />
<font normal="chatfont" bold="narratorfont" italic="chatitalicfont" bolditalic="chatbolditalicfont" title="titlefont" />
<linkicon link="button_openwindow" emptylink="button_emptytarget" />
<footer image="footer_wide" />
</formattedtextcontrol>
</sheetdata>
</windowclass>
<windowclass name="racelist">
<datasource name="race" />
<frame name="referencebox" />
<dynamic resize="vertical" />
<defaultsize width="540" height="650" />
<minimize icon="minimized_reference" />
<sheetdata>
<windowopencontrol>
<icon normal="button_dragtarget" />
<bounds rect="25,20,20,20" />
<class name="racelist" />
</windowopencontrol>
<stringcontrol name="title">
<bounds rect="50,20,-25,20" />
<static value="Races" />
</stringcontrol>
<windowlist class="race_small" name="list">
<bounds rect="35,48,-20,-22" />
<sort fields="name" />
<!-- note: dont need a <nestdata /> tag here, nesting is not deep enough to require one -->
</windowlist>
<scroller>
<bounds rect="-63,-45,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>
When the racedesc window opens the formattedtext field will be editable but nothing you enter will be saved. Once there is a matching <text> node in the races xml file it will display that info (read-only).
Cheers Toadwart
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.