<!-- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
	Z Corps - FENETRE NPC

	Version 1.0.0
	Neuralnoise
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->


<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.0">
	<template name="npctoplabel">
		<stringcontrol>
			<font>sheetlabelsmall</font>
			<center />
			<script>
				function onInit()
					if anchor then
						setAnchor("bottom", anchor[1], "top", "absolute", 2);
						setAnchor("left", anchor[1], "left", "absolute", 0);
						setAnchor("right", anchor[1], "right", "absolute", 0);
					end
				end
			</script>
		</stringcontrol>
	</template>

	<template name="attribut_prim">
		<numberfield>
			<nodrop />
			<noreset />
			<hideonvalue>0</hideonvalue>
			<font>sheettextsmall</font>
			<frame>
				<name>modifier</name>
				<offset>5,2,5,4</offset>
			</frame>
			<script>
				function onInit()
					setAnchor("top", "sante", "bottom", "absolute", 17);
					
					if anchor then
						setAnchor("left", anchor[1], "right", "relative", 5);
					else
						setAnchor("left", "sante", "left", "absolute", -2);
					end
					
					setAnchoredWidth(5);
					setAnchoredHeight(18);
					
					if getDatabaseNode().isStatic() then
						setFont("chatfont2");
					end
				end
			</script>
		</numberfield>
	</template>

	<template name="attribut_prim2">
		<numberfield>
			<nodrop />
			<noreset />
			<hideonvalue>0</hideonvalue>
			<font>sheettextsmall</font>
			<frame>
				<name>modifier</name>
				<offset>5,2,5,4</offset>
			</frame>
			<script>
				function onInit()
					setAnchor("top", "corps", "bottom", "absolute", 10);
					
					if anchor then
						setAnchor("left", anchor[1], "right", "relative", 5);
					else
						setAnchor("left", "corps", "left", "absolute", -2);
					end
					
					setAnchoredWidth(5);
					setAnchoredHeight(18);
					
					if getDatabaseNode().isStatic() then
						setFont("chatfont2");
					end
				end
			</script>
		</numberfield>
	</template>



	<template name="attribut_sec">
		<numberfield>
			<nodrop />
			<noreset />
			<displaysign />
			<font>sheettextsmall</font>
			<frame>
				<name>modifier</name>
				<offset>5,2,5,4</offset>
			</frame>
			<script>
				function onInit()
					setAnchor("top", "charisme", "bottom", "absolute", 17);
					
					if anchor then
						setAnchor("left", anchor[1], "right", "relative", 5);
					else
						setAnchor("left", "charisme", "left", "absolute", 0);
					end
					
					setAnchoredWidth(27);
					setAnchoredHeight(18);
					
					if getDatabaseNode().isStatic() then
						setFont("chatfont2");
					end
				end
			</script>
		</numberfield>
	</template>

	<template name="attribut_sec2">
		<numberfield>
			<nodrop />
			<noreset />
			<displaysign />
			<font>sheettextsmall</font>
			<frame>
				<name>modifier</name>
				<offset>5,2,5,4</offset>
			</frame>
			<script>
				function onInit()
					setAnchor("top", "taille", "bottom", "absolute", 10);
					
					if anchor then
						setAnchor("left", anchor[1], "right", "relative", 5);
					else
						setAnchor("left", "taille", "left", "absolute", 0);
					end
					
					setAnchoredWidth(27);
					setAnchoredHeight(18);
					
					if getDatabaseNode().isStatic() then
						setFont("chatfont2");
					end
				end
			</script>
		</numberfield>
	</template>
	
	<windowclass name="npc_combat">
		<datasource>npc</datasource>
		
		
		<sheetdata>
		
			<!-- ------------------------------------ AGILITE-->
				
			<columnstringfield name="Agilite">
				<tabtarget next="Adresse" prev="name" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>Agilite</anchor>
				<static>Agilité</static>
			</columnfieldlabel>
			<!-- ------------------------------------ ADRESSE -->
			<columnstringfield name="Adresse">
				<anchor>Agilite</anchor>
				<tabtarget next="Puissance" prev="Agilite" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>Adresse</anchor>
				<static>Adresse</static>
			</columnfieldlabel>
			<!-- ------------------------------------ PUISSANCE -->
			<columnstringfield name="Puissance">
				<anchor>Agilite</anchor>
				<tabtarget next="Connaissances" prev="Adresse" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>Puissance</anchor>
				<static>Puissance</static>
			</columnfieldlabel>
			<!-- ------------------------------------ CONNAISSANCES -->
			<columnstringfield name="Connaissances">
				<anchor>Agilite</anchor>
				<tabtarget next="Perception" prev="Puissance" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>Connaissances</anchor>
				<static>Connaissances</static>
			</columnfieldlabel>
			<!-- ------------------------------------ PERCEPTION-->
			<columnstringfield name="Perception">
				<anchor>Agilite</anchor>
				<tabtarget next="Presence" prev="Perception" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>Perception</anchor>
				<static>Perception</static>
			</columnfieldlabel>			
			<!-- ------------------------------------ PRESENCE -->
			<columnstringfield name="Presence">
				<anchor>Agilite</anchor>
				<tabtarget next="Armes" prev="Perception" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>Presence</anchor>
				<static>Présence</static>
			</columnfieldlabel>	
			<!-- ------------------------------------ ARMES -->
			<columnstringfield name="Armes">
				<anchor>Agilite</anchor>
				<tabtarget next="Niveauxdeblessures" prev="Presence" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>Armes</anchor>
				<static>Armes</static>
			</columnfieldlabel>	
			<!-- ------------------------------------ NIVEAUX DE BLESSURES -->
			<columnstringfield name="Niveauxdeblessures">
				<anchor>Agilite</anchor>
				<tabtarget next="bonusauxdegats" prev="Armes" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>Niveauxdeblessures</anchor>
				<static>Niv. Blessures</static>
			</columnfieldlabel>					
			<!-- ------------------------------------ BONUS AUX DEGATS -->			
			<columnstringfield name="bonusauxdegats">
				<anchor>Agilite</anchor>
				<tabtarget next="deplacement" prev="Niveauxdeblessures" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>bonusauxdegats</anchor>
				<static>Bonus dégâts</static>
			</columnfieldlabel>
			<!-- ------------------------------------ DEPLACEMENT -->
			<columnnumberfield name="deplacement">
				<anchor>bonusauxdegats</anchor>
				<tabtarget next="name" prev="bonusauxdegats" />
			</columnnumberfield>
			<columnfieldlabel>
				<anchor>deplacement</anchor>
				<static>Déplacement</static>
			</columnfieldlabel>
									
			<!-- Spacer -->
			<genericcontrol>
				<anchored>
					<to>deplacement</to>
					<position>below</position>
					<size>
						<height>25</height>
					</size>
				</anchored>
			</genericcontrol>
		</sheetdata>
	</windowclass>

	<windowclass name="npc_other">
		<datasource>npc</datasource>
		<sheetdata>
			<columnstringfield name="type">
				<tabtarget next="equipement" prev="name" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>type</anchor>
				<static>Archétype</static>
			</columnfieldlabel>

			<columnstringfield name="equipement">
				<anchor>type</anchor>
				<tabtarget next="special" prev="type" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>equipement</anchor>
				<static>Equipement</static>
			</columnfieldlabel>
			
			<columnstringfield name="special">
				<anchor>type</anchor>
				<tabtarget next="defaut" prev="equipement" />
			</columnstringfield>
			<columnfieldlabel>
				<anchor>special</anchor>
				<static>Spécial</static>
			</columnfieldlabel>
			
			

			<!-- Spacer -->
			<genericcontrol>
				<anchored>
					<to>special</to>
					<position>below</position>
					<size>
						<height>15</height>
					</size>
				</anchored>
			</genericcontrol>
		</sheetdata>
	</windowclass>

	<windowclass name="npc_description">
		<datasource>npc</datasource>
		<sheetdata>
			<!-- DESCRIPTION -->
			<formattedtextfield name="text">
				<anchored>
					<top>
						<anchor>top</anchor>
					</top>
					<left>
						<anchor>left</anchor>
					</left>
					<right>
						<anchor>right</anchor>
					</right>
				</anchored>
				<font>
					<normal>chatfont2</normal>
					<bold>narratorfont2</bold>
					<italic>chatitalicfont2</italic>
					<bolditalic>chatbolditalicfont2</bolditalic>
					<title>defaultstringcontrol</title>
				</font>
				<linkicon>
					<link>button_openwindow</link>
					<emptylink>button_emptytarget</emptylink>
				</linkicon>
				<selectioncolor>#ffffff</selectioncolor>
				<footer>footer_narrow</footer>
				<empty>Cliquer pour entrer une description</empty>
			</formattedtextfield>
		</sheetdata>
	</windowclass>

	<windowclass name="npc">
		<datasource>npc</datasource>
		<frame>charsheet</frame>
		<placement>
			<size>
				<width>500</width>
				<height>400</height>
			</size>
		</placement>
		<sizelimits>
			<minimum>
				<width>300</width>
				<height>400</height>
			</minimum>
			<dynamic />
		</sizelimits>
		<minimize>minimized_npc</minimize>
		<tooltip>
			<field>name</field>
		</tooltip>
		<sheetdata>
			<!-- NAME -->
			<genericcontrol name="nameframe">
				<bounds>38,20,-35,35</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>
			<windowopencontrol>
				<anchored>
					<to>nameframe</to>
					<position>insidetopleft</position>
					<offset>13,8</offset>
					<size>
						<width>20</width>
						<height>20</height>
					</size>
				</anchored>
				<icon>
					<normal>button_openwindow</normal>
					<pressed>button_emptytarget</pressed>
				</icon>
				<class>npc</class>
				<description>
					<field>name</field>
				</description>
			</windowopencontrol>
			<stringfield name="name">
				<anchored>
					<top>
						<parent>nameframe</parent>
						<anchor>top</anchor>
						<offset>9</offset>
					</top>
					<left>
						<parent>nameframe</parent>
						<anchor>left</anchor>
						<offset>35</offset>
					</left>
					<right>
						<parent>nameframe</parent>
						<anchor>right</anchor>
						<offset>-15</offset>
					</right>
				</anchored>
				<empty>&#171; Nouveau PNJ &#187;</empty>
				<font>sheettext2</font>
			</stringfield>
			<tokenfield name="token">
				<bounds>13,25,25,25</bounds>
				<empty>indicator_emptytoken</empty>
			</tokenfield>
			<buttoncontrol>
				<bounds>-36,27,23,22</bounds>
				<icon>
					<normal>button_identityactivate</normal>
					<pressed>button_identityactivate_down</pressed>
				</icon>
				<script>
					function onButtonPress()
						GmIdentityManager.addIdentity(window.name.getValue());
					end
				</script>
			</buttoncontrol>

			<genericcontrol name="tabcontentframe">
				<bounds>10,54,-25,-15</bounds>
				<frame>
					<name>sheetgroup</name>
					<offset>0,1,0,0</offset>
				</frame>
			</genericcontrol>

			<!-- SUBWINDOWS -->
			<subwindow name="description">
				<anchored>
					<to>tabcontentframe</to>
					<position>over</position>
					<offset>-15,-7</offset>
				</anchored>
				<class>npc_description</class>
			</subwindow>
			<subwindow name="combat">
				<anchored>
					<to>tabcontentframe</to>
					<position>over</position>
					<offset>-15,-7</offset>
				</anchored>
				<class>npc_combat</class>
			</subwindow>
			<subwindow name="other">
				<anchored>
					<to>tabcontentframe</to>
					<position>over</position>
					<offset>-15,-7</offset>
				</anchored>
				<class>npc_other</class>
			</subwindow>

			<scrollercontrol name="description_scroller">
				<bounds>-79,-50,45,27</bounds>
				<target>description</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
				<invisible />
			</scrollercontrol>
			<scrollercontrol name="combat_scroller">
				<bounds>-79,-50,45,27</bounds>
				<target>combat</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
				<invisible />
			</scrollercontrol>
			<scrollercontrol name="other_scroller">
				<bounds>-79,-50,45,27</bounds>
				<target>other</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
				<invisible />
			</scrollercontrol>

			<tabcontrol name="tabs">
				<bounds>-22,50,18,223</bounds>
				<tab>
					<icon>tab_main</icon>
					<subwindow>description</subwindow>
					<scroller>description_scroller</scroller>
				</tab>
				<tab>
					<icon>tab_combat</icon>
					<subwindow>combat</subwindow>
					<scroller>combat_scroller</scroller>
				</tab>
				<tab>
					<icon>tab_other</icon>
					<subwindow>other</subwindow>
					<scroller>other_scroller</scroller>
				</tab>
				<activate>2</activate>
			</tabcontrol>
		</sheetdata>
	</windowclass>

	<windowclass name="npcsmall">
		<sizelimits>
			<minimum>
				<height>10</height>
			</minimum>
		</sizelimits>
		<sheetdata>
			<windowreferencecontrol name="open">
				<bounds>0,0,20,20</bounds>
				<icon>
					<normal>button_openwindow</normal>
					<pressed>button_emptytarget</pressed>
				</icon>
				<class>npc</class>
				<description>
					<field>name</field>
				</description>
			</windowreferencecontrol>
			<linkstringfield name="name">
				<bounds>25,1,-1,20</bounds>
				<empty>&#171; Nouveau PNJ &#187;</empty>
				<selectioncolor>#90ffffff</selectioncolor>
				<font>sheettext2</font>
				<linktarget>open</linktarget>
			</linkstringfield>
		</sheetdata>
	</windowclass>

	<windowclass name="npclist">
		<frame>scrollboxfortabs</frame>
		<softclose />
		<placement>
			<size>
				<width>275</width>
				<height>350</height>
			</size>
		</placement>
		<sizelimits>
			<dynamic />
			<minimum>
				<width>200</width>
				<height>290</height>
			</minimum>
		</sizelimits>
		<nodelete />
		<sheetdata>
			<genericcontrol>
				<bounds>16,21,30,157</bounds>
				<icon>title_npcs</icon>
			</genericcontrol>
			<windowlist name="list">
				<bounds>50,25,-30,-34</bounds>
				<datasource>.</datasource>
				<class>npcsmall</class>
				<sortfields>name</sortfields>
				<footer>footer_narrow</footer>
				<allowcreate />
				<allowdelete />
				
				
				<acceptdrop>
					
					
					<field>hd</field>
					<!-- <field>ac</field> -->
					
					<field>atk</field>
					
					<class>npc</class>
					<field>name</field>
					<field>text</field>					
													
					<field>Agilite</field>
					<field>Adresse</field>
					<field>Puissance</field>
					<field>Connaissances</field>
					
					<field>bonusauxdegats</field>
					<field>deplacement</field>
					<field>space</field>					
					
					<field>type</field>
					<field>special</field>
					<field>equipement</field>
					
					
				</acceptdrop>
				<script>
					function onSortCompare(w1, w2)
						return w1.name.getValue() &gt; w2.name.getValue();
					end;
					
					function onFilter(w)
						local f = string.lower(window.filter.getValue());
						
						if f == "" then
							return true;
						end
						
						if string.find(string.lower(w.name.getValue()), f, 0, true) then
							return true;
						end
						
						return false;
					end
				</script>
			</windowlist>
			<scrollercontrol>
				<bounds>-105,-61,45,27</bounds>
				<target>list</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>

			<buttoncontrol>
				<bounds>-55,-58,34,25</bounds>
				<icon>
					<normal>button_newwindow</normal>
					<pressed>button_newwindowdown</pressed>
				</icon>
				<class>npc</class>
				<script>
					function onButtonPress()
						local node = window.getDatabaseNode();
						if node then
							node = node.createChild();
							if node then
								Interface.openWindow(class[1], node.getNodeName());
							end
						end
					end
				</script>
			</buttoncontrol>
			<categoryselectioncontrol>
				<bounds>24,-39,-24,-1</bounds>
				<targetcontrol>list</targetcontrol>
			</categoryselectioncontrol>

			<filter name="filter">
				<bounds>55,-70,-50,20</bounds>
				<target>list</target>
				<trigger>filtertrigger</trigger>
			</filter>
			<filtertrigger name="filtertrigger">
				<bounds>20,-85,21,41</bounds>
				<target>filter</target>
			</filtertrigger>			
		</sheetdata>
	</windowclass>
</root>

