<?xml version="1.0" encoding="iso-8859-1"?>

<!-- 
  -- Please see the readme.txt file included with this distribution for 
  -- attribution and copyright information.
  -->

<root version="2.0">
	<script name="MinisheetSnapper" file="scripts/minisheet_snapper.lua" />

	<windowclass name="charsheetmini_basic">
		<placement>
			<size>
				<width>360</width>
				<height>220</height>
			</size>
		</placement>
		<nodelete />
		<script file="scripts/minisheet.lua" />
		<sheetdata>
			<!-- HEALTH -->
			<genericcontrol name="mini_hpframe">
				<bounds>0,10,180,65</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<hitpointfield name="hp" source="hp.total">
				<anchored>
					<to>mini_hpframe</to>
					<position>insidetopleft</position>
					<offset>20,24</offset>
					<size>
						<width>35</width>
						<height>25</height>
					</size>
				</anchored>
				<noreset />
			</hitpointfield>
			<stringcontrol>
				<anchored>
					<to>hp</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>HP</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<hitpointfield name="wounds" source="hp.wounds">
				<anchored>
					<to>hp</to>
					<position>right</position>
					<offset>15,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
			</hitpointfield>
			<stringcontrol>
				<anchored>
					<to>wounds</to>
					<position>above</position>
					<offset>5,2</offset>
				</anchored>
				<static>Wounds</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<hitpointfield name="nonlethal" source="hp.nonlethal">
				<anchored>
					<to>wounds</to>
					<position>right</position>
					<offset>15,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
			</hitpointfield>
			<stringcontrol>
				<anchored>
					<to>nonlethal</to>
					<position>above</position>
					<offset>5,2</offset>
				</anchored>
				<static>Nonlethal</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>
			
			<!-- ARMOR -->
			<genericcontrol name="mini_armorframe">
				<bounds>0,75,180,85</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<jpgnumberfield name="ac" source="ac.totals.general">
				<anchored>
					<to>mini_armorframe</to>
					<position>insidetopleft</position>
					<offset>20,24</offset>
					<size>
						<width>35</width>
						<height>25</height>
					</size>
				</anchored>
				<readonly />
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumber</font>
			</jpgnumberfield>
			<stringcontrol>
				<anchored>
					<to>ac</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>AC</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<jpgnumberfield name="flatfootedac" source="ac.totals.flatfooted">
				<anchored>
					<to>ac</to>
					<position>right</position>
					<offset>15,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
				<readonly />
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumber</font>
			</jpgnumberfield>
			<stringcontrol>
				<anchored>
					<to>flatfootedac</to>
					<position>above</position>
					<offset>5,2</offset>
				</anchored>
				<static>Flat</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<jpgnumberfield name="touchac" source="ac.totals.touch">
				<anchored>
					<to>flatfootedac</to>
					<position>right</position>
					<offset>15,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
				<readonly />
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumber</font>
			</jpgnumberfield>
			<stringcontrol>
				<anchored>
					<to>touchac</to>
					<position>above</position>
					<offset>5,2</offset>
				</anchored>
				<static>Touch</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<jpgnumberfield name="damagereduction" source="special.damagereduction">
				<anchored>
					<to>ac</to>
					<position>belowleft</position>
					<offset>15,8</offset>
					<size>
						<width>45</width>
						<height>15</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumbersmall</font>
				<noreset />
				<readonly />
				<hideonvalue>0</hideonvalue>
			</jpgnumberfield>
			<stringcontrol>
				<anchored>
					<to>damagereduction</to>
					<position>left</position>
					<offset>5,0</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>DR</static>
			</stringcontrol>

			<jpgnumberfield name="spellresistance" source="special.spellresistance">
				<anchored>
					<to>damagereduction</to>
					<position>right</position>
					<offset>30</offset>
					<size>
						<width>45</width>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumbersmall</font>
				<noreset />
				<readonly />
				<hideonvalue>0</hideonvalue>
			</jpgnumberfield>
			<stringcontrol>
				<anchored>
					<to>spellresistance</to>
					<position>left</position>
					<offset>5,0</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>SR</static>
			</stringcontrol>

			<!-- SAVING THROWS -->
			<genericcontrol name="mini_saves_frame">
				<bounds>0,160,180,65</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<savemain name="save_fort" source="saves.fortitude.total">
				<anchored>
					<to>mini_saves_frame</to>
					<position>insidetopleft</position>
					<offset>20,24</offset>
					<size>
						<width>35</width>
						<height>25</height>
					</size>
				</anchored>
				<description>
					<text>Fortitude save</text>
				</description>
				<noreset />
				<readonly />
				<modifierfield>saves.fortitude.temporary</modifierfield>
				<source>
					<name>saves.fortitude.base</name>
					<op>+</op>
				</source>
				<source>
					<name>abilities.constitution.bonus</name>
					<op>+</op>
				</source>
				<source>
					<name>saves.fortitude.misc</name>
					<op>+</op>
				</source>
			</savemain>
			<stringcontrol>
				<anchored>
					<to>save_fort</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Fort</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<savemain name="save_ref" source="saves.reflex.total">
				<anchored>
					<to>save_fort</to>
					<position>right</position>
					<offset>15,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
				<description>
					<text>Reflex save</text>
				</description>
				<noreset />
				<readonly />
				<modifierfield>saves.reflex.temporary</modifierfield>
				<source>
					<name>saves.reflex.base</name>
					<op>+</op>
				</source>
				<source>
					<name>abilities.dexterity.bonus</name>
					<op>+</op>
				</source>
				<source>
					<name>saves.reflex.misc</name>
					<op>+</op>
				</source>
			</savemain>
			<stringcontrol>
				<anchored>
					<to>save_ref</to>
					<position>above</position>
					<offset>5,2</offset>
				</anchored>
				<static>Ref</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<savemain name="save_will" source="saves.will.total">
				<anchored>
					<to>save_ref</to>
					<position>right</position>
					<offset>15,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
				<description>
					<text>Will save</text>
				</description>
				<noreset />
				<readonly />
				<modifierfield>saves.will.temporary</modifierfield>
				<source>
					<name>saves.will.base</name>
					<op>+</op>
				</source>
				<source>
					<name>abilities.wisdom.bonus</name>
					<op>+</op>
				</source>
				<source>
					<name>saves.will.misc</name>
					<op>+</op>
				</source>
			</savemain>
			<stringcontrol>
				<anchored>
					<to>save_will</to>
					<position>above</position>
					<offset>5,2</offset>
				</anchored>
				<static>Will</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<!-- ABILITIES -->
			<genericcontrol name="mini_abilityframe">
				<bounds>180,10,235,215</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<abilityscore name="strength" source="abilities.strength.score">
				<anchored>
					<to>mini_abilityframe</to>
					<position>insidetopleft</position>
					<offset>103,28</offset>
				</anchored>
			</abilityscore>
			<abilityscore name="dexterity" source="abilities.dexterity.score">
				<anchored>
					<to>strength</to>
					<position>belowleft</position>
					<offset>0,10</offset>
				</anchored>
			</abilityscore>
			<abilityscore name="constitution" source="abilities.constitution.score">
				<anchored>
					<to>dexterity</to>
					<position>belowleft</position>
					<offset>0,10</offset>
				</anchored>
			</abilityscore>
			<abilityscore name="intelligence" source="abilities.intelligence.score">
				<anchored>
					<to>constitution</to>
					<position>belowleft</position>
					<offset>0,10</offset>
				</anchored>
			</abilityscore>
			<abilityscore name="wisdom" source="abilities.wisdom.score">
				<anchored>
					<to>intelligence</to>
					<position>belowleft</position>
					<offset>0,10</offset>
				</anchored>
			</abilityscore>
			<abilityscore name="charisma" source="abilities.charisma.score">
				<anchored>
					<to>wisdom</to>
					<position>belowleft</position>
					<offset>0,10</offset>
				</anchored>
			</abilityscore>
			
			<abilitylabel>
				<anchored>
					<to>strength</to>
				</anchored>
				<static>Strength</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>dexterity</to>
				</anchored>
				<static>Dexterity</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>constitution</to>
				</anchored>
				<static>Constitution</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>intelligence</to>
				</anchored>
				<static>Intelligence</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>wisdom</to>
				</anchored>
				<static>Wisdom</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>charisma</to>
				</anchored>
				<static>Charisma</static>
			</abilitylabel>
			
			<abilitydamage name="strengthdamage" source="abilities.strength.damage">
				<anchored>
					<to>strength</to>
				</anchored>
				<target>strength</target>
			</abilitydamage>
			<abilitydamage name="dexteritydamage" source="abilities.dexterity.damage">
				<anchored>
					<to>dexterity</to>
				</anchored>
				<target>dexterity</target>
			</abilitydamage>
			<abilitydamage name="constitutiondamage" source="abilities.constitution.damage">
				<anchored>
					<to>constitution</to>
				</anchored>
				<target>constitution</target>
			</abilitydamage>
			<abilitydamage name="intelligencedamage" source="abilities.intelligence.damage">
				<anchored>
					<to>intelligence</to>
				</anchored>
				<target>intelligence</target>
			</abilitydamage>
			<abilitydamage name="wisdomdamage" source="abilities.wisdom.damage">
				<anchored>
					<to>wisdom</to>
				</anchored>
				<target>wisdom</target>
			</abilitydamage>
			<abilitydamage name="charismadamage" source="abilities.charisma.damage">
				<anchored>
					<to>charisma</to>
				</anchored>
				<target>charisma</target>
			</abilitydamage>
			
			<abilitybonus name="strengthbonus" source="abilities.strength.bonus">
				<anchored>
					<to>strength</to>
				</anchored>
				<scorefield>abilities.strength.score</scorefield>
				<damagefield>abilities.strength.damage</damagefield>
				<modifierfield>abilities.strength.bonusmodifier</modifierfield>
				<description>
					<text>Strength bonus</text>
				</description>
			</abilitybonus>
			<abilitybonus name="dexteritybonus" source="abilities.dexterity.bonus">
				<anchored>
					<to>dexterity</to>
				</anchored>
				<scorefield>abilities.dexterity.score</scorefield>
				<damagefield>abilities.dexterity.damage</damagefield>
				<modifierfield>abilities.dexterity.bonusmodifier</modifierfield>
				<description>
					<text>Dexterity bonus</text>
				</description>
			</abilitybonus>
			<abilitybonus name="constitutionbonus" source="abilities.constitution.bonus">
				<anchored>
					<to>constitution</to>
				</anchored>
				<scorefield>abilities.constitution.score</scorefield>
				<damagefield>abilities.constitution.damage</damagefield>
				<modifierfield>abilities.constitution.bonusmodifier</modifierfield>
				<description>
					<text>Constitution bonus</text>
				</description>
			</abilitybonus>
			<abilitybonus name="intelligencebonus" source="abilities.intelligence.bonus">
				<anchored>
					<to>intelligence</to>
				</anchored>
				<scorefield>abilities.intelligence.score</scorefield>
				<damagefield>abilities.intelligence.damage</damagefield>
				<modifierfield>abilities.intelligence.bonusmodifier</modifierfield>
				<description>
					<text>Intelligence bonus</text>
				</description>
			</abilitybonus>
			<abilitybonus name="wisdombonus" source="abilities.wisdom.bonus">
				<anchored>
					<to>wisdom</to>
				</anchored>
				<scorefield>abilities.wisdom.score</scorefield>
				<damagefield>abilities.wisdom.damage</damagefield>
				<modifierfield>abilities.wisdom.bonusmodifier</modifierfield>
				<description>
					<text>Wisdom bonus</text>
				</description>
			</abilitybonus>
			<abilitybonus name="charismabonus" source="abilities.charisma.bonus">
				<anchored>
					<to>charisma</to>
				</anchored>
				<scorefield>abilities.charisma.score</scorefield>
				<damagefield>abilities.charisma.damage</damagefield>
				<modifierfield>abilities.charisma.bonusmodifier</modifierfield>
				<description>
					<text>Charisma bonus</text>
				</description>
			</abilitybonus>

			<stringcontrol>
				<anchored>
					<to>strengthbonus</to>
					<position>above</position>
					<offset>5,2</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Bonus</static>
				<center />
			</stringcontrol>
			<stringcontrol>
				<anchored>
					<to>strengthdamage</to>
					<position>above</position>
					<offset>5,2</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Damage</static>
				<center />
			</stringcontrol>

			<!-- COMBAT ROLLS -->
			<genericcontrol name="mini_combatframe">
				<bounds>0,225,225,65</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<initmain name="initiative" source="initiative.total">
				<anchored>
					<to>mini_combatframe</to>
					<position>insidetopleft</position>
					<offset>20,24</offset>
					<size>
						<width>35</width>
						<height>25</height>
					</size>
				</anchored>
				<readonly />
				<description>
					<text>Initiative</text>
				</description>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumber</font>
				<source>
					<name>abilities.dexterity.bonus</name>
					<op>+</op>
				</source>
				<source>
					<name>initiative.misc</name>
					<op>+</op>
				</source>
			</initmain>
			<stringcontrol>
				<anchored>
					<to>initiative</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Init</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<melee_main name="melee" source="attackbonus.melee.total">
				<anchored>
					<to>initiative</to>
					<position>right</position>
					<offset>15,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
			</melee_main>
			<stringcontrol>
				<anchored>
					<to>melee</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Melee</static>
				<center />
				<font>sheetlabelsmall</font>
			</stringcontrol>

			<ranged_main name="ranged" source="attackbonus.ranged.total">
				<anchored>
					<to>melee</to>
					<position>right</position>
					<offset>15,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
			</ranged_main>
			<stringcontrol>
				<anchored>
					<to>ranged</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Ranged</static>
				<font>sheetlabelsmall</font>
				<center />
			</stringcontrol>

			<grapplebonus name="grapple" source="attackbonus.grapple.total">
				<anchored>
					<to>ranged</to>
					<position>right</position>
					<offset>15,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumber</font>
				<displaysign />
				<readonly />
				<description>
					<text>Grapple</text>
				</description>
				<source>
					<name>abilities.strength.bonus</name>
					<op>+</op>
				</source>
				<source>
					<name>attackbonus.base</name>
					<op>+</op>
				</source>
				<source>
					<name>attackbonus.grapple.size</name>
					<op>+</op>
				</source>
				<source>
					<name>attackbonus.grapple.misc</name>
					<op>+</op>
				</source>
			</grapplebonus>
			<stringcontrol>
				<anchored>
					<to>grapple</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Grapple</static>
				<font>sheetlabelsmall</font>
				<center />
			</stringcontrol>

			<!-- MISC FIELDS -->
			<genericcontrol name="mini_miscframe">
				<bounds>225,225,190,65</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<sheetnumber name="speed">
				<anchored>
					<to>mini_miscframe</to>
					<position>insidetopleft</position>
					<offset>20,24</offset>
					<size>
						<width>65</width>
						<height>25</height>
					</size>
				</anchored>
				<readonly />
				<noreset />
			</sheetnumber>
			<stringcontrol>
				<anchored>
					<to>speed</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Speed</static>
				<center />
			</stringcontrol>

			<!-- WEAPONS -->
			<genericcontrol name="mini_weaponframe">
				<bounds>0,290,-1,-15</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<windowlist name="weaponlist">
				<anchored>
					<to>mini_weaponframe</to>
					<position>over</position>
					<offset>-12,-9</offset>
				</anchored>
				<datasource>.weaponlist</datasource>
				<class>charsheetmini_weaponitem</class>
				<script file="scripts/charsheet_weaponlist.lua" />
			</windowlist>
			<scrollercontrol>
				<anchored>
					<to>weaponlist</to>
					<position>insidebottomright</position>
					<size>
						<width>45</width>
						<height>27</height>
					</size>
				</anchored>
				<target>weaponlist</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>

		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_weaponitem">
		<sizelimits>
			<minimum>
				<height>10</height>
			</minimum>
		</sizelimits>
		<sheetdata>
			<stringfield name="critrange">
				<bounds>0,0,1,1</bounds>
				<invisible />
			</stringfield>
			<stringfield name="critmultiplier">
				<bounds>0,0,1,1</bounds>
				<invisible />
			</stringfield>

			<checkbox name="type">
				<anchored>
					<left>
						<anchor>right</anchor>
						<offset>-212</offset>
					</left>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>30</width>
						<height>35</height>
					</size>
				</anchored>
				<stateicons>
					<on>indicator_ranged</on>
					<off>indicator_melee</off>
				</stateicons>
				<readonly />
				<script>
					function onInit()
						super.onInit();
						onValueChanged();
					end
					
					function onValueChanged()
						if getState() then
							window.rangeincrement.setVisible(true);
							window.range_label.setVisible(true);
						else
							window.rangeincrement.setVisible(false);
							window.range_label.setVisible(false);
						end
					end
				</script>
			</checkbox>

			<genericcontrol name="attackicons">
				<anchored>
					<left>
						<anchor>right</anchor>
						<offset>-182</offset>
					</left>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>40</width>
						<height>35</height>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
				</frame>
			</genericcontrol>
			<linkednumber name="attacks">
				<anchored>
					<to>attackicons</to>
					<position>over</position>
				</anchored>
				<font>sheetnumber</font>
				<icons>
					<container>attackicons</container>
					<icon>indicator_fullattackdie</icon>
					<offsetx>7</offsetx>
					<offsety>6</offsety>
				</icons>
				<readonly />
				<namefield>name</namefield>
				<script file="scripts/charsheet_fullattack.lua" />
			</linkednumber>

			<weaponattack name="attack1">
				<anchored>
					<left>
						<anchor>right</anchor>
						<offset>-142</offset>
					</left>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>40</width>
						<height>35</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
				</frame>
				<font>sheetnumber</font>
				<modifier>0</modifier>
				<name>Attack 1</name>
				<readonly />
			</weaponattack>
			
			<genericcontrol name="damageframe">
				<anchored>
					<left>
						<parent>attack1</parent>
						<anchor>right</anchor>
					</left>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>105</width>
						<height>35</height>
					</size>
				</anchored>
				<frame>
					<name>slottedbonus</name>
				</frame>
			</genericcontrol>
			<weapondamage name="damagedice">
				<anchored>
					<to>damageframe</to>
					<position>insideleft</position>
					<size>
						<width>70</width>
					</size>
				</anchored>
			</weapondamage>
			<jpgnumberfield name="damagebonus">
				<anchored>
					<to>damageframe</to>
					<position>insideright</position>
					<offset>3,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
				<font>sheetnumber</font>
				<displaysign />
				<readonly />
			</jpgnumberfield>

			<stringfield name="name">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>0</offset>
					</left>
					<top>
						<anchor>top</anchor>
						<offset>6</offset>
					</top>
					<right>
						<parent>type</parent>
						<anchor>left</anchor>
					</right>
				</anchored>
				<font>sheettext</font>
				<frame>
					<name>textline</name>
					<offset>0,0,0,0</offset>
				</frame>
			</stringfield>
			
			<jpgnumberfield name="rangeincrement">
				<anchored>
					<to>name</to>
					<position>belowleft</position>
					<offset>20,0</offset>
					<size>
						<width>35</width>
						<height>20</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>0,3,0,3</offset>
				</frame>
				<font>sheetnumbersmall</font>
				<readonly />
			</jpgnumberfield>
			<stringcontrol name="range_label">
				<anchored>
					<to>rangeincrement</to>
					<position>lefthigh</position>
					<offset>0,5</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Rng</static>
			</stringcontrol>
			
			<jpgnumberfield name="maxammo">
				<anchored>
					<to>rangeincrement</to>
					<position>right</position>
					<offset>30,0</offset>
					<size>
						<width>35</width>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>0,3,0,3</offset>
				</frame>
				<readonly />
				<font>sheetnumbersmall</font>
				<script>
					function onInit()
						onValueChanged();
					end
					
					function onValueChanged()
						if getValue() &lt;= 0 then
							setVisible(false);
							window.ammo_label.setVisible(false);
						else
							setVisible(true);
							window.ammo_label.setVisible(true);
						end
					end
				</script>
			</jpgnumberfield>
			<stringcontrol name="ammo_label">
				<anchored>
					<to>maxammo</to>
					<position>lefthigh</position>
					<offset>0,5</offset>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Ammo</static>
			</stringcontrol>

		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_skillitem">
		<sizelimits>
			<minimum>
				<height>10</height>
			</minimum>
		</sizelimits>
		<script>
			function onShowChanged()
				windowlist.applyFilter();
			end
		
			function onNameChanged()
				if sublabel.getValue() ~= "" then
					name.setValue(label.getValue() .. " (" .. sublabel.getValue() .. ")");
				else
					name.setValue(label.getValue());
				end
			end
			
			function onInit()
				onNameChanged();
			end
		</script>
		<sheetdata>
			<!-- Hidden values -->
			<stringfield name="label">
				<invisible />
				<bounds>0,0,1,1</bounds>
				<script>
					function onValueChanged()
						window.onNameChanged();
					end
				</script>
			</stringfield>
			<stringfield name="sublabel">
				<invisible />
				<bounds>0,0,1,1</bounds>
				<script>
					function onValueChanged()
						window.onNameChanged();
					end
				</script>
			</stringfield>
			<numberfield name="showonminisheet">
				<invisible />
				<bounds>0,0,1,1</bounds>
				<script>
					function onValueChanged()
						window.onShowChanged();
					end
				</script>
			</numberfield>
			
			<jpgnumberfield name="total">
				<anchored>
					<left>
						<anchor>right</anchor>
						<offset>-32</offset>
					</left>
					<top>
						<anchor>top</anchor>
						<offset>4</offset>
					</top>
					<size>
						<width>27</width>
						<height>14</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>2,5,5,5</offset>
				</frame>
				<font>sheetnumbersmall</font>
				<hideonvalue>0</hideonvalue>
				<displaysign />
				<noreset />
				<readonly />
				<script>
					function onDrag(button, x, y, draginfo)
						if OptionsManager.isOption("DRGR", "on") then
							draginfo.setType("dice");
							draginfo.setDieList({ "d20" });
						else
							draginfo.setType("number");
						end
						draginfo.setDescription("Skill [" .. window.name.getValue() .. "]");
						draginfo.setNumberData(getValue());
						draginfo.setShortcutData("charsheet", window.getDatabaseNode().getParent().getParent().getNodeName());
						
						return true;
					end

					function onDoubleClick(x,y)
						ChatManager.DoubleClickAction("dice", getValue(), "Skill [" .. window.name.getValue() .. "]", {pc = window.getDatabaseNode().getParent().getParent()});
						return true;
					end
				</script>
			</jpgnumberfield>
			<textlistitemvalue name="name">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>0</offset>
					</left>
					<right>
						<parent>total</parent>
						<anchor>left</anchor>
						<offset>-4,0</offset>
					</right>
					<top>
						<anchor>top</anchor>
						<offset>3</offset>
					</top>
				</anchored>
			</textlistitemvalue>
		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_featitem">
		<sizelimits>
			<minimum>
				<height>10</height>
			</minimum>
		</sizelimits>
		<sheetdata>
			<windowreferencefield name="shortcut">
				<anchored>
					<right>
						<anchor>right</anchor>
						<offset>-2</offset>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>20</width>
						<height>20</height>
					</size>
				</anchored>
				<icon>
					<normal>button_openwindow</normal>
					<empty>button_emptytarget</empty>
					<pressed>button_emptytarget</pressed>
				</icon>
				<allowdrop />
			</windowreferencefield>

			<textlistitemvalue name="value">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>0</offset>
					</left>
					<right>
						<parent>shortcut</parent>
						<anchor>left</anchor>
						<offset>-3</offset>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
				</anchored>
				<font>sheettextsmall</font>
			</textlistitemvalue>
		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_specialabilityitem">
		<sizelimits>
			<minimum>
				<height>10</height>
			</minimum>
		</sizelimits>
		<sheetdata>
			<specialabilitynumber name="number">
				<anchored>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>30</width>
						<height>16</height>
					</size>
				</anchored>
				<font>sheetnumbersmall</font>
				<frame>
					<name>modifier</name>
					<offset>4,4,4,4</offset>
				</frame>
				<script>
					function onDoubleClick(x,y)
						window.dice.onDoubleClick(x,y);
					end
				</script>
			</specialabilitynumber>

			<specialabilitydice name="dice">
				<anchored>
					<right>
						<parent>number</parent>
						<anchor>left</anchor>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>35</width>
						<height>15</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>4,4,4,5</offset>
				</frame>
			</specialabilitydice>

			<textlistitemvalue name="value">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>0</offset>
					</left>
					<right>
						<parent>dice</parent>
						<anchor>left</anchor>
						<offset>-2</offset>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
				</anchored>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							window.number.enable(true);
							window.number.setSourceValue(draginfo.getNumberData());
							return true;
						end

						if draginfo.isType("dice") then
							window.dice.enable(true);
							window.dice.setSourceValue(draginfo.getDieList());
							return true;
						end
					end
				</script>
			</textlistitemvalue>
		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_abilities">
		<placement>
			<size>
				<width>360</width>
				<height>220</height>
			</size>
		</placement>
		<nodelete />
		<script file="scripts/minisheet.lua" />
		<sheetdata>

			<!-- SKILLS -->
			<genericcontrol name="mini_skillframe">
				<bounds>0,10,215,250</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<windowlist name="skill_list">
				<anchored>
					<to>mini_skillframe</to>
					<position>over</position>
					<offset>-12,-9</offset>
				</anchored>
				<datasource>.skilllist</datasource>
				<class>charsheetmini_skillitem</class>
				<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>skill_list</to>
					<position>insidebottomright</position>
					<size>
						<width>45</width>
						<height>27</height>
					</size>
				</anchored>
				<target>skill_list</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>

			<!-- FEATS -->
			<genericcontrol name="mini_featframe">
				<bounds>215,10,-1,250</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<windowlist name="feat_list">
				<anchored>
					<to>mini_featframe</to>
					<position>over</position>
					<offset>-12,-9</offset>
				</anchored>
				<datasource>.featlist</datasource>
				<class>charsheetmini_featitem</class>
				<script>
					function onSortCompare(w1, w2)
						if w1.value.getValue() == "" then
							return true;
						elseif w2.value.getValue() == "" then
							return false;
						end
					
						return w1.value.getValue() &gt; w2.value.getValue();
					end
				</script>
			</windowlist>
			<scrollercontrol>
				<anchored>
					<to>feat_list</to>
					<position>insidebottomright</position>
					<size>
						<width>45</width>
						<height>27</height>
					</size>
				</anchored>
				<target>feat_list</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>

			<!-- SPECIAL ABILITIES -->
			<genericcontrol name="mini_saframe">
				<bounds>0,260,-1,-15</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<windowlist name="specialabilitylist">
				<anchored>
					<to>mini_saframe</to>
					<position>over</position>
					<offset>-12,-15</offset>
				</anchored>
				<datasource>.specialabilitylist</datasource>
				<class>charsheetmini_specialabilityitem</class>
				<script>
					function onFilter(w)
						local node = w.getDatabaseNode();
						if node and (node.getChild("number") or node.getChild("dice")) then
							return true;
						end
						return false;
					end
				
					function onSortCompare(w1, w2)
						if w1.value.getValue() == "" then
							return true;
						elseif w2.value.getValue() == "" then
							return false;
						end
					
						return w1.value.getValue() &gt; w2.value.getValue();
					end
				</script>
			</windowlist>
			<scrollercontrol>
				<anchored>
					<to>specialabilitylist</to>
					<position>insidebottomright</position>
					<size>
						<width>45</width>
						<height>27</height>
					</size>
				</anchored>
				<target>specialabilitylist</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_inventoryitem">
		<sizelimits>
			<minimum>
				<height>10</height>
			</minimum>
		</sizelimits>
		<script>
			function onShowChanged()
				windowlist.applyFilter();
			end
		</script>
		<sheetdata>
			<!-- Hidden values -->
			<numberfield name="showonminisheet">
				<invisible />
				<bounds>0,0,1,1</bounds>
				<script>
					function onValueChanged()
						window.onShowChanged();
					end
				</script>
			</numberfield>

			<jpgnumberfield name="count">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>2</offset>
					</left>
					<top>
						<anchor>top</anchor>
						<offset>4</offset>
					</top>
					<size>
						<width>20</width>
						<height>15</height>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumbersmall</font>
				<hideonvalue>0</hideonvalue>
				<noreset />
				<delaykeyupdate />
				<script>
					function onDoubleClick(x,y)
						window.dice.onDoubleClick(x,y);
					end
				</script>
			</jpgnumberfield>
			<inventorybonus name="bonus">
				<anchored>
					<right>
						<anchor>right</anchor>
						<offset>-25</offset>
					</right>
					<top>
						<anchor>top</anchor>
						<offset>2</offset>
					</top>
					<size>
						<width>25</width>
						<height>14</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>6,5,6,5</offset>
				</frame>
				<script>
					function onDoubleClick(x,y)
						window.dice.onDoubleClick(x,y);
					end
				</script>
			</inventorybonus>
			<inventorydice name="dice">
				<anchored>
					<right>
						<parent>bonus</parent>
						<anchor>left</anchor>
						<offset>-2</offset>
					</right>
					<top>
						<anchor>top</anchor>
						<offset>1</offset>
					</top>
					<size>
						<width>35</width>
						<height>15</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>4,4,4,5</offset>
				</frame>
			</inventorydice>
			<textlistitemvalue name="name">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>28</offset>
					</left>
					<right>
						<parent>dice</parent>
						<anchor>left</anchor>
						<offset>-2</offset>
					</right>
					<top>
						<anchor>top</anchor>
						<offset>3</offset>
					</top>
				</anchored>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("dice") then
							window.dice.enable(true);
							window.dice.setSourceValue(draginfo.getDieList());
							return true;
						end
						if draginfo.isType("number") then
							window.bonus.enable(true);
							window.bonus.setSourceValue(draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</textlistitemvalue>
			<windowreferencefield name="shortcut">
				<anchored>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>20</width>
						<height>20</height>
					</size>
				</anchored>
				<icon>
					<normal>button_openwindow</normal>
					<empty>button_emptytarget</empty>
					<pressed>button_emptytarget</pressed>
				</icon>
				<allowdrop />
			</windowreferencefield>
			
		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_inventory">
		<placement>
			<size>
				<width>360</width>
				<height>220</height>
			</size>
		</placement>
		<nodelete />
		<script file="scripts/minisheet.lua" />
		<sheetdata>

			<!-- COINS -->
			<genericcontrol name="mini_coinframe">
				<bounds>0,10,-1,65</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<sheetnumber name="coinamount1" source="coins.slot1.amount">
				<anchored>
					<to>mini_coinframe</to>
					<position>insidetopleft</position>
					<offset>50,30</offset>
					<size>
						<width>75</width>
						<height>25</height>
					</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>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocusplus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							setValue(getValue() + draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount1</to>
					<position>above</position>
					<offset>0,-16</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFFFFFFF</iconcolor>
			</genericcontrol>

			<sheetnumber name="coinamount2" source="coins.slot2.amount">
				<anchored>
					<to>coinamount1</to>
					<position>right</position>
					<offset>6,0</offset>
					<size>
						<width>75</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>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocusplus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							setValue(getValue() + draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount2</to>
					<position>above</position>
					<offset>0,-16</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFFFDF4B</iconcolor>
			</genericcontrol>

			<sheetnumber name="coinamount3" source="coins.slot3.amount">
				<anchored>
					<to>coinamount2</to>
					<position>right</position>
					<offset>6,0</offset>
					<size>
						<width>75</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>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocusplus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							setValue(getValue() + draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount3</to>
					<position>above</position>
					<offset>0,-16</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFE3E3E3</iconcolor>
			</genericcontrol>

			<sheetnumber name="coinamount4" source="coins.slot4.amount">
				<anchored>
					<to>coinamount3</to>
					<position>right</position>
					<offset>6,0</offset>
					<size>
						<width>75</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>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocusplus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							setValue(getValue() + draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount4</to>
					<position>above</position>
					<offset>0,-16</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFDDA15B</iconcolor>
			</genericcontrol>

			<!-- ITEMS -->
			<genericcontrol name="mini_inventoryframe">
				<bounds>0,75,-1,-15</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<windowlist name="inventorylist">
				<anchored>
					<to>mini_inventoryframe</to>
					<position>over</position>
					<offset>-12,-15</offset>
				</anchored>
				<datasource>.inventorylist</datasource>
				<class>charsheetmini_inventoryitem</class>
				<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>

	<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>
			<buttoncontrol name="use_button">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<top>
						<anchor>top</anchor>
						<offset>3</offset>
					</top>
					<size>
						<width>11</width>
						<height>9</height>
					</size>
				</anchored>
				<icon>
					<normal>button_use_spell</normal>
					<pressed>button_use_spell_down</pressed>
				</icon>
				<tooltip>
					<text>Cast Spell</text>
				</tooltip>
				<script>
					function onButtonPress()
						local desc = "Spell [" .. window.name.getValue() .. "]";
						local node = window.getDatabaseNode();
						
						if window.counter.canCast() then
							ChatManager.Message(desc .. " -&gt; " .. node.getChild("shortdescription").getValue(), true, {pc = window.getDatabaseNode().getParent().getParent().getParent().getParent().getParent().getParent()});
							window.counter.adjustCounter(1);
							if node.getChild("dice") then
								ChatManager.DieControlThrow("dice", window.bonus.getValue(), desc, {pc = window.getDatabaseNode().getParent().getParent().getParent().getParent().getParent().getParent()}, window.dice.getDice());
							end
						else
							ChatManager.Message(desc .. " -&gt; No more uses left", false, {pc = window.getDatabaseNode().getParent().getParent().getParent().getParent().getParent().getParent()});
						end
					end
				</script>
			</buttoncontrol>
			<windowreferencefield name="shortcut">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>14</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>
			<spellbonus name="bonus">
				<anchored>
					<right>
						<parent>counter</parent>
						<anchor>left</anchor>
						<offset>-5</offset>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>30</width>
						<height>15</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>3,3,3,4</offset>
				</frame>
			</spellbonus>
			
			<spelldice name="dice">
				<anchored>
					<right>
						<parent>bonus</parent>
						<anchor>left</anchor>
						<offset>-2</offset>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>35</width>
						<height>15</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>3,3,3,4</offset>
				</frame>
			</spelldice>
			<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>dice</parent>
						<anchor>left</anchor>
						<offset>-2</offset>
					</right>
				</anchored>
				<font>sheettextblock</font>
				<static />
			</stringfield>
		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_spelllistlevel">
		<sizelimits>
			<minimum>
				<height>11</height>
			</minimum>
		</sizelimits>
		<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()
						local label_val = "";
						if classnode then
							label_val = label_val .. classnode.getValue() .. " ";
						end
						label_val = label_val .. "Level " .. string.sub(window.getDatabaseNode().getName(), 6);
						setValue(label_val);
					end
					
					function onInit()
						local setnode = NodeManager.createSafeChild(window.getDatabaseNode(), "...");
						if setnode then
							local set = string.sub(setnode.getName(), 4);
							classnode = NodeManager.createSafeChild(window.getDatabaseNode(), ".....classes.slot" .. set .. ".name", "string");
							if classnode then
								classnode.onUpdate = updateLabel;
							end
						end
						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>

	<windowclass name="charsheetmini_spelllistset">
		<sizelimits>
			<minimum>
				<height>11</height>
			</minimum>
		</sizelimits>
		<script>
			function onInit()
				local classnum = string.sub(getDatabaseNode().getName(), 4);
				labelnode = NodeManager.createSafeChild(getDatabaseNode(), "...classes.slot" .. classnum .. ".name", "string");

				registerMenuItem("Reset " .. labelnode.getValue() .. " Powers", "erase", 3);
			end
			
			function onMenuSelection(selection)
				if selection == 3 then
					local levelnodelist = getDatabaseNode().getChild("levels").getChildren();
					for k,v in pairs(levelnodelist) do
						local spellnodelist = v.getChild("spells").getChildren();
						for k2, v2 in pairs(spellnodelist) do
							v2.getChild("cast").setValue(0);
						end
					end
					
					ChatManager.Message("Resetting " .. labelnode.getValue() .. " Powers", true, {pc = getDatabaseNode().getParent().getParent()});
				end
			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>

	<windowclass name="charsheetmini_spells">
		<placement>
			<size>
				<width>220</width>
				<height>200</height>
			</size>
		</placement>
		<nodelete />
		<script file="scripts/minisheet.lua" />
		<sheetdata>
			<!-- SPELLS -->
			<genericcontrol name="mini_spellframe">
				<bounds>0,10,-1,-15</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<windowlist name="spellsetlist">
				<anchored>
					<to>mini_spellframe</to>
					<position>over</position>
					<offset>-12,-15</offset>
				</anchored>
				<datasource>.spellset</datasource>
				<class>charsheetmini_spelllistset</class>
				<minisheet />
				<script>
					function onFilter(w)
						if w.label == "" then
							return false;
						end
						
						return true;
					end

					function onInit()
						NodeManager.createSafeChild(getDatabaseNode(), "set1");
						NodeManager.createSafeChild(getDatabaseNode(), "set2");
						NodeManager.createSafeChild(getDatabaseNode(), "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>

</root>
