PDA

View Full Version : Fun with sub menus.



Jim1829
August 6th, 2006, 04:07
Hello all. I've been teaching myself XML just by tweaking... and quite often untweaking a custom ruleset that I got my grubby little hands on.

Now, so far... things haven't been so rough. I've been able to accomplish every thing I set my mind to. However, I'm encountering an obstacle that I just don't have the back ground to overcome.

What I want is this. Rather than the entry for every monster listed on the Monsters frame, I want to put categories there. When you click that category, it opens up another list and THEN... if you click and entry, it opens up the monster stat sheet.

The reference XML sheet is where I've been looking but as I said, there is a good deal of terminology I don't understand.

Any help?

Jim1829
August 11th, 2006, 20:28
Nothing? No reply? Perhaps even something to tell me it's not possible?

Oberoten
August 11th, 2006, 20:56
It could be done. Take a look at the references on classes and the like in the rulebook part. (Reference.xml)

Openwindow is your friend. ((No haven't looked on how to do it yet, but I ill get there eventually I hope. ))

Azrael Nightstar
August 11th, 2006, 21:46
I too have yet to try this, but it is definitely possible and I know I've seen someone else working on it. If I recall they got it working as well, but I unfortunately can't remember who or details. Some diligent searching might turn it up. Whoever it was that tried it might be away or something, maybe someone else remembers better?

Jim1829
August 18th, 2006, 09:00
I've made some headway by just poking around. I got the menu the way I want it so that when you click an entry on the list, it opens another list as seen in the below pictures.

https://i7.photobucket.com/albums/y298/-Feris-/screenshot0001.jpg

https://i7.photobucket.com/albums/y298/-Feris-/screenshot0002.jpg

Two problems though. First, every title on the original list opens the same secondary list. I want them each to open thier own. Second, That top entry on the list, "Enter Extra Data" isn't supposed to be there. And every time I click on one of the headings on the original list, it creates another of these empty entries.

This is what I have so far. I don't know if it's everything that's needed but if someone could please help me out on this I could stop pounding my skull against the keyboard.


<windowclass name="antagonists">
<datasource name="antagonists" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="275" height="250" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<windowlist class="antagsmall" name="list">
<sort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>
<windowclass name="antagsmall">
<datasource name="antagonists" />
<defaultsize width="200" height="20" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow" />
<bounds rect="3,0,20,20" />
<class name="animalslist" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20" />
<empty value="&laquo; Enter Extra Data &raquo;" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="antaglist">
<datasource name="antagonists" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="275" height="250" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<staticgraphic>
<bounds rect="16,9,30,157" />
<icon name="title_monsters" />
</staticgraphic>
<windowlist class="antagsmall" name="list">
<sort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>

<windowclass name="animals">
<datasource name="animals" />
<dynamic />
<defaultsize width="270" height="400" />
<minimumsize width="270" height="400" />
<minimize icon="minimized_npc" />
<sheetdata>
<subwindow name="1description">
<class name="animals_description" />
</subwindow>
<subwindow name="2combat">
<class name="animals_combat" />
<activate />
</subwindow>
<subwindow name="3other">
<class name="animals_other" />
</subwindow>

<windowchangecontrol>
<bounds rect="-20,10,15,80" />
<target name="1description" />
</windowchangecontrol>
<windowchangecontrol>
<bounds rect="-20,94,15,80" />
<target name="2combat" />
</windowchangecontrol>
<windowchangecontrol>
<bounds rect="-20,178,15,80" />
<target name="3other" />
</windowchangecontrol>
</sheetdata>
</windowclass>
<windowclass name="animalssmall">
<datasource name="animals" />
<defaultsize width="200" height="20" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow" />
<bounds rect="3,0,20,20" />
<class name="animals" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20" />
<empty value="&laquo; Enter Extra Data &raquo;" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="animalslist">
<datasource name="animals" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="275" height="250" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<windowlist class="animalssmall" name="list">
<sort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>

<windowclass name="noncombatants">
<datasource name="noncombatants" />
<dynamic />
<defaultsize width="270" height="400" />
<minimumsize width="270" height="400" />
<minimize icon="minimized_npc" />
<sheetdata>
<subwindow name="1description">
<class name="noncombatants1" />
</subwindow>

<windowchangecontrol>
<bounds rect="-20,10,15,80" />
<target name="1description" />
</windowchangecontrol>
</sheetdata>
</windowclass>

<windowclass name="noncombatantslist">
<datasource name="noncombatants" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="275" height="250" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<windowlist class="noncombatantssmall" name="list">
<sort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>

<windowclass name="noncombatantssmall">
<datasource name="noncombatants" />
<defaultsize width="200" height="20" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow" />
<bounds rect="3,0,20,20" />
<class name="noncombatants" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20" />
<empty value="&laquo; Enter Extra Data &raquo;" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>
Thanks in advance.

Jim1829
August 18th, 2006, 15:38
Oh, one other glitch. When I click on "Enter Extra Data" it creates a blank record as you would think. But if I try and delete it, the program locks up and crashes.

Jim1829
August 31st, 2006, 14:05
Ok. Almost 2 weeks have passed. No one has any idea on this? My work has come to a screeching halt due to the above problem. Has anyone even looked at my code?

Toadwart
August 31st, 2006, 23:04
Sorry dude, the community is usually pretty good at rallying around and nutting out these sort of problems. Must all be busy, or you've stumped us all :confused:
Sounds similar to a problem I ran into on my own custom ruleset so I'll try to take a look at it this weekend.

Oberoten
August 31st, 2006, 23:11
I caved and bought a second license for my laptop (actually downloading the installer while typing this) so I will hopefully have a bit more worktime on this while riding the bus to work (1 hour each way each day.) and will try to come back to it as well sometime during the weekend.

Jim1829
August 31st, 2006, 23:25
Thank you both so very much. I haven't been exactly idle on it. I downloaded a pdf book, "XML for dummies" but... alas... I'm still trudging through the section that goes into painful detail on what XML... "IS". I eagerly anticipate any word on your efforts... even it its along the lines of, "Too bad, so sad".

joshuha
September 1st, 2006, 00:48
Just as a friendly reminder. The incoming 2.0 implementation changes the way these windowclass and subwindows are done slightly. Of course if you need this done immediately or don't plan on upgrading no worries but you may have to do more work again whenever it comes out as the tags are different.

An converter has been discussed by the dev team but we don't know if it will work 100% or exactly what tags will get converted correctly. Also don't know if it will be released alongside 2.0 or later.

Just some food for thought.

Toadwart
September 3rd, 2006, 01:52
Thank you both so very much. I haven't been exactly idle on it. I downloaded a pdf book, "XML for dummies" but... alas... I'm still trudging through the section that goes into painful detail on what XML... "IS". I eagerly anticipate any word on your efforts... even it its along the lines of, "Too bad, so sad".

I wouldn't bother getting too deep into that book. XML basically is a way of structuring a text file. If you get your head around nodes and the requirement for every node to be 'closed' (either by the /> shortcut or by a full closing node) then that's pretty much all you need to know about XML per-se. Then you need to get your head around how FG uses it. Knowing what node names FG recognises is half the battle.

As to your problem:
When you use subwindows you should have one of them include the "activate" node. This tells FG which sub-window to show by default.As it stands your base class (animals) does not have a frame defined so when it opens it would be invisible.

The other problem seems to just be a typo "antagsmall" opens up "animalslist" rather than "antagonists". Also: "antagonists" is currently set up to show a list of antagonists. It should be similar to the "animals" and "noncombatants" windowclasses (subwinows to show the antagonist info)

Additionally: the "empty" nodes inside the "name" nodes ("Enter Empty Data") are not needed. I'm assuming that you have static datasources for animals, antagonists and noncombatants (pre-populated xml files, that are included in the base.xml file using a "staticdata" node)
As such you would not expect to find any records with a blank name.

However, if what you are actually trying to achieve is something like the "Items" list which would let you create and update animals, antagonists or noncombatants within FG then these xml classes will not suffice...

Heres the test xml I used:


<windowclass name="antagonists">
<datasource name="antagonist" />
<dynamic />
<defaultsize width="270" height="400" />
<minimumsize width="270" height="400" />
<minimize icon="minimized_npc" />
<sheetdata>
<subwindow name="1description">
<class name="antagonists1" />
<activate />
</subwindow>

<windowchangecontrol>
<bounds rect="-20,10,15,80" />
<target name="1description" />
</windowchangecontrol>
</sheetdata>
</windowclass>
<windowclass name="antagsmall">
<datasource name="antagonist" />
<defaultsize width="200" height="20" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow" />
<bounds rect="3,0,20,20" />
<class name="antagonists" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="antaglist">
<datasource name="antagonist" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="275" height="250" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<staticgraphic>
<bounds rect="16,9,30,157" />
<icon name="title_monsters" />
</staticgraphic>
<windowlist class="antagsmall" name="list">
<sort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>


<windowclass name="animals">
<datasource name="animal" />
<dynamic />
<defaultsize width="270" height="400" />
<minimumsize width="270" height="400" />
<minimize icon="minimized_npc" />
<sheetdata>
<subwindow name="1description">
<class name="animals_description" />
<activate />
</subwindow>
<subwindow name="2combat">
<class name="animals_combat" />
<activate />
</subwindow>
<subwindow name="3other">
<class name="animals_other" />
</subwindow>
<windowchangecontrol>
<bounds rect="-20,10,15,80" />
<target name="1description" />
</windowchangecontrol>
<windowchangecontrol>
<bounds rect="-20,94,15,80" />
<target name="2combat" />
</windowchangecontrol>
<windowchangecontrol>
<bounds rect="-20,178,15,80" />
<target name="3other" />
</windowchangecontrol>
</sheetdata>
</windowclass>
<windowclass name="animalssmall">
<datasource name="animal" />
<defaultsize width="200" height="20" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow" />
<bounds rect="3,0,20,20" />
<class name="animals" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>
<windowclass name="animalslist">
<datasource name="animal" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="275" height="250" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<windowlist class="animalssmall" name="list">
<sort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>

<windowclass name="noncombatants">
<datasource name="noncombatant" />
<dynamic />
<defaultsize width="270" height="400" />
<minimumsize width="270" height="400" />
<minimize icon="minimized_npc" />
<sheetdata>
<subwindow name="1description">
<class name="noncombatants1" />
<activate />
</subwindow>

<windowchangecontrol>
<bounds rect="-20,10,15,80" />
<target name="1description" />
</windowchangecontrol>
</sheetdata>
</windowclass>

<windowclass name="noncombatantslist">
<datasource name="noncombatant" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="275" height="250" />
<minimumsize width="200" height="220" />
<softclose />
<sheetdata>
<windowlist class="noncombatantssmall" name="list">
<sort fields="name" />
<bounds rect="50,12,-20,-18" />
<footer image="footer_narrow" />
<columns width="300" />
</windowlist>
<filter>
<bounds rect="20,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="list" field="name" />
</filter>
<scroller>
<bounds rect="-65,-42,45,27" />
<target name="list" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>
<windowclass name="noncombatantssmall">
<datasource name="noncombatant" />
<defaultsize width="200" height="20" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow" />
<bounds rect="3,0,20,20" />
<class name="noncombatants" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="25,0,-10,20" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>


<windowclass name="antagonists1">
<datasource name="antagonist" />
<defaultsize width="270" height="400" />
<frame name="referencebox" />
<sheetdata>

</sheetdata>
</windowclass>
<windowclass name="noncombatants1">
<datasource name="noncombatant" />
<defaultsize width="270" height="400" />
<frame name="referencebox" />
<sheetdata>

</sheetdata>
</windowclass>
<windowclass name="animals_description">
<datasource name="animal" />
<defaultsize width="270" height="400" />
<frame name="referencebox" />
<sheetdata>

</sheetdata>
</windowclass>
<windowclass name="animals_combat">
<datasource name="animal" />
<defaultsize width="270" height="400" />
<frame name="referencebox" />
<sheetdata>

</sheetdata>
</windowclass>
<windowclass name="animals_other">
<datasource name="animal" />
<defaultsize width="270" height="400" />
<frame name="referencebox" />
<sheetdata>

</sheetdata>
</windowclass>

and I had separate xml files for:
antagonists


<root>
<node name="antagonist">
<node name="Antagonist1">
<stringvalue name="name" value="Antagonist 1" />
</node>
<node name="Antagonist2">
<stringvalue name="name" value="Antagonist 2" />
</node>
<node name="Antagonist3">
<stringvalue name="name" value="Antagonist 3" />
</node>
</node>
</root>

animals


<root>
<node name="animal">
<node name="animal1">
<stringvalue name="name" value="animal 1" />
</node>
<node name="animal2">
<stringvalue name="name" value="animal 2" />
</node>
<node name="animal3">
<stringvalue name="name" value="animal 3" />
</node>
</node>
</root>

noncombatants


<root>
<node name="noncombatant">
<node name="noncombatant1">
<stringvalue name="name" value="noncombatant 1" />
</node>
<node name="noncombatant2">
<stringvalue name="name" value="noncombatant 2" />
</node>
<node name="noncombatant3">
<stringvalue name="name" value="noncombatant 3" />
</node>
</node>
</root>