<!-- 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/d20
  --
  -- For information on the Fantasy Grounds d20 Ruleset licensing and
  -- the OGL license text, see the d20 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 2007 SmiteWorks Ltd.
  -->

<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.0">
	<windowclass name="referencetext">
		<frame>referencebox</frame>
		<placement>
			<size>
				<width>400</width>
				<height>450</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic />
		</sizelimits>
		<minimize>minimized_reference</minimize>
		<tooltip>
			<field>name</field>
		</tooltip>
		<sheetdata>
			<windowreferencecontrol>
				<bounds>20,18,20,20</bounds>
				<icon>
					<normal>button_openwindow</normal>
				</icon>
				<class>encounter</class>
				<description>
					<field>name</field>
				</description>
			</windowreferencecontrol>
			<stringfield name="name">
				<bounds>45,22,-25,20</bounds>
				<font>sheetlabel</font>
			</stringfield>
			<formattedtextfield name="text">
				<bounds>25,44,-25,-14</bounds>
				<font>
					<normal>chatfont</normal>
					<bold>narratorfont</bold>
					<italic>chatitalicfont</italic>
					<bolditalic>chatbolditalicfont</bolditalic>
					<title>sheetlabel</title>
				</font>
				<linkicon>
					<link>button_openwindow</link>
					<emptylink>button_emptytarget</emptylink>
				</linkicon>
				<footer>footer_wide</footer>
				<selectioncolor>#FFD296</selectioncolor>
			</formattedtextfield>
			<scrollercontrol>
				<anchored>
					<to>text</to>
					<position>insidebottomright</position>
				</anchored>
				<target>text</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

	<windowclass name="referencetextwide">
		<frame>referencebox</frame>
		<placement>
			<size>
				<width>650</width>
				<height>650</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic>
				<resize>vertical</resize>
			</dynamic>
		</sizelimits>
		<minimize>minimized_reference</minimize>
		<tooltip>
			<field>name</field>
		</tooltip>
		<sheetdata>
			<windowreferencecontrol>
				<bounds>20,18,20,20</bounds>
				<icon>
					<normal>button_openwindow</normal>
				</icon>
				<class>encounter</class>
				<description>
					<field>name</field>
				</description>
			</windowreferencecontrol>
			<stringfield name="name">
				<bounds>45,22,-25,20</bounds>
				<font>sheetlabel</font>
			</stringfield>
			<formattedtextfield name="text">
				<bounds>25,44,-25,-14</bounds>
				<font>
					<normal>chatfont</normal>
					<bold>narratorfont</bold>
					<italic>chatitalicfont</italic>
					<bolditalic>chatbolditalicfont</bolditalic>
					<title>sheetlabel</title>
				</font>
				<linkicon>
					<link>button_openwindow</link>
					<emptylink>button_emptytarget</emptylink>
				</linkicon>
				<footer>footer_wide</footer>
				<selectioncolor>#FFD296</selectioncolor>
			</formattedtextfield>
			<scrollercontrol>
				<anchored>
					<to>text</to>
					<position>insidebottomright</position>
				</anchored>
				<target>text</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

	<!-- Feats -->
	<windowclass name="referencefeatcontent">
		<sheetdata>
			<stringcontrol name="typeleftbracket">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<height>20</height>
						<width>5</width>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>[</static>
			</stringcontrol>
			<stringfield name="type">
				<anchored>
					<to>typeleftbracket</to>
					<position>right</position>
				</anchored>
				<font>sheetlabel</font>
			</stringfield>
			<stringcontrol name="typerightbracket">
				<anchored>
					<to>type</to>
					<position>right</position>
				</anchored>
				<font>sheetlabel</font>
				<size>
					<width>10</width>
				</size>
				<static>]</static>
			</stringcontrol>

			<stringfield name="prerequisites">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<parent>type</parent>
						<anchor>bottom</anchor>
						<offset>12</offset>
					</top>
				</anchored>
				<font>chatfont</font>
				<empty>-</empty>
			</stringfield>
			<stringcontrol>
				<anchored>
					<to>prerequisites</to>
					<position>above</position>
				</anchored>
				<font>sheetlabelsmallbold</font>
				<static>Prerequisites</static>
			</stringcontrol>

			<stringcontrol name="benefitlabel">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<parent>prerequisites</parent>
						<anchor>bottom</anchor>
						<offset>10</offset>
					</top>
				</anchored>
				<font>sheetlabelsmallbold</font>
				<static>Benefit</static>
			</stringcontrol>
			<formattedtextfield name="benefit">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<parent>benefitlabel</parent>
						<anchor>bottom</anchor>
					</top>
				</anchored>
				<font>
					<normal>chatfont</normal>
					<bold>narratorfont</bold>
					<italic>chatitalicfont</italic>
					<bolditalic>chatbolditalicfont</bolditalic>
					<title>sheetlabel</title>
				</font>
				<linkicon>
					<link>button_openwindow</link>
					<emptylink>button_emptytarget</emptylink>
				</linkicon>
				<selectioncolor>#FFD296</selectioncolor>
				<script>
					function onInit()
						if isEmpty() then
							setVisible(false);
							window.benefitlabel.setVisible(false);
						end
					end
				</script>
			</formattedtextfield>


			<stringcontrol name="normallabel">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<parent>benefit</parent>
						<anchor>bottom</anchor>
					</top>
				</anchored>
				<font>sheetlabelsmallbold</font>
				<static>Normal</static>
			</stringcontrol>
			<formattedtextfield name="normal">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<parent>normallabel</parent>
						<anchor>bottom</anchor>
					</top>
				</anchored>
				<font>
					<normal>chatfont</normal>
					<bold>narratorfont</bold>
					<italic>chatitalicfont</italic>
					<bolditalic>chatbolditalicfont</bolditalic>
					<title>sheetlabel</title>
				</font>
				<linkicon>
					<link>button_openwindow</link>
					<emptylink>button_emptytarget</emptylink>
				</linkicon>
				<selectioncolor>#FFD296</selectioncolor>
				<script>
					function onInit()
						if isEmpty() then
							setVisible(false);
							window.normallabel.setVisible(false);
						end
					end
				</script>
			</formattedtextfield>

			<stringcontrol name="speciallabel">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<parent>normal</parent>
						<anchor>bottom</anchor>
					</top>
				</anchored>
				<font>sheetlabelsmallbold</font>
				<static>Special</static>
			</stringcontrol>
			<formattedtextfield name="special">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<parent>speciallabel</parent>
						<anchor>bottom</anchor>
					</top>
				</anchored>
				<font>
					<normal>chatfont</normal>
					<bold>narratorfont</bold>
					<italic>chatitalicfont</italic>
					<bolditalic>chatbolditalicfont</bolditalic>
					<title>sheetlabel</title>
				</font>
				<linkicon>
					<link>button_openwindow</link>
					<emptylink>button_emptytarget</emptylink>
				</linkicon>
				<selectioncolor>#FFD296</selectioncolor>
				<script>
					function onInit()
						if isEmpty() then
							setVisible(false);
							window.speciallabel.setVisible(false);
						end
					end
				</script>
			</formattedtextfield>
		</sheetdata>
	</windowclass>

	<windowclass name="referencefeat">
		<frame>referencebox</frame>
		<placement>
			<size>
				<width>400</width>
				<height>350</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic />
		</sizelimits>
		<minimize>minimized_reference</minimize>
		<tooltip>
			<field>name</field>
		</tooltip>
		<sheetdata>
			<windowreferencecontrol>
				<bounds>20,16,20,20</bounds>
				<icon>
					<normal>button_openwindow</normal>
				</icon>
				<class>referencefeat</class>
				<description>
					<field>name</field>
				</description>
			</windowreferencecontrol>
			<stringfield name="name">
				<bounds>45,20,-25,20</bounds>
				<font>sheetlabel</font>
			</stringfield>

			<subwindow name="content">
				<bounds>20,40,-25,-14</bounds>
				<class>referencefeatcontent</class>
				<activate />
			</subwindow>

			<scrollercontrol>
				<anchored>
					<to>content</to>
					<position>insidebottomright</position>
				</anchored>
				<target>content</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

	<!-- Skills -->
	<windowclass name="referenceskillcontent">
		<sheetdata>
			<stringcontrol name="typeleftbracket">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<height>20</height>
						<width>5</width>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>[</static>
			</stringcontrol>
			<stringcontrol name="ability">
				<anchored>
					<to>typeleftbracket</to>
					<position>right</position>
				</anchored>
				<font>sheetlabel</font>
				<script>
					function onInit()
						abilitynode = window.getDatabaseNode().getChild("ability");
						trainednode = window.getDatabaseNode().getChild("trained");
						armorchecknode = window.getDatabaseNode().getChild("armorcheckpenalty");
						
						local value = abilitynode.getValue();
						
						if trainednode and trainednode.getValue() ~= 0 then
							value = value .. "; Trained only";
						end
						if armorchecknode and armorchecknode.getValue() ~= 0 then
							value = value .. "; Armor check penalty";
						end
						
						setValue(value);
					end
				</script>
			</stringcontrol>
			<stringcontrol name="typerightbracket">
				<anchored>
					<to>ability</to>
					<position>right</position>
				</anchored>
				<font>sheetlabel</font>
				<size>
					<width>10</width>
				</size>
				<static>]</static>
			</stringcontrol>

			<formattedtextfield name="text">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<parent>ability</parent>
						<anchor>bottom</anchor>
					</top>
				</anchored>
				<font>
					<normal>chatfont</normal>
					<bold>narratorfont</bold>
					<italic>chatitalicfont</italic>
					<bolditalic>chatbolditalicfont</bolditalic>
					<title>sheetlabel</title>
				</font>
				<linkicon>
					<link>button_openwindow</link>
					<emptylink>button_emptytarget</emptylink>
				</linkicon>
				<selectioncolor>#FFD296</selectioncolor>
			</formattedtextfield>
		</sheetdata>
	</windowclass>

	<windowclass name="referenceskill">
		<frame>referencebox</frame>
		<placement>
			<size>
				<width>400</width>
				<height>350</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic />
		</sizelimits>
		<minimize>minimized_reference</minimize>
		<tooltip>
			<field>name</field>
		</tooltip>
		<sheetdata>
			<windowreferencecontrol>
				<bounds>20,16,20,20</bounds>
				<icon>
					<normal>button_openwindow</normal>
				</icon>
				<class>referencefeat</class>
				<description>
					<field>name</field>
				</description>
			</windowreferencecontrol>
			<stringfield name="name">
				<bounds>45,20,-25,20</bounds>
				<font>sheetlabel</font>
			</stringfield>

			<subwindow name="content">
				<bounds>20,40,-25,-14</bounds>
				<class>referenceskillcontent</class>
				<activate />
			</subwindow>

			<scrollercontrol>
				<anchored>
					<to>content</to>
					<position>insidebottomright</position>
				</anchored>
				<target>content</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

	<!-- Generic lists -->
	<windowclass name="referenceindexitem">
		<sizelimits>
			<minimum>
				<height>20</height>
			</minimum>
		</sizelimits>
		<sheetdata>
			<windowreferencefield name="listlink">
				<bounds>0,0,20,20</bounds>
				<icon>
					<normal>button_openwindow</normal>
					<pressed>button_emptytarget</pressed>
				</icon>
			</windowreferencefield>
			<staticlinkstringfield name="name">
				<bounds>25,4,-1,15</bounds>
				<font>sheetlabel</font>
				<linktarget>listlink</linktarget>
			</staticlinkstringfield>
		</sheetdata>
	</windowclass>

	<windowclass name="referenceindexcontent">
		<sizelimits>
			<minimum>
				<height>20</height>
			</minimum>
			<maximum>
				<height>10000</height>
			</maximum>
		</sizelimits>
		<sheetdata>
			<stringfield name="name">
				<bounds>0,10,-1,20</bounds>
				<font>sheetlabel</font>
				<center />
				<nodrag />
			</stringfield>
			
			<formattedtextfield name="description">
				<anchored>
					<to>name</to>
					<position>below</position>
				</anchored>
				<font>
					<normal>chatfont</normal>
					<bold>narratorfont</bold>
					<italic>chatitalicfont</italic>
					<bolditalic>chatbolditalicfont</bolditalic>
					<title>sheetlabel</title>
				</font>
				<linkicon>
					<link>button_openwindow</link>
					<emptylink>button_emptytarget</emptylink>
				</linkicon>
				<selectioncolor>#FFD296</selectioncolor>
				<script>
					function onInit()
						if isEmpty() then
							setVisible(false);
						end
					end
				</script>
			</formattedtextfield>

			<windowlist name="index">
				<anchored>
					<to>description</to>
					<position>below</position>
					<right>
						<parent>name</parent>
						<anchor>right</anchor>
					</right>
				</anchored>
				<datasource>.index</datasource>
				<class>referenceindexitem</class>
				<noscroll />
			</windowlist>
		</sheetdata>
	</windowclass>

	<windowclass name="referenceindex">
		<frame>referencebox</frame>
		<placement>
			<size>
				<width>350</width>
				<height>450</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic />
		</sizelimits>
		<minimize>minimized_reference</minimize>
		<tooltip>
			<field>name</field>
		</tooltip>
		<sheetdata>
			<subwindow name="content">
				<class>referenceindexcontent</class>
				<bounds>20,9,-22,-14</bounds>
				<activate />
			</subwindow>
			<scrollercontrol>
				<anchored>
					<to>content</to>
					<position>insidebottomright</position>
				</anchored>
				<target>content</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

	<windowclass name="referenceindexbig">
		<frame>referencebox</frame>
		<placement>
			<size>
				<width>450</width>
				<height>650</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic />
		</sizelimits>
		<minimize>minimized_reference</minimize>
		<tooltip>
			<field>name</field>
		</tooltip>
		<sheetdata>
			<subwindow name="content">
				<class>referenceindexcontent</class>
				<bounds>20,9,-22,-14</bounds>
				<activate />
			</subwindow>
			<scrollercontrol>
				<anchored>
					<to>content</to>
					<position>insidebottomright</position>
				</anchored>
				<target>content</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

	<windowclass name="referenceindexbigwide">
		<frame>referencebox</frame>
		<placement>
			<size>
				<width>750</width>
				<height>450</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic />
		</sizelimits>
		<minimize>minimized_reference</minimize>
		<tooltip>
			<field>name</field>
		</tooltip>
		<sheetdata>
			<subwindow name="content">
				<class>referenceindexcontent</class>
				<bounds>20,9,-22,-14</bounds>
				<activate />
			</subwindow>
			<scrollercontrol>
				<anchored>
					<to>content</to>
					<position>insidebottomright</position>
				</anchored>
				<target>content</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>

	<!-- Inline text list -->
	<windowclass name="referenceinlineindexitem">
		<sizelimits>
			<minimum>
				<height>20</height>
			</minimum>
			<maximum>
				<height>10000</height>
			</maximum>
		</sizelimits>
		<sheetdata>
			<stringfield name="name">
				<bounds>0,4,-1,15</bounds>
				<font>sheetlabel</font>
				<static />
				<script>
					function onClickDown(button, x, y)
						window.text.setVisible(not window.text.isVisible());
					end
				</script>
			</stringfield>
			<formattedtextfield name="text">
				<anchored>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<parent>name</parent>
						<anchor>bottom</anchor>
						<offset>3</offset>
					</top>
				</anchored>
				<invisible />
				<font>
					<normal>chatfont</normal>
					<bold>narratorfont</bold>
					<italic>chatitalicfont</italic>
					<bolditalic>chatbolditalicfont</bolditalic>
					<title>sheetlabel</title>
				</font>
				<linkicon>
					<link>button_openwindow</link>
					<emptylink>button_emptytarget</emptylink>
				</linkicon>
				<selectioncolor>#FFD296</selectioncolor>
			</formattedtextfield>
		</sheetdata>
	</windowclass>

	<windowclass name="referenceinlineindex">
		<frame>referencebox</frame>
		<placement>
			<size>
				<width>600</width>
				<height>450</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic />
		</sizelimits>
		<minimize>minimized_reference</minimize>
		<tooltip>
			<field>description</field>
		</tooltip>
		<sheetdata>
			<stringfield name="name">
				<bounds>25,20,-25,20</bounds>
				<font>sheetlabel</font>
				<center />
				<nodrag />
			</stringfield>

			<windowlist name="index">
				<bounds>20,40,-20,-14</bounds>
				<datasource>.index</datasource>
				<class>referenceinlineindexitem</class>
			</windowlist>
			<scrollercontrol>
				<anchored>
					<to>index</to>
					<position>insidebottomright</position>
				</anchored>
				<target>index</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>
		</sheetdata>
	</windowclass>
</root>
