<!-- This file is provided under the Open Game License version 1.0a
  -- For more information on OGL and related issues, see 
  --   http://www.wizards.com/WFRP2
  --
  -- For information on the Fantasy Grounds WFRP2 Ruleset licensing and
  -- the OGL license text, see the WFRP2 ruleset license in the program
  -- options.
  --
  -- All producers of work derived from this definition are adviced to
  -- familiarize themselves with the above licenses, and to take special
  -- care in providing the definition of Product Identity (as specified
  -- by the OGL) in their products.
  --
  -- Copyright 2006 SmiteWorks Ltd.
  -->

<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.0">
	<script name="MinisheetSnapper" file="scripts/minisheet_snapper.lua" />

<!-- Warhammer Mini Character Sheet -->

	<windowclass name="whcharsheetmini_main">
		<frame>minisheet</frame>
		<sizelimits>
			<minimum>
				<width>253</width>
				<height>330</height>
			</minimum>
		</sizelimits >
		<nodelete />
		<script file="scripts/minisheet.lua" />

<!-- Mini statframe -->
		<sheetdata>
			<genericcontrol name="ministatframe">
				<bounds>15,20,223,48</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<sheetnumber name="cswound" source="Blessure_ValCourante_Valeur">
				<anchored>
					<to>ministatframe</to>
					<position>insidetopleft</position>
					<offset>10,20</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
			</sheetnumber>				
				<font>sheetnumbersmall</font>			
			<stringcontrol>
				<anchored>
					<to>ministatframe</to>
					<position>insidetopleft</position>
					<offset>24,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>B</static>
			</stringcontrol>

			<sheetnumber name="csweaponskill" source="weaponskill">
				<anchored>
					<to>cswound</to>
					<position>right</position>
					<offset>0,0</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
				<script>				
					function rollDice()
						local desc = getValue();					
						ChatManager.throwDice("dice", {"d100","d10"}, 0, "Test de Capacité de Combat (" .. desc .. " %)");
					end			  
					function onDoubleClick(x, y)
						rollDice();
					end
				</script>
			</sheetnumber>
			<stringcontrol>
				<anchored>
					<to>ministatframe</to>
					<position>insidetopleft</position>
					<offset>54,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>CC</static>
			</stringcontrol>

			<sheetnumber name="csballisticskill" source="bsc">
				<anchored>
					<to>csweaponskill</to>
					<position>right</position>
					<offset>0,0</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
				<script>
				function rollDice()
						local desc = getValue();					
						ChatManager.throwDice("dice", {"d100","d10"}, 0, "Test de Capacité de Tir (" .. desc .. " %)");
					end			  
					function onDoubleClick(x, y)						
						rollDice();
					end
				</script>
			</sheetnumber>		
			<stringcontrol>
				<anchored>
					<to>ministatframe</to>
					<position>insidetopleft</position>
					<offset>90,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>CT</static>
			</stringcontrol>

			<sheetnumber name="csstrength" source="sc">
				<anchored>
					<to>csballisticskill</to>
					<position>right</position>
					<offset>0,0</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
				<script>				
					function rollDice()
						local desc = getValue();					
						ChatManager.throwDice("dice", {"d100","d10"}, 0, "Test de Force (" .. desc .. " %)");
					end			  
					function onDoubleClick(x, y)
						rollDice();
					end
				</script>
			</sheetnumber>		
			<stringcontrol>
				<anchored>
					<to>ministatframe</to>
					<position>insidetopleft</position>
					<offset>124,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>F</static>
			</stringcontrol>

			<sheetnumber name="cstoughness" source="tc">
				<anchored>
					<to>csstrength</to>
					<position>right</position>
					<offset>0,0</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
				<script>				
					function rollDice()
						local desc = getValue();					
						ChatManager.throwDice("dice", {"d100","d10"}, 0, "Test d'Endurance (" .. desc .. " %)");
					end			  
					function onDoubleClick(x, y)
						rollDice();
					end
				</script>
			</sheetnumber>		
			<stringcontrol>
				<anchored>
					<to>ministatframe</to>
					<position>insidetopleft</position>
					<offset>157,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>E</static>
			</stringcontrol>			

			<sheetnumber name="csagility" source="agc">
				<anchored>
					<to>cstoughness</to>
					<position>right</position>
					<offset>0,0</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
				<script>				
					function rollDice()
						local desc = getValue();					
						ChatManager.throwDice("dice", {"d100","d10"}, 0, "Test d'Agilité (" .. desc .. " %)");
					end			  
					function onDoubleClick(x, y)
						rollDice();
					end
				</script>
			</sheetnumber>		
			<stringcontrol>
				<anchored>
					<to>ministatframe</to>
					<position>insidetopleft</position>
					<offset>190,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Ag</static>
			</stringcontrol>	
																		
<!-- Mini fateframe -->
			<genericcontrol name="minifortuneframe">
				<bounds>15,62,60,48</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<sheetnumber name="csfourtune" source="fatept">
				<anchored>
					<to>minifortuneframe</to>
					<position>insidetopleft</position>
					<offset>13,20</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
			</sheetnumber>		
			<stringcontrol>
				<anchored>
					<to>minifortuneframe</to>
					<position>insidetopleft</position>
					<offset>12,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Destin</static>
			</stringcontrol>		

<!-- Mini Movement -->
			<genericcontrol name="minimoveframe">
				<bounds>70,62,168,48</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<sheetnumber name="Init">
				<anchored>
					<to>minimoveframe</to>
					<position>insidetopleft</position>
					<offset>15,20</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<modifier>-1</modifier>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
				<script>														
					function rollDice()						
						local Agilite = window.getDatabaseNode().getChild("agc").getValue();										
						ModifierStack.addSlot("AG", Agilite/10);
						ChatManager.throwDice("dice", {"d10"}, 0, "Initiative (Bonus Agilité + 1d10)");
					end			  
					function onDoubleClick(x, y)
						rollDice();
					end		
				</script>
			</sheetnumber>
            <stringcontrol>
				<anchored>
					<to>minimoveframe</to>
					<position>insidetopleft</position>
					<offset>17,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Initiative</static>
			</stringcontrol>			
			
            <sheetnumber name="mcsmove" source="mc">
				<anchored>
					<to>minimoveframe</to>
					<position>insidetopleft</position>
					<offset>55,20</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<modifier>-1</modifier>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
			</sheetnumber>		
			<stringcontrol>
				<anchored>
					<to>minimoveframe</to>
					<position>insidetopleft</position>
					<offset>57,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Mouv.</static>
			</stringcontrol>	

			<sheetnumber name="mcscharge" source="csmove">
				<anchored>
					<to>minimoveframe</to>
					<position>insidetopleft</position>
					<offset>90,20</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
			</sheetnumber>	
			<stringcontrol>
				<anchored>
					<to>minimoveframe</to>
					<position>insidetopleft</position>
					<offset>92,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Charge</static>
			</stringcontrol>

			<sheetnumber name="mcsrun" source="cscharge">
				<anchored>
					<to>minimoveframe</to>
					<position>insidetopleft</position>
					<offset>125,20</offset>
					<size>
						<width>34</width>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>2,2,2,2</offset>
				</frame>
			</sheetnumber>	
			<stringcontrol>
				<anchored>
					<to>minimoveframe</to>
					<position>insidetopleft</position>
					<offset>127,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Course</static>
			</stringcontrol>

<!-- Armor Synopsis for mini-sheet and combat tracker -->
			<genericcontrol name="miniarmorframe">
				<bounds>15,104,223,80</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<stringcontrol>
				<anchored>
					<to>miniarmorframe</to>
					<position>insidetopleft</position>
					<offset>75,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Armure</static>
			</stringcontrol>	

			<labeledstring name="combatarmor">
				<anchored>
					<to>miniarmorframe</to>
					<position>insidetopleft</position>
					<offset>15,22</offset>
					<size>
						<width>190</width>
						<height>20</height>
					</size>
				</anchored>
				<anchorto>overviewframe</anchorto>
				<height>20</height>
				<label>Armor</label>
			</labeledstring>

			<stringcontrol>
				<anchored>
					<to>miniarmorframe</to>
					<position>insidebottomleft</position>
					<offset>12,18</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Exemple:</static>
			</stringcontrol>				
			<stringcontrol>
				<anchored>
					<to>miniarmorframe</to>
					<position>insidebottomleft</position>
					<offset>63,18</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>T:1 / C:2 / B:1 / J:1 / Bouclier</static>
			</stringcontrol>
			<stringcontrol>
				<anchored>
					<to>miniarmorframe</to>
					<position>insidebottomleft</position>
					<offset>57,8</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>(Tête / Corps / Bras / Jambes)</static>
			</stringcontrol>			

<!-- Favored Weapons for mini-sheet and combat tracker -->
			<genericcontrol name="miniweaponframe">
				<bounds>15,178,223,72</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<stringcontrol>
				<anchored>
					<to>miniweaponframe</to>
					<position>insidetopleft</position>
					<offset>75,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Armes favorites</static>
			</stringcontrol>	

			<labeledstring name="combatweapons">
				<anchored>
					<to>miniweaponframe</to>
					<position>insidetopleft</position>
					<offset>15,22</offset>
					<size>
						<width>190</width>
						<height>20</height>
					</size>
				</anchored>
				<anchorto>overviewframe</anchorto>
				<height>20</height>
				<label>Weapons</label>
			</labeledstring>

			<stringcontrol>
				<anchored>
					<to>miniweaponframe</to>
					<position>insidebottomleft</position>
					<offset>56,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>La foi est votre bouclier</static>
			</stringcontrol>				

<!-- Combat Talents for mini-sheet and combat tracker -->
			<genericcontrol name="minitalentframe">
				<bounds>15,243,223,72</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<stringcontrol>
				<anchored>
					<to>minitalentframe</to>
					<position>insidetopleft</position>
					<offset>75,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Talents de combat</static>
			</stringcontrol>	

			<labeledstring name="combattalents">
				<anchored>
					<to>minitalentframe</to>
					<position>insidetopleft</position>
					<offset>15,22</offset>
					<size>
						<width>190</width>
						<height>20</height>
					</size>
				</anchored>
				<anchorto>overviewframe</anchorto>
				<height>20</height>
				<label>Talents</label>
			</labeledstring>

			<stringcontrol>
				<anchored>
					<to>minitalentframe</to>
					<position>insidebottomleft</position>
					<offset>56,10</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Que la mort soit votre guide</static>
			</stringcontrol>	



		</sheetdata>
	</windowclass>

<!-- Warhammer Mini Character Sheet -->


<!-- Inventory Items-->	
	<windowclass name="charsheetmini_inventoryitem">
		<sizelimits>
			<minimum>
				<height>10</height>
			</minimum>
		</sizelimits>
		<script>
			function updateStatus()
				windowlist.applyFilter();
			end
		
			function onInit()
				statusnode = getDatabaseNode().createChild("showonminisheet", "number");
				statusnode.onUpdate = updateStatus;
			end
		</script>
		<sheetdata>
			<numberfield name="count">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<top>
						<anchor>top</anchor>
						<offset>1</offset>
					</top>
					<size>
						<width>20</width>
						<height>15</height>
					</size>
				</anchored>
				<frame>
					<name>textlinesmall</name>
					<offset>0,-1,0,0</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>6,5,6,5</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
				<hideonvalue>0</hideonvalue>
				<noreset />
				<nodrag />
				<delaykeyupdate />
			</numberfield>
			<textlistitemvalue name="name">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>23</offset>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
				</anchored>
			</textlistitemvalue>
		</sheetdata>
	</windowclass>

<!-- Inventory-->	
	<windowclass name="charsheetmini_inventory">
		<frame>minisheet</frame>
		<placement>
			<size>
				<width>253</width>
				<height>150</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic>
				<resize>vertical</resize>
			</dynamic>
			<minimum>
				<width>253</width>
			</minimum>
		</sizelimits>
		<nodelete />
		<script file="scripts/minisheet.lua" />
		<sheetdata>
			<windowlist name="inventorylist">
				<bounds>10,10,-10,-15</bounds>
				<datasource>.inventorylist</datasource>
				<class>charsheetmini_inventoryitem</class>
				<allowcreate />
				<script>
					function onFilter(w)
						local node = w.getDatabaseNode().getChild("showonminisheet");
						if node and node.getValue() ~= 0 then
							return true;
						end
						return false;
					end
				
					function onSortCompare(w1, w2)
						if w1.name.getValue() == "" then
							return true;
						elseif w2.name.getValue() == "" then
							return false;
						end
					
						return w1.name.getValue() &gt; w2.name.getValue();
					end
				</script>
			</windowlist>
			<scrollercontrol>
				<anchored>
					<to>inventorylist</to>
					<position>insidebottomright</position>
					<size>
						<width>45</width>
						<height>27</height>
					</size>
				</anchored>
				<target>inventorylist</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

<!--Coins -->
	<windowclass name="charsheetmini_coins">
		<frame>minisheet</frame>
		<placement>
			<size>
				<width>253</width>
				<height>65</height>
			</size>
		</placement>
		<sizelimits>
			<minimum>
				<width>253</width>
			</minimum>
		</sizelimits>
		<nodelete />
		<script file="scripts/minisheet.lua" />
		<sheetdata>
			<sheetnumber name="coinamount1">
				<bounds>11,28,45,21</bounds>
				<frame>
					<name>modifier</name>
					<offset>5,3,5,3</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,3,5,3</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount1</to>
					<position>above</position>
					<offset>0,-8</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFFFFFFF</iconcolor>
			</genericcontrol>

			<sheetnumber name="coinamount2">
				<anchored>
					<to>coinamount1</to>
					<position>right</position>
					<offset>6,0</offset>
					<size>
						<width>45</width>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,3,5,3</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,3,5,3</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount2</to>
					<position>above</position>
					<offset>0,-8</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFFFDF4B</iconcolor>
			</genericcontrol>

			<sheetnumber name="coinamount3">
				<anchored>
					<to>coinamount2</to>
					<position>right</position>
					<offset>6,0</offset>
					<size>
						<width>45</width>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,3,5,3</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,3,5,3</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount3</to>
					<position>above</position>
					<offset>0,-8</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFE3E3E3</iconcolor>
			</genericcontrol>

			<sheetnumber name="coinamount4">
				<anchored>
					<to>coinamount3</to>
					<position>right</position>
					<offset>6,0</offset>
					<size>
						<width>45</width>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,3,5,3</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,3,5,3</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount4</to>
					<position>above</position>
					<offset>0,-8</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFDDA15B</iconcolor>
			</genericcontrol>
		</sheetdata>
	</windowclass>

<!-- Spell List -->
	<windowclass name="charsheetmini_spelllistitem">
		<sizelimits>
			<minimum>
				<height>16</height>
			</minimum>
		</sizelimits>
		<minisheet />
		<script file="scripts/charsheet_spelllistitem.lua" />
		<sheetdata>
			<spellcounter name="counter">
				<anchored>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<anchor>top</anchor>
						<offset>0</offset>
					</top>
					<size>
						<width>20</width>
						<height>15</height>
					</size>
				</anchored>
				<minisheet />
			</spellcounter>
			<windowreferencefield name="shortcut">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>0</offset>
					</left>
					<top>
						<anchor>top</anchor>
						<offset>0</offset>
					</top>
					<size>
						<width>14</width>
						<height>14</height>
					</size>
				</anchored>
				<icon>
					<normal>button_openwindow</normal>
					<empty>button_emptytarget</empty>
					<pressed>button_emptytarget</pressed>
				</icon>
			</windowreferencefield>
			<stringfield name="name">
				<anchored>
					<left>
						<parent>shortcut</parent>
						<anchor>right</anchor>
						<offset>1</offset>
					</left>
					<top>
						<anchor>top</anchor>
						<offset>0</offset>
					</top>
					<right>
						<parent>counter</parent>
						<anchor>left</anchor>
						<offset>-5</offset>
					</right>
				</anchored>
				<font>sheettextblock</font>
				<static />
			</stringfield>
		</sheetdata>
	</windowclass>

<!-- Spell List Level -->
	<windowclass name="charsheetmini_spelllistlevel">
		<sizelimits>
			<minimum>
				<height>11</height>
			</minimum>
		</sizelimits>
		<script>
		</script>
		<sheetdata>
			<genericcontrol>
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>0</offset>
					</left>
					<right>
						<anchor>right</anchor>
						<offset>0</offset>
					</right>
					<top>
						<anchor>top</anchor>
						<offset>1</offset>
					</top>
					<size>
						<height>12</height>
					</size>
				</anchored>
				<frame>
					<name>rowshade</name>
				</frame>
			</genericcontrol>
			<stringcontrol name="label">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>0</offset>
					</left>
					<top>
						<anchor>top</anchor>
						<offset>2</offset>
					</top>
				</anchored>
				<font>sheetlabelsmallbold</font>
				<empty>&#171; Empty level &#187;</empty>
				<static />
				<script>
					function onClickDown(button, x, y)
						window.spelllist.setVisible(not window.spelllist.isVisible());
					end
					
					function updateLabel()
						setValue(classnode.getValue() .. " Level " .. string.sub(window.getDatabaseNode().getName(), 6));
					end
					
					function onInit()
						local set = string.sub(window.getDatabaseNode().createChild("...").getName(), 4);
						classnode = window.getDatabaseNode().createChild(".....class" .. set, "string");
						classnode.onUpdate = updateLabel;
						updateLabel();
					end
				</script>
			</stringcontrol>

			<windowlist name="spelllist">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>0</offset>
					</left>
					<right>
						<anchor>right</anchor>
						<offset>0</offset>
					</right>
					<top>
						<anchor>top</anchor>
						<offset>13</offset>
					</top>
				</anchored>
				<datasource>.spells</datasource>
				<class>charsheetmini_spelllistitem</class>
				<noscroll />
				<script file="scripts/charsheet_spelllist.lua" />
				<minisheet />
			</windowlist>
		</sheetdata>
	</windowclass>

<!-- Spell List Set -->
	<windowclass name="charsheetmini_spelllistset">
		<sizelimits>
			<minimum>
				<height>11</height>
			</minimum>
		</sizelimits>
		<script>
			function onInit()
				label = getDatabaseNode().createChild("...class" .. string.sub(getDatabaseNode().getName(), 4), "string");
			end
		</script>
		<sheetdata>
			<windowlist name="spelllevellist">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
				</anchored>
				<datasource>.levels</datasource>
				<class>charsheetmini_spelllistlevel</class>
				<noscroll />
				<minisheet />
				<script file="scripts/charsheet_spelllevellist.lua" />
			</windowlist>
		</sheetdata>
	</windowclass>


<!-- Mini Spells -->
	<windowclass name="charsheetmini_spells">
		<frame>minisheet</frame>
		<placement>
			<size>
				<width>220</width>
				<height>200</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic>
				<resize>vertical</resize>
			</dynamic>
		</sizelimits>
		<nodelete />
		<script file="scripts/minisheet.lua" />
		<sheetdata>
			<windowlist name="spellsetlist">
				<bounds>11,10,-14,-15</bounds>
				<datasource>.spellset</datasource>
				<class>charsheetmini_spelllistset</class>
				<minisheet />
				<script>
					function onFilter(w)
						if w.label == "" then
							return false;
						end
						
						return true;
					end

					function onInit()
						getDatabaseNode().createChild("set1");
						getDatabaseNode().createChild("set2");
						getDatabaseNode().createChild("set3");
					end
				</script>
			</windowlist>
			<scrollercontrol>
				<anchored>
					<to>spellsetlist</to>
					<position>insidebottomright</position>
					<size>
						<width>45</width>
						<height>27</height>
					</size>
				</anchored>
				<target>spellsetlist</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

<!-- Mini Ammo -->
	<windowclass name="charsheetmini_ammoitem">
		<sizelimits>
			<minimum>
				<height>10</height>
			</minimum>
		</sizelimits>
		<sheetdata>
			<stringfield name="name">
				<bounds>0,3,100,20</bounds>
				<font>sheettextsmall</font>
				<frame>
					<name>textline</name>
					<offset>0,1,0,0</offset>
				</frame>
			</stringfield>
			<genericcontrol name="ammocounter">
				<bounds>101,1,102,22</bounds>
				<stateicons>
					<on>indicator_checkon</on>
					<off>indicator_checkoff</off>
				</stateicons>
				<spacing>
					<horizontal>10</horizontal>
					<vertical>10</vertical>
				</spacing>
				<slotcount>
					<horizontal>10</horizontal>
					<vertical>2</vertical>
				</slotcount>
				<fields>
					<max>maxammo</max>
					<count>ammo</count>
				</fields>
				<minisheet />
				<script file="scripts/charsheet_ammocounter.lua" />
			</genericcontrol>
		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_ammo">
		<frame>minisheet</frame>
		<placement>
			<size>
				<width>220</width>
				<height>100</height>
			</size>
		</placement>
		<sizelimits>
			<minimum>
				<height>48</height>
			</minimum>
			<dynamic>
				<resize>vertical</resize>
			</dynamic>
		</sizelimits>
		<nodelete />
		<script file="scripts/minisheet.lua" />
		<sheetdata>
			<windowlist name="list">
				<bounds>10,10,-7,-15</bounds>
				<datasource>.weaponlist</datasource>
				<class>charsheetmini_ammoitem</class>
				<script>
					function onFilter(w)
						local maxammonode = w.getDatabaseNode().getChild("maxammo");
						if maxammonode and maxammonode.getValue() ~= 0 then
							return true;
						end
						return false;
					end
					
					function onInit()
						applyFilter();
					end
				</script>
			</windowlist>
			<scrollercontrol>
				<anchored>
					<to>list</to>
					<position>insidebottomright</position>
					<size>
						<width>45</width>
						<height>27</height>
					</size>
				</anchored>
				<target>list</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>
</root>
