Phalck
December 29th, 2005, 10:20
I am creating a custom ruleset where I want for example weapons from a reference page to be droppable to the character sheet, much like the spells in the d20 ruleset. I have studied the d20 ruleset until my eyes bleed, but can still not get it to work.
Help is much appreciated. These are my code snippets:
MUA_charsheet.xml
<windowclass name="charsheet_skapavapen">
<frame name="charsheet_skapavapen" />
<datasource name="skapavapen" />
<defaultsize width="494" height="16" />
<sheetdata>
<stringcontrol name="Namn">
<bounds rect="0,0,137,16" />
</stringcontrol>
<stringcontrol name="Fattn">
<bounds rect="137,0,29,16" />
<center />
</stringcontrol>
<stringcontrol name="Init">
<bounds rect="167,0,27,16" />
<center />
</stringcontrol>
<stringcontrol name="Skada">
<bounds rect="195,0,42,16" />
<center />
</stringcontrol>
<numbercontrol name="PEN">
<bounds rect="238,0,26,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<stringcontrol name="Rackv">
<bounds rect="265,0,55,16" />
<center />
</stringcontrol>
<numbercontrol name="TAL">
<bounds rect="321,0,26,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<numbercontrol name="PALM">
<bounds rect="348,0,27,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<numbercontrol name="PAL">
<bounds rect="380,0,27,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<stringcontrol name="Vikt">
<bounds rect="408,0,30,16" />
<center />
</stringcontrol>
<Numbercontrol name="MagM">
<bounds rect="439,0,22,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<numbercontrol name="Mag">
<bounds rect="468,0,27,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
</sheetdata>
</windowclass>
<windowlist class="charsheet_skapavapen" name="charsheet_vapenlista">
<allowcreate />
<allowdelete />
<nestdata />
<bounds rect="18,522,491,112" />
<sort fields="Namn" />
<acceptdrop class="vapenbeskr" fields="Namn,Fattn,Init,Skada,PEN,Rackv,TAL,PAL,Vikt,Mag" />
</windowlist>
<scroller>
<bounds rect="6,643,45,27" />
<target name="charsheet_vapenlista" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
The XML reference file looks like this:
vapenbeskr.xml:
<root>
<node name="vapenbeskr">
<node name="Pistol22">
<stringvalue name="Namn" value="Pistol .22" />
<stringvalue name="Eldh" value="e" />
<stringvalue name="Fattn" value="1H" />
<stringvalue name="Init" value="+10" />
<intvalue name="Mag" value="10" />
<intvalue name="PAL" value="100" />
<stringvalue name="Rackv" value="Nara/10m" />
<stringvalue name="Skada" value="1T8" />
<intvalue name="TAL" value="10" />
<intvalue name="PEN" value="0" />
<intvalue name="STY" value="0" />
<stringvalue name="Radie" value="-" />
<stringvalue name="Vikt" value="1" />
<intvalue name="Varde" value="250" />
</node>
</root>
This is the reference XML:
MUA_reference.xml:
<windowclass name="vapenlista_data">
<datasource name="vapenbeskr" />
<defaultsize width="640" height="20" />
<sheetdata>
<windowopencontrol>
<icon normal="button_dragtarget" />
<bounds rect="15,0,24,24" />
<class name="vapenbeskr" />
<description field="Namn" />
</windowopencontrol>
<stringcontrol name="Namn">
<bounds rect="39,0,230,20" />
<font name="chatfont" />
</stringcontrol>
<stringcontrol name="Eldh">
<bounds rect="230,0,32,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<stringcontrol name="Fattn">
<bounds rect="260,0,32,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<stringcontrol name="Init">
<bounds rect="290,0,32,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<numbercontrol name="Mag">
<bounds rect="320,0,32,16" />
<font name="chatfont" />
<center />
</numbercontrol>
<numbercontrol name="PAL">
<bounds rect="350,0,32,16" />
<font name="chatfont" />
<center />
</numbercontrol>
<stringcontrol name="Rackv">
<bounds rect="380,0,72,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<stringcontrol name="Skada">
<bounds rect="450,0,52,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<numbercontrol name="TAL">
<bounds rect="500,0,32,16" />
<font name="chatfont" />
<center />
</numbercontrol>
<stringcontrol name="Vikt">
<bounds rect="540,0,42,16" />
<font name="chatfont" />
<center />
</stringcontrol>
<numbercontrol name="Varde">
<bounds rect="580,0,41,16" />
<font name="chatfont" />
<center />
</numbercontrol>
</sheetdata>
</windowclass>
<windowclass name="vapenlista">
<datasource name="vapenbeskr" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="640" height="550" />
<minimize icon="minimized_reference" />
<tooltip field="description" />
<sheetdata>
<stringcontrol>
<bounds rect="0,10,230,20" />
<font name="narratorfont" />
<center />
<static value="Namn" />
</stringcontrol>
<stringcontrol>
<bounds rect="230,10,32,20" />
<font name="narratorfont" />
<center />
<static value="Eldh" />
</stringcontrol>
<stringcontrol>
<bounds rect="260,10,32,20" />
<font name="narratorfont" />
<center />
<static value="Fattn" />
</stringcontrol>
<stringcontrol>
<bounds rect="290,10,32,20" />
<font name="narratorfont" />
<center />
<static value="Init" />
</stringcontrol>
<stringcontrol>
<bounds rect="320,10,32,20" />
<font name="narratorfont" />
<center />
<static value="Mag" />
</stringcontrol>
<stringcontrol>
<bounds rect="350,10,32,20" />
<font name="narratorfont" />
<center />
<static value="PAL" />
</stringcontrol>
<stringcontrol>
<bounds rect="380,10,72,20" />
<font name="narratorfont" />
<center />
<static value="Rackvidd" />
</stringcontrol>
<stringcontrol>
<bounds rect="450,10,52,20" />
<font name="narratorfont" />
<center />
<static value="Skada" />
</stringcontrol>
<stringcontrol>
<bounds rect="500,10,32,20" />
<font name="narratorfont" />
<center />
<static value="TAL" />
</stringcontrol>
<stringcontrol>
<bounds rect="535,10,42,20" />
<font name="narratorfont" />
<center />
<static value="Vikt" />
</stringcontrol>
<stringcontrol>
<bounds rect="580,10,41,20" />
<font name="narratorfont" />
<center />
<static value="Varde" />
</stringcontrol>
<windowlist class="vapenlista_data" name="lista">
<bounds rect="0,28,-20,-22" />
<sort fields="Namn" />
</windowlist>
<filter>
<bounds rect="18,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="lista" field="Namn" />
</filter>
<scroller>
<bounds rect="-63,-45,45,27" />
<target name="lista" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>
I can drag and drop individual fields from the reference page to the character sheet without trouble, but when I drag the image, i.e., the whole row at once, it does not work.
You can also see an example here, where I would like to have Swedish characters in the value fields of the XML tags, for example I would like to write Värde instead of Varde. I have a separate post on this matter.
Help is much appreciated.
/Phalck
Help is much appreciated. These are my code snippets:
MUA_charsheet.xml
<windowclass name="charsheet_skapavapen">
<frame name="charsheet_skapavapen" />
<datasource name="skapavapen" />
<defaultsize width="494" height="16" />
<sheetdata>
<stringcontrol name="Namn">
<bounds rect="0,0,137,16" />
</stringcontrol>
<stringcontrol name="Fattn">
<bounds rect="137,0,29,16" />
<center />
</stringcontrol>
<stringcontrol name="Init">
<bounds rect="167,0,27,16" />
<center />
</stringcontrol>
<stringcontrol name="Skada">
<bounds rect="195,0,42,16" />
<center />
</stringcontrol>
<numbercontrol name="PEN">
<bounds rect="238,0,26,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<stringcontrol name="Rackv">
<bounds rect="265,0,55,16" />
<center />
</stringcontrol>
<numbercontrol name="TAL">
<bounds rect="321,0,26,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<numbercontrol name="PALM">
<bounds rect="348,0,27,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<numbercontrol name="PAL">
<bounds rect="380,0,27,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<stringcontrol name="Vikt">
<bounds rect="408,0,30,16" />
<center />
</stringcontrol>
<Numbercontrol name="MagM">
<bounds rect="439,0,22,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
<numbercontrol name="Mag">
<bounds rect="468,0,27,16" />
<hideonvalue value="0" />
<center />
</numbercontrol>
</sheetdata>
</windowclass>
<windowlist class="charsheet_skapavapen" name="charsheet_vapenlista">
<allowcreate />
<allowdelete />
<nestdata />
<bounds rect="18,522,491,112" />
<sort fields="Namn" />
<acceptdrop class="vapenbeskr" fields="Namn,Fattn,Init,Skada,PEN,Rackv,TAL,PAL,Vikt,Mag" />
</windowlist>
<scroller>
<bounds rect="6,643,45,27" />
<target name="charsheet_vapenlista" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
The XML reference file looks like this:
vapenbeskr.xml:
<root>
<node name="vapenbeskr">
<node name="Pistol22">
<stringvalue name="Namn" value="Pistol .22" />
<stringvalue name="Eldh" value="e" />
<stringvalue name="Fattn" value="1H" />
<stringvalue name="Init" value="+10" />
<intvalue name="Mag" value="10" />
<intvalue name="PAL" value="100" />
<stringvalue name="Rackv" value="Nara/10m" />
<stringvalue name="Skada" value="1T8" />
<intvalue name="TAL" value="10" />
<intvalue name="PEN" value="0" />
<intvalue name="STY" value="0" />
<stringvalue name="Radie" value="-" />
<stringvalue name="Vikt" value="1" />
<intvalue name="Varde" value="250" />
</node>
</root>
This is the reference XML:
MUA_reference.xml:
<windowclass name="vapenlista_data">
<datasource name="vapenbeskr" />
<defaultsize width="640" height="20" />
<sheetdata>
<windowopencontrol>
<icon normal="button_dragtarget" />
<bounds rect="15,0,24,24" />
<class name="vapenbeskr" />
<description field="Namn" />
</windowopencontrol>
<stringcontrol name="Namn">
<bounds rect="39,0,230,20" />
<font name="chatfont" />
</stringcontrol>
<stringcontrol name="Eldh">
<bounds rect="230,0,32,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<stringcontrol name="Fattn">
<bounds rect="260,0,32,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<stringcontrol name="Init">
<bounds rect="290,0,32,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<numbercontrol name="Mag">
<bounds rect="320,0,32,16" />
<font name="chatfont" />
<center />
</numbercontrol>
<numbercontrol name="PAL">
<bounds rect="350,0,32,16" />
<font name="chatfont" />
<center />
</numbercontrol>
<stringcontrol name="Rackv">
<bounds rect="380,0,72,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<stringcontrol name="Skada">
<bounds rect="450,0,52,20" />
<font name="chatfont" />
<center />
</stringcontrol>
<numbercontrol name="TAL">
<bounds rect="500,0,32,16" />
<font name="chatfont" />
<center />
</numbercontrol>
<stringcontrol name="Vikt">
<bounds rect="540,0,42,16" />
<font name="chatfont" />
<center />
</stringcontrol>
<numbercontrol name="Varde">
<bounds rect="580,0,41,16" />
<font name="chatfont" />
<center />
</numbercontrol>
</sheetdata>
</windowclass>
<windowclass name="vapenlista">
<datasource name="vapenbeskr" />
<frame name="referencebox" />
<dynamic />
<defaultsize width="640" height="550" />
<minimize icon="minimized_reference" />
<tooltip field="description" />
<sheetdata>
<stringcontrol>
<bounds rect="0,10,230,20" />
<font name="narratorfont" />
<center />
<static value="Namn" />
</stringcontrol>
<stringcontrol>
<bounds rect="230,10,32,20" />
<font name="narratorfont" />
<center />
<static value="Eldh" />
</stringcontrol>
<stringcontrol>
<bounds rect="260,10,32,20" />
<font name="narratorfont" />
<center />
<static value="Fattn" />
</stringcontrol>
<stringcontrol>
<bounds rect="290,10,32,20" />
<font name="narratorfont" />
<center />
<static value="Init" />
</stringcontrol>
<stringcontrol>
<bounds rect="320,10,32,20" />
<font name="narratorfont" />
<center />
<static value="Mag" />
</stringcontrol>
<stringcontrol>
<bounds rect="350,10,32,20" />
<font name="narratorfont" />
<center />
<static value="PAL" />
</stringcontrol>
<stringcontrol>
<bounds rect="380,10,72,20" />
<font name="narratorfont" />
<center />
<static value="Rackvidd" />
</stringcontrol>
<stringcontrol>
<bounds rect="450,10,52,20" />
<font name="narratorfont" />
<center />
<static value="Skada" />
</stringcontrol>
<stringcontrol>
<bounds rect="500,10,32,20" />
<font name="narratorfont" />
<center />
<static value="TAL" />
</stringcontrol>
<stringcontrol>
<bounds rect="535,10,42,20" />
<font name="narratorfont" />
<center />
<static value="Vikt" />
</stringcontrol>
<stringcontrol>
<bounds rect="580,10,41,20" />
<font name="narratorfont" />
<center />
<static value="Varde" />
</stringcontrol>
<windowlist class="vapenlista_data" name="lista">
<bounds rect="0,28,-20,-22" />
<sort fields="Namn" />
</windowlist>
<filter>
<bounds rect="18,-65,21,41" />
<icon name="search_icon" />
<entrymode frame="searchframe" bounds="18,-95,-80,77" textarea="37,45,-3,-12" />
<target name="lista" field="Namn" />
</filter>
<scroller>
<bounds rect="-63,-45,45,27" />
<target name="lista" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>
I can drag and drop individual fields from the reference page to the character sheet without trouble, but when I drag the image, i.e., the whole row at once, it does not work.
You can also see an example here, where I would like to have Swedish characters in the value fields of the XML tags, for example I would like to write Värde instead of Varde. I have a separate post on this matter.
Help is much appreciated.
/Phalck