<?xml version="1.0" encoding="utf-8"?>

<objects>

	<script file="gui/common/functions_civinfo.js"/>
	<script file="gui/common/functions_utility.js" />
	<script file="gui/common/functions_global_object.js" />
	<script file="gui/common/timer.js"/>
	<script file="gui/session/session.js"/>
	<script file="gui/session/selection.js"/>
	<script file="gui/session/input.js"/>
	<script file="gui/session/music.js"/>
	<script file="gui/session/menu.js"/>
	<script file="gui/session/selection_details.js"/>
	<script file="gui/session/unit_commands.js"/>
	<script file="gui/session/messages.js"/>
	<script file="gui/session/utility_functions.js"/>

	<object name="sn" hotkey="session.gui.toggle">
		<action on="Tick">
			onTick();
		</action>

		<action on="SimulationUpdate">
			onSimulationUpdate();
		</action>

		<action on="Press">
			this.hidden = !this.hidden;
		</action>

		<!-- ================================  ================================ -->
		<!-- ALPHA LABELS (alpha, build time, revision) -->
		<!-- ================================  ================================ -->
		
		<!-- Displays Alpha name and number -->
		<object size="100%-200 32 100% 52" name="alphaLabel" type="text" style="centeredText" font="serif-bold-16" textcolor="white" ghost="true">
			ALPHA VI : Fortuna
		</object>

		<!-- Displays build date and revision number-->
		<object size="100%-200 52 100% 72" name="buildTimeLabel" type="text" style="centeredText" font="serif-12" textcolor="white" ghost="true">
			<action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action>
		</object>
	
		<!-- ================================  ================================ -->
		<!-- HOTKEYS (For some reason, they won't work properly unless outside menu) -->
		<!-- ================================  ================================ -->
		
		<!-- Exit button Hotkey  -->
			<!--
				<action on="Press"><![CDATA[
					messageBox(400, 200, "Do you really want to quit?", "Confirmation", 0,
						["Yes", "No!"], [leaveGame, null]);
				]]></action> 
			-->
		
		<object hotkey="leave">
			<action on="Press">escapeKeyAction();</action>
		</object>

		<!-- Chat: Depending on the current state, it either opens message window or closes message window / posts message -->
		<object hotkey="chat">
			<action on="Press">toggleChatWindow();</action>
		</object>

		<!-- Menu -->
		<object hotkey="menu.toggle">
			<action on="Press">openMenuDialog();</action>
		</object>

		<!-- Pause -->
		<object hotkey="pause">
			<action on="Press">togglePause();</action>
		</object>
		
		<!-- Delete button Hotkey (For some reason it won't work when the console is visible -->
		<object hotkey="session.kill">
			<action on="Press">performCommand(g_Selection.toList()[0], "delete");</action>
		</object>

		<!-- camera.follow mode - follow the first unit in the selection -->
		<object hotkey="camera.follow">
			<action on="Press">setCameraFollow(g_Selection.toList()[0]);</action>
		</object>
		
		<!-- ================================  ================================ -->
		<!-- Developer / Debug items -->
		<!-- ================================  ================================ -->
		
		<!-- Debug text -->
		<object name="debug"
			type="text"
			size="0 70 80% 100%"
			ghost="true"
			textcolor="yellow"
			font="mono-stroke-10"
		/>

		<!-- Dev/cheat commands -->
		<object name="devCommands" size="100%-156 72 100%-16 232" type="image" sprite="devCommandsBackground"
				hidden="true" hotkey="session.devcommands.toggle">
			<action on="Press">
				toggleDeveloperOverlay();
			</action>

			<object size="0 0 100%-18 16" type="text" style="devCommandsText">Control all units</object>
			<object size="100%-16 0 100% 16" type="checkbox" name="devControlAll" style="wheatCrossBox">
				<action on="Press">
					g_DevSettings.controlAll = this.checked;
					Engine.PostNetworkCommand( {"type": "control-all", "flag": this.checked} );
				</action>
			</object>

			<object size="0 16 100%-18 32" type="text" style="devCommandsText">Display selection state</object>
			<object size="100%-16 16 100% 32" type="checkbox" name="devDisplayState" style="wheatCrossBox"/>

			<object size="0 32 100%-18 48" type="text" style="devCommandsText">Pathfinder overlay</object>
			<object size="100%-16 32 100% 48" type="checkbox" style="wheatCrossBox">
				<action on="Press">Engine.GuiInterfaceCall("SetPathfinderDebugOverlay", this.checked);</action>
			</object>

			<object size="0 48 100%-18 64" type="text" style="devCommandsText">Obstruction overlay</object>
			<object size="100%-16 48 100% 64" type="checkbox" style="wheatCrossBox">
				<action on="Press">Engine.GuiInterfaceCall("SetObstructionDebugOverlay", this.checked);</action>
			</object>

			<object size="0 64 100%-18 80" type="text" style="devCommandsText">Unit motion overlay</object>
			<object size="100%-16 64 100% 80" type="checkbox" style="wheatCrossBox">
				<action on="Press">g_Selection.SetMotionDebugOverlay(this.checked);</action>
			</object>

			<object size="0 80 100%-18 96" type="text" style="devCommandsText">Range overlay</object>
			<object size="100%-16 80 100% 96" type="checkbox" style="wheatCrossBox">
				<action on="Press">Engine.GuiInterfaceCall("SetRangeDebugOverlay", this.checked);</action>
			</object>

			<object size="0 96 100%-18 112" type="text" style="devCommandsText">Restrict camera</object>
			<object size="100%-16 96 100% 112" type="checkbox" style="wheatCrossBox" checked="true">
				<action on="Press">gameView.constrainCamera = this.checked;</action>
			</object>

			<object size="0 112 100%-18 128" type="text" style="devCommandsText">Reveal map</object>
			<object name="devCommandsRevealMap" size="100%-16 112 100% 128" type="checkbox" style="wheatCrossBox">
				<action on="Press">Engine.PostNetworkCommand({"type": "reveal-map", "enable": this.checked});</action>
			</object>

			<object size="0 128 100%-18 144" type="text" style="devCommandsText">Enable time warp</object>
			<object size="100%-16 128 100% 144" type="checkbox" name="devTimeWarp" style="wheatCrossBox">
				<action on="Press">Engine.EnableTimeWarpRecording(this.checked ? 10 : 0);</action>
			</object>

			<object size="0 144 100%-18 160" type="text" style="devCommandsText">Promote selected units</object>
			<object size="100%-16 144 100% 160" type="button" style="wheatCrossBox">
				<action on="Press">Engine.PostNetworkCommand({"type": "promote", "entities": g_Selection.toList()});</action>
			</object>
		</object>

		<!-- ================================  ================================ -->
		<!-- Pause Overlay -->
		<!-- ================================  ================================ -->
		<object type="button"
			name="pauseOverlay"
			size="0 0 100% 100%"
			tooltip_style="sessionToolTip"
			hidden="true"
			z="0"
		>
			<object size="0 0 100% 100%" type="image" sprite="devCommandsBackground" ghost="true" z="0"/>
			<object size="0 0 100% 100%" type="text" style="largeBoldCenteredText" textcolor="white" ghost="true" z="0">Game Paused</object>
			<action on="Press">togglePause();</action>
		</object>

		<!-- ================================  ================================ -->
		<!-- Notification Area -->
		<!-- ================================  ================================ -->
		<object name="notificationPanel" type="image" size="50%-300 100%-280 50%+300 100%-220" ghost="true">
			<object name="notificationText" size="0 0 100% 100%" type="text" style="notificationPanel" ghost="true"/>
		</object>

		<!-- ================================  ================================ -->
		<!-- Chat -->
		<!-- ================================  ================================ -->

		<!-- Chat panel -->
		<object name="chatPanel" size="0 80 100% 100%-240" type="image" ghost="true">
			<object name="chatText" size="3 1 100%-1 100%-1" type="text" style="chatPanel" ghost="true"/>
		</object>

		<!-- Chat window -->
		<object name="chatDialogPanel" size="50%-200 50%-46 50%+200 50%+46" type="image" hidden="true" sprite="genericPanel">
			<object name="chatInput" size="16 12 100%-16 36" type="input" style="chatInput" max_length="80">
				<action on="Press">submitChatInput();</action>
			</object>

			<object  size="32 100%-44 144 100%-12" type="button" style="wheatButton">
				Cancel
				<action on="Press">closeChat();</action>
			</object>
			<object size="100%-144 100%-44 100%-32 100%-12" type="button" style="wheatButton">
				Send
				<action on="Press">submitChatInput();</action>
			</object>

		</object>

		<!-- ================================  ================================ -->
		<!-- Session Dialog -->
		<!-- ================================  ================================ -->
		<object name="sessionDialog"
			sprite="sessionDialog"
			type="image"
			size="50%-180 50%-200 50%+180 50%+50"
			hidden="true"
			z="30"
		>
			<object name="sessionDialogTitleBar" size="50%-100 -16 50%+100 16" type="image" sprite="sessionDialogTitleBar">
				<object name="sessionDialogTitle" size="0 -2 100% 100%" type="text" style="dialogTitleText">Title</object>
			</object>
			
			<object name="sessionDialogMessage" size="20 10 100%-20 100%-48" type="text" style="dialogText"/>

			<object size="0 100%-48 100% 100%">
				<object name="sessionDialogConfirm" size="32 100%-64 144 100%-32" type="button" style="wheatButton">
					OK
				<action on="Press"></action>
				</object>

				<object name="sessionDialogCancel" size="100%-144 100%-64 100%-32 100%-32" type="button" style="wheatButton">
					Cancel
				<action on="Press">g_SessionDialog.close();</action>
				</object>
			</object>
		</object>
		
		<!-- ================================  ================================ -->
		<!-- Menu -->
		<!-- ================================  ================================ -->
		<object name="menuDialogPanel"
			size="50%-74 50%-180 50%+74 50%+20"
			type="image"
			hidden="true"
			z="30"
		>
			<!-- Settings button -->
			<object type="button"
				name="settingsButton"
				style="wheatButtonFancy"
				size="50%-56 0 50%+56 32"
				tooltip_style="sessionToolTip"
			>
				<object size="0 0 100% 100%" type="text" style="centeredText" name="settingsButtonText" ghost="true">Settings</object>
				<action on="Press">openSettingsDialog();</action>
			</object>

				<!-- Chat button -->
				<object type="button"
					name="chatButton"
					style="wheatButtonFancy"
					size="50%-56 32 50%+56 64"
					tooltip_style="sessionToolTip"
				>
					<object size="0 0 100% 100%" type="text" style="centeredText" name="chatButtonText" ghost="true">Chat</object>
					<action on="Press">openChat();</action>
				</object>

				<!-- Pause Button -->
				<object type="button"
					style="wheatButtonFancy"
					name="pauseButton"
					size="50%-56 64 50%+56 96"
					tooltip_style="sessionToolTip"
				>
					<object name="pauseButtonText" size="0 0 100% 100%" type="text" ghost="true" style="centeredText">Pause</object>
					<action on="Press">togglePause();</action>
				</object>

				<!-- Exit button -->
				<object type="button"
					name="menuExitButton"
					style="wheatButtonFancy"
					size="50%-56 96 50%+56 128"
					tooltip_style="sessionToolTip"
				>
					<object size="0 0 100% 100%" type="text" style="centeredText" name="exitButtonText" ghost="true" font="serif-14">Quit</object>
					<action on="Press">
						openExitGameDialog();
					</action>
				</object>
		</object>

		<!-- ================================  ================================ -->
		<!-- Settings Window -->
		<!-- ================================  ================================ -->
		<object name="settingsDialogPanel"
			sprite="genericPanel"
			type="image"
			size="50%-180 50%-200 50%+180 50%+50"
			hidden="true"
			z="30"
		>
			<!-- Settings / shadows -->
			<object size="0 10 100%-80 35" type="text" style="settingsText" ghost="true">Enable Shadows</object>
			<object name="shadowsCheckbox" size="100%-56 15 100%-30 40" type="checkbox" style="wheatCrossBox" checked="true">
				<action on="Load">if (renderer.shadows) this.checked = true; else this.checked = false;</action>
				<action on="Press">renderer.shadows = this.checked;</action>
			</object>	
				
			<!-- Settings / Water -->
			<object size="0 35 100%-80 60" type="text" style="settingsText" ghost="true">Enable Water Reflections</object>
			<object name="fancyWaterCheckbox" size="100%-56 40 100%-30 65"  type="checkbox" style="wheatCrossBox" checked="true">
				<action on="Load">if (renderer.fancyWater) this.checked = true; else this.checked = false;</action>
				<action on="Press">renderer.fancyWater = this.checked;</action>
			</object>
				
			<!-- Settings / Music-->
			<object size="0 60 100%-80 85" type="text" style="settingsText" ghost="true">Enable Music</object>
			<object size="100%-56 65 100%-30 90" type="checkbox" style="wheatCrossBox" checked="true">
				<action on="Press">if (this.checked) startMusic(); else stopMusic();</action>
			</object>
				
			<!-- Settings / Dev Overlay -->
			<object size="0 85 100%-80 110" type="text" style="settingsText" ghost="true">Developer Overlay</object>
				<object size="100%-56 90 100%-30 115" type="checkbox" style="wheatCrossBox" checked="false">
				<action on="Press">toggleDeveloperOverlay();</action>
			</object>
		</object>

	<!-- ================================  ================================ -->
	<!-- Top Panel  -->
	<!-- ================================  ================================ -->
	<object name="topPanel"
		type="image"
		sprite="topPanel"
		size="-3 0 100%+3 32"
	>
		<!-- ================================  ================================ -->
		<!-- Player resource bar -->
		<!-- ================================  ================================ -->
		<object
			size="0 0 500 100%"
		>	
			<!-- Food -->
			<object size="6 0 96 100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold">
				<object size="0 0 34 30" type="image" style="resourceIcon" cell_id="0"/>
				<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceFood"/>
			</object>

			<!-- Wood -->
			<object size="98 0 188 100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold">
				<object size="0 0 34 30" type="image" style="resourceIcon" cell_id="1"/>
				<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceWood"/>
			</object>

			<!-- Stone -->
			<object size="190 0 280 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold">
				<object size="0 2 34 30" type="image" style="resourceIcon" cell_id="2"/>
				<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceStone"/>
			</object>

			<!-- Metal -->
			<object size="282 0 372 100%"  type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold">
				<object size="0 0 34 30" type="image" style="resourceIcon" cell_id="3"/>
				<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/>
			</object>

			<!-- Population -->
			<object size="374 0 464 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold">
				<object size="-2 0 30 28" type="image" style="resourceIcon" cell_id="4"/>
				<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourcePop"/>
			</object>
		</object>

		<!-- ================================  ================================ -->
		<!-- Civ Icon -->
		<!-- ================================  ================================ -->
		<object size="50%-48 -26 50%+48 70" name="civIcon" type="image"/>

		<!-- ================================  ================================ -->
		<!-- Phase -->
		<!-- ================================  ================================ -->
		<!--<object size="50%+50 4 50%+300 100%-2" name="PhaseTitleBar" type="text" font="serif-bold-stroke-14" textcolor="white"> Death Match :: Village Phase</object>-->
		

		<!-- ================================  ================================ -->
		<!-- Menu Button -->
		<!-- ================================  ================================ -->
		<object type="button"
			name="menuButton"
			size="100%-80 0 100%-4 100%"
			tooltip_style="sessionToolTip"
		>
			<object size="0 0 100% 100%" type="image" sprite="menuButton" name="menuButtonText" ghost="true">MENU</object>
			<action on="Press">openMenuDialog();</action>
		</object> <!-- END OF MENU -->
		
	</object> <!-- END OF TOP PANEL -->

	<!-- ================================  ================================ -->
	<!-- Unit Selection Groups -->
	<!-- ================================  ================================ -->
	<object
		name="unitGroupPanel"
		size="0% 50%-216 0%+36 50%+144"
	>
		<repeat count="10">
			<object name="unitGroupButton[n]" size="0 0 36 36" type="button" hidden="false" style="iconButton" tooltip_style="sessionToolTipBottomBold"
				tooltip="Click to select grouped units.">
				<object name="unitGroupIcon[n]" size="3 3 33 33" type="image" sprite="groupsIcon" ghost="true"/>
				<object name="unitGroupLabel[n]" type="text" style="largeCenteredOutlinedText" ghost="true"/>
			</object>
		</repeat>
	</object>

	<!-- ================================  ================================ -->
	<!-- START of BOTTOM PANEL -->
	<!-- ================================  ================================ -->

	<object size="50%-512 100%-180 50%+512 100%">

		<!-- ================================  ================================ -->
		<!-- Minimap -->
		<!-- ================================  ================================ -->
		<object
			name="minimapPanel"
			size="0 100%-212 212 100%"
			type="image"
			sprite="mapPanel"
			z="20"
		>	
			<object name="minimap"
				type="minimap"
				size="14 14 100%-14 100%-14"
			>
				<action on="WorldClick">handleMinimapEvent(arguments[0]);</action>
			</object>

			<object name="minimapOverlay" size="10 10 100%-10 100%-10" type="image" sprite="stretched:session/minimap_circle.png" ghost="true"/>

			<!-- Idle Worker Button -->
			<object type="image"
				size="100%-36 4 100%-4 36"
			>
				<object type="button"
					style="iconButton"
					tooltip_style="sessionToolTip"
					tooltip="Find idle worker"
					hotkey="selection.idle"
				>
					<!-- TODO: should highlight the button if there's non-zero idle workers -->
					<object size="0 0 100% 100%" type="image" sprite="idleWorker" ghost="true" />
					<action on="Press">findIdleWorker();</action>
				</object>
			</object>
		</object>

		<!-- ================================  ================================ -->
		<!-- Supplemental Details Panel on Left -->
		<!-- ================================  ================================ -->
		<object size="208 100%-170 50%-110 100%" name="supplementalSelectionDetails" type="image" sprite="bottomLeft" z="30">

			<object name="unitFormationPanel"
				size="24 12 100% 100%"
			>
				<object size="0 0 100% 100%">
					<repeat count="16">
						<object name="unitFormationButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
							<object name="unitFormationIcon[n]" type="image" style="formationIcon" ghost="true" size="3 3 33 33"/>
						</object>
					</repeat>
				</object>
			</object>
		
			<object name="unitGarrisonPanel"
				size="24 12 100% 100%"
			>
				<object size="0 0 100% 100%">
					<repeat count="16">
						<object name="unitGarrisonButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
							<object name="unitGarrisonIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
							<object name="unitGarrisonCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
						</object>
					</repeat>
				</object>
			</object>

			<!-- Stance Selection -->
			<object name="unitStancePanel"
				sprite="bottomMiddle"
				size="0 100%-43 100% 100%"
				type="text"
			>
				<object size="5 3 100% 100%">
					<repeat count="5">
						<object name="unitStanceButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
							<object name="unitStanceIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
						</object>
					</repeat>
				</object>
			</object>
		</object>

		<!-- ================================  ================================ -->
		<!-- Details Panel -->
		<!-- ================================  ================================ -->
		<object name="selectionDetails"
			type="image"
			sprite="bottomMiddle"
			size="50%-114 100%-205 50%+114 100%"
			hidden="false"
		>
			<!-- Unit details for Single Unit -->
			<object size="50%-112 0 50%+112 100%" name="detailsAreaSingle">
	
				<!-- Player Name -->
				<object size="0 0 100% 40" name="player" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
	
				<!-- Stats -->
				<object size="8 36 50%-48 100%" name="statsArea" type="image">
					<!-- Attack icon -->
					<object hidden="true" size="0 0 48 48" type="image" name="attackIcon" sprite="snIconSheetStance" cell_id="1" tooltip_style="sessionToolTip"/>

					<!-- Armour icon "0 48 48 96"-->
					<object size="0 0 48 48" type="image" name="armourIcon" sprite="snIconSheetStance" cell_id="3" tooltip_style="sessionToolTip"/>

					<!-- Resource carrying icon/counter -->
					<object size="0 40 48 88" type="image" name="resourceCarryingIcon" style="resourceIcon"/>
					<object size="0 80 48 100" type="text" name="resourceCarryingText" style="statsText"/>

				</object>

				<!-- Big unit icon -->
				<object size= "50%-48 40 50%+48 136" type="image" name="iconBorder" tooltip_style="sessionToolTip">
					<object size="2 2 100%-2 100%-2" type="image" name="icon" ghost="true"/>
					<object size="100%-20 4 100%-4 20" name="rankIcon" type="image" sprite="" ghost="true"/>
					<object type="image" sprite="glassSquareIcon" ghost="true"/>
				</object>
						
				<!-- Stats Bars -->
				<object size= "50%+48 40 100% 136" type="image" tooltip_style="sessionToolTip">
					<!-- Health bar -->
					<object size="18 0 30 100%" type="image" name="health" tooltip="Health" tooltip_style="sessionToolTip">
						<object type="image" sprite="healthBackground" ghost="true"/>
						<object type="image" sprite="healthForeground" ghost="true" name="healthBar"/>
						<object type="image" sprite="statsBarShader" ghost="true"/>
					</object>
					
					<!-- Stamina bar -->
					<object size="32 0 44 100%" type="image" name="stamina" tooltip="Stamina" tooltip_style="sessionToolTip">
						<object type="image" sprite="staminaBackground" ghost="true"/>
						<object type="image" sprite="staminaForeground" ghost="true" name="staminaBar"/>
						<object type="image" sprite="statsBarShader" ghost="true"/>
					</object>
					
					<!-- Resource bar -->
					<object size="18 0 30 100%" type="image" name="resources" tooltip="Resources" tooltip_style="sessionToolTip">
						<object type="image" sprite="resourceBackground" ghost="true"/>
						<object type="image" sprite="resourceForeground" ghost="true" name="resourceBar"/>
						<object type="image" sprite="statsBarShader" ghost="true"/>
					</object>
					
					<!-- Experience bar -->
					<object size="46 0 58 100%" type="image" name="experience" tooltip="Experience" tooltip_style="sessionToolTip">
						<object type="image" sprite="experienceBackground" ghost="true"/>
						<object type="image" sprite="experienceForeground" ghost="true" name="experienceBar"/>
						<object type="image" sprite="statsBarShader" ghost="true"/>
					</object>
				</object>
				
				<!-- Specific Name -->
				<object size="0 142 100% 162" name="specific" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTipBold"/>
			</object>

			<!-- Unit details for Multiple Units -->
			<object size="50%-112 0 50%+112 100%" name="detailsAreaMultiple">
					
				<object name="unitSelectionPanel"
					size="20 12 100%-20 100%"
				>
					<object size="0 0 100% 100%">
						<repeat count="16">
							<object name="unitSelectionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBold" z="100">
								<object name="unitSelectionIcon[n]" type="image" ghost="true" size="3 3 33 33"/>
								<object name="unitSelectionCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
								<object size="0 100%-3 100% 100%" name="unitSelectionHealth[n]" ghost="true">
								</object>
							</object>
						</repeat>
					</object>
				</object>	

				<!-- Total -->
				<object size="100%-42 12 100%-8 46" type="image" sprite="groupsIcon">
					<object size="0 0 100% 100%" type="text" style="largeCenteredOutlinedText" name="numberOfUnits"/>
				</object>	

				<!-- Stats Bars -->
				<object size= "100%-38 52 100%-18 100%-40" type="image" tooltip_style="sessionToolTip">
					<!-- Health bar -->
					<object size="0 0 12 100%" type="image" name="healthMultiple" tooltip="Hitpoints" tooltip_style="sessionToolTip">
						<object type="image" sprite="healthBackground" ghost="true"/>
						<object type="image" sprite="healthForeground" ghost="true" name="healthBarMultiple"/>
						<object type="image" sprite="statsBarShader" ghost="true"/>
					</object>
					
					<!-- Stamina bar -->
					<object size="14 0 26 100%" type="image" name="staminaMultiple" tooltip="Stamina" tooltip_style="sessionToolTipBold">
						<object type="image" sprite="staminaBackground" ghost="true"/>
						<object type="image" sprite="staminaForeground" ghost="true" name="staminaBarMultiple"/>
						<object type="image" sprite="statsBarShader" ghost="true"/>
					</object>
				</object>

			</object>

			<!-- Unit Commands -->
			<object name="unitCommandPanel"
				size="0 100%-36 100% 100%-4"
				type="image"
				z="30"
			>
				<object size="0 0 100% 100%">
					<repeat count="6">
						<object name="unitCommandButton[n]" hidden="true" style="iconButton" type="button" size="0 0 32 32" tooltip_style="sessionToolTipBottomBold">
							<object name="unitCommandIcon[n]" ghost="true" type="image" size="0 0 100% 100%" style="commandIcon"/>
							<object name="unitCommandCount[n]" ghost="true" style="groupIconsText" type="text" size="0 0 100% 100%"/>
						</object>
					</repeat>
				</object>
			</object>

		</object> <!-- END OF SELECTION DETAILS -->

		<!-- ================================  ================================ -->
		<!--Commands Panel -->
		<!-- ================================  ================================ -->
		<object name="unitCommands"
			type="image"
			sprite="bottomRight"
			size="622 100%-170 100% 100%"
			hidden="false"
		>
			<object name="unitConstructionPanel"
				size="14 12 100% 100%"
			>
				<!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
					 cell_id="0" tooltip="Construction"/>-->

				<object size="0 0 100% 100%">
					<repeat count="24">
						<object name="unitConstructionButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
							<object name="unitConstructionIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
						</object>
					</repeat>
				</object>
			</object>

			<object name="unitResearchPanel"
				style="goldPanelFrilly"
				size="0 100%-56 100% 100%"
				type="text"
			>
				<object size="-5 -2 59 62" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom"
					 cell_id="1" tooltip="Research"/>

				[research commands]
			</object>

			<object name="unitTrainingPanel"
				size="14 12 100% 100%"
			>
				<!--<object size="-2 -2 54 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTip"
					 cell_id="2" tooltip="Training"/>-->

				<object size="0 0 100% 100%">
					<repeat count="24">
						<object name="unitTrainingButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
							<object name="unitTrainingIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
						</object>
					</repeat>
				</object>
			</object>

			<object name="unitQueuePanel"
				size="4 -56 100% 0"
				type="image"
				sprite="genericPanel"
			>
				<object size="-4 -2 52 54" type="image" sprite="snIconSheetTab" tooltip_style="sessionToolTipBottom" cell_id="3" tooltip="Production queue">
						<object name="queueProgress" ghost="true" style="iconButtonProgress" type="text"/>
				</object>

				<object size="48 6 100% 100%">
					<repeat count="16">
						<object name="unitQueueButton[n]" hidden="true" style="iconButton" type="button" size="0 0 40 40" tooltip_style="sessionToolTipBottom">
							<object name="unitQueueIcon[n]" ghost="true" type="image" size="3 3 37 37"/>
							<object name="unitQueueProgressSlider[n]" type="image" sprite="queueProgressSlider" ghost="true" size="1 1 100%-1 100%-1" z="20"/>
							<object name="unitQueueCount[n]" ghost="true" style="groupIconsText" type="text" z="20"/>
						</object>
					</repeat>
				</object>
			</object>

		</object> <!-- END OF UNIT COMMANDS -->

	</object><!-- END OF BOTTOM PANEL -->
		
	</object> <!-- END OF SN OBJECT -->
	
	<!-- ================================  ================================ -->
	<!-- Selection bandbox -->
	<!-- ================================  ================================ -->
	<object name="bandbox" type="image" sprite="bandbox" ghost="true" hidden="true" z="200"/>

	<!-- ================================  ================================ -->
	<!-- Network status -->
	<!-- ================================  ================================ -->
	<object name="netStatus" type="text" style="netStatus" z="100" hidden="true">
			<object type="button"
				name="disconnectedExitButton"
				style="wheatButtonFancy"
				size="50%-84 50%+128 50%+84 50%+160"
				tooltip_style="sessionToolTip"
				hidden="true"
			>
				<object size="0 0 100% 100%" type="text" style="centeredText" name="disconnectedExitButtonText" ghost="true" font="serif-14">Return to Main Menu</object>
				<action on="Press">leaveGame()</action>
			</object>
	
	</object>

</objects>
