<?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/music.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/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>

		<!-- ================================  ================================ -->
		<!-- 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">closeOpenDialogs();</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">openMenu();</action>
		</object>

		<!-- Pause -->
		<object hotkey="pause">
			<action on="Press">togglePause();</action>
		</object>

		<!-- Quicksave/load -->
		<object hotkey="quicksave">
			<action on="Press">Engine.QuickSave();</action>
		</object>
		<object hotkey="quickload">
			<action on="Press">Engine.QuickLoad();</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>

		<!-- Find idle warrior - TODO: Potentially move this to own UI button? -->
		<object hotkey="selection.idlewarrior">
			<action on="Press">findIdleUnit(["Hero", "Champion", "CitizenSoldier", "Siege", "Warship"]);</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 50%-88 100%-8 50%+88" 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="StoneCrossBox">
				<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="StoneCrossBox"/>

			<object size="0 32 100%-18 48" type="text" style="devCommandsText">Pathfinder overlay</object>
			<object size="100%-16 32 100% 48" type="checkbox" style="StoneCrossBox">
				<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="StoneCrossBox">
				<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="StoneCrossBox">
				<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="StoneCrossBox">
				<action on="Press">Engine.GuiInterfaceCall("SetRangeDebugOverlay", this.checked);</action>
			</object>

			<object size="0 96 100%-18 112" type="text" style="devCommandsText">Bounding box overlay</object>
			<object size="100%-16 96 100% 112" type="checkbox" style="StoneCrossBox">
				<action on="Press">Engine.SetBoundingBoxDebugOverlay(this.checked);</action>
			</object>

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

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

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

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

		<!-- ================================  ================================ -->
		<!-- Time elapsed counter -->
		<!-- ================================  ================================ -->
		<object size="100%-100 50 100%-10 70" type="text" name="timeElapsedCounter" style="settingsText" hotkey="timeelapsedcounter.toggle" hidden="true">
			<action on="Press"><![CDATA[
				this.hidden = !this.hidden;
			]]></action>
		</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="50%-128 50%-20 50%+128 50%+20" type="text" style="PauseText" ghost="true" z="0">Game Paused</object>
			<object size="50%-128 50%+20 50%+128 50%+30" type="text" style="PauseMessageText" ghost="true" z="0">Click to Resume Game</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%-180 50%-58 50%+180 50%+46" type="image" hidden="true" sprite="genericPanel">
			<object name="chatInput" size="16 12 100%-16 36" type="input" style="StoneInput" max_length="80">
				<action on="Press">submitChatInput();</action>
			</object>

			<object size="50%-144 100%-50 50%-16 100%-22" type="button" style="StoneButton">
				Send
				<action on="Press">submitChatInput();</action>
			</object>

			<object  size="50%+16 100%-50 50%+144 100%-22" type="button" style="StoneButton">
				Cancel
				<action on="Press">closeChat();</action>
			</object>
		</object>

		<!-- ================================  ================================ -->
		<!-- Settings Window -->
		<!-- ================================  ================================ -->
		<object name="settingsDialogPanel"
			style="StoneDialog"
			type="image"
			size="50%-180 50%-200 50%+180 50%+50"
			hidden="true"
		>
			<object type="text" style="TitleText" size="50%-96 -16 50%+96 16">Settings</object>

			<object style="TranslucentPanelThinBorder"
				type="image"
				size="32 32 100%-32 100%-64"
			>
				<!-- Settings / shadows -->
				<object size="0 10 100%-80 35" type="text" style="RightLabelText" ghost="true">Enable Shadows</object>
				<object name="shadowsCheckbox" size="100%-56 15 100%-30 40" type="checkbox" style="StoneCrossBox" 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 / Shadow PCF -->
				<object size="0 35 100%-80 60" type="text" style="RightLabelText" ghost="true">Enable Shadow Filtering</object>
				<object name="shadowPCFCheckbox" size="100%-56 40 100%-30 65" type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.shadowPCF) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.shadowPCF = this.checked;</action>
				</object>

				<!-- Settings / Water -->
				<object size="0 60 100%-80 85" type="text" style="RightLabelText" ghost="true">Enable Water Reflections</object>
				<object name="fancyWaterCheckbox" size="100%-56 65 100%-30 90"  type="checkbox" style="StoneCrossBox" 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 85 100%-80 110" type="text" style="RightLabelText" ghost="true">Enable Music</object>
				<object size="100%-56 90 100%-30 115" type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Press">if (this.checked) global.music.start(); else global.music.stop();</action>
				</object>

				<!-- Settings / Dev Overlay -->
				<object size="0 110 100%-80 135" type="text" style="RightLabelText" ghost="true">Developer Overlay</object>
					<object size="100%-56 115 100%-30 140" type="checkbox" style="StoneCrossBox" checked="false">
					<action on="Press">toggleDeveloperOverlay();</action>
				</object>
			</object>

			<!-- Close button -->
			<object type="button"
				style="StoneButton"
				size="50%-64 100%-52 50%+64 100%-24"
				tooltip_style="sessionToolTip"
			>
				Close
				<action on="Press">closeSettings(true);</action>
			</object>
		</object>

		<!-- ================================  ================================ -->
		<!-- Top Panel  -->
		<!-- ================================  ================================ -->
		<object name="topPanel"
			type="image"
			sprite="topPanel"
			size="-3 0 100%+3 36"
		>
			<!-- ================================  ================================ -->
			<!-- Player resource bar -->
			<!-- ================================  ================================ -->
			<object
				size="10 0 45% 100%"
			>
				<!-- Food -->
				<object size="0 0 90 100%" type="image" style="resourceCounter" tooltip="Food" tooltip_style="sessionToolTipBold">
					<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="0"/>
					<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceFood"/>
				</object>

				<!-- Wood -->
				<object size="90 0 180 100%" type="image" style="resourceCounter" tooltip="Wood" tooltip_style="sessionToolTipBold">
					<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="1"/>
					<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceWood"/>
				</object>

				<!-- Stone -->
				<object size="180 0 270 100%" type="image" style="resourceCounter" tooltip="Stone" tooltip_style="sessionToolTipBold">
					<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="2"/>
					<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceStone"/>
				</object>

				<!-- Metal -->
				<object size="270 0 360 100%"  type="image" style="resourceCounter" tooltip="Metal" tooltip_style="sessionToolTipBold">
					<object size="0 -4 40 36" type="image" style="resourceIcon" cell_id="3"/>
					<object size="32 0 100% 100%-2" type="text" style="resourceText" name="resourceMetal"/>
				</object>

				<!-- Population -->
				<object size="360 0 450 100%" type="image" style="resourceCounter" tooltip="Population (current / limit)" tooltip_style="sessionToolTipBold">
					<object size="0 -4 40 34" 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>-->


			<!-- ================================  ================================ -->
			<!-- ALPHA LABELS (alpha, build time, revision) -->
			<!-- ================================  ================================ -->

			<!-- Displays Alpha name and number -->
			<object size="70%-128 0 70%+128 100%" name="alphaLabel" type="text" style="CenteredLabelText" text_valign="top" ghost="true">
				ALPHA IX : Ides of March

				<!-- Displays build date and revision number-->
				<object size="50%-128 0 50%+128 100%-2" name="buildTimeLabel" type="text" text_align="center" text_valign="bottom" font="serif-12" textcolor="white" ghost="true">
					<action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]></action>
				</object>
			</object>

			<!-- ================================  ================================ -->
			<!-- Menu Button -->
			<!-- ================================  ================================ -->
			<object type="button"
				name="menuButton"
				size="100%-164 4 100%-8 32"
				style="StoneButtonFancy"
				tooltip_style="sessionToolTip"
				z="50"
			>
				<!-- This object covers up the text on the menu
				buttons as they slide by so that you don't see
				them on top of the main menu button -->
				<object size="0 -4 100% 0" type="image" sprite="horizontalThinBorder" ghost="true"/>

				<object size="50%-32 50%-16 50%+32 50%+16" type="image" sprite="menuButton" ghost="true">MENU</object>
				<action on="Press">
					toggleMenu();
				</action>
			</object> <!-- END OF MENU BUTTON -->
		</object> <!-- END OF TOP PANEL -->

		<!-- ================================  ================================ -->
		<!-- Menu -->
		<!-- ================================  ================================ -->
		<object name="menu"
			style="StonePanelThinBorder"
			type="image"
			hidden="false"
		>
			<object size="4 36 100%-4 50%+20">

				<!-- Settings button -->
				<object type="button"
					name="settingsButton"
					style="StoneButtonFancy"
					size="0 0 100% 28"
					tooltip_style="sessionToolTip"
				>
					Settings
					<action on="Press">settingsMenuButton();</action>
				</object>


				<!-- Save game button -->
				<object type="button"
					name="saveGameButton"
					style="StoneButtonFancy"
					size="0 32 100% 60"
					tooltip_style="sessionToolTip"
				>
					Save
					<action on="Press">
						Engine.SaveGame();
						closeMenu();
					</action>
				</object>

				<!-- Chat button -->
				<object type="button"
					name="chatButton"
					style="StoneButtonFancy"
					size="0 64 100% 92"
					tooltip_style="sessionToolTip"
				>
					Chat
					<action on="Press">chatMenuButton();</action>
				</object>

				<!-- Exit button -->
				<object type="button"
					name="menuExitButton"
					style="StoneButtonFancy"
					size="0 96 100% 124"
					tooltip_style="sessionToolTip"
				>
					Exit
					<action on="Press">exitMenuButton();</action>
				</object>

				<!-- Pause / Resume Button -->
				<object type="button"
					name="pauseButton"
					style="StoneButtonFancy"
					size="0 128 100% 154"
					tooltip_style="sessionToolTip"
				>
					<object name="pauseButtonText" type="text" style="CenteredButtonText" ghost="true">Pause</object>
					<action on="Press">togglePause();</action>
				</object>
			</object>
		</object>

		<!-- ================================  ================================ -->
		<!-- 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>

		<!-- ================================  ================================ -->
		<!-- Information tooltip -->
		<!-- ================================  ================================ -->
		<object name="informationTooltip" type="tooltip" independent="true" style="informationTooltip"/>

		<!-- ================================  ================================ -->
		<!-- 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.idleworker"
					>
						<!-- 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">findIdleUnit(["Female", "Trade", "FishingBoat", "CitizenSoldier", "Healer"]);</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>

				<object name="unitBarterPanel" hidden="true"
					size="5 5 100% 100%"
				>
					<object ghost="true" style="resourceText" type="text" size="0 0 100% 18">Exchange resources:</object>
					<object size="0 18 100% 64">
						<repeat count="4">
							<object name="unitBarterSellButton[n]" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottomBold">
								<object name="unitBarterSellIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
								<object name="unitBarterSellAmount[n]" ghost="true" style="resourceText" type="text" size="0 0 100% 50%"/>
							</object>
						</repeat>
					</object>
					<object size="0 64 100% 110">
						<repeat count="4">
							<object name="unitBarterBuyButton[n]" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottomBold">
								<object name="unitBarterBuyIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
								<object name="unitBarterBuyAmount[n]" ghost="true" style="resourceText" type="text" size="0 0 100% 50%"/>
							</object>
						</repeat>
					</object>
					<object name="PerformDealButton" type="button" style="StoneButton" size="2 112 100%-7 142">
						<object ghost="true" style="statsText" type="text" size="0 0 100% 100%">Barter</object>
					</object>
				</object>

				<!-- Stance Selection -->
				<object name="unitStancePanel"
					style="TranslucentPanel"
					size="4 100%-43 100%-4 100%-4"
					type="text"
				>
					<object size="1 2 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="TranslucentPanelThinBorder"
					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="unitTradingPanel"
					size="14 12 100% 100%"
				>
					<object size="0 0 100% 100%">
						<repeat count="4">
							<object name="unitTradingButton[n]" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
								<object name="unitTradingIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
							</object>
						</repeat>
					</object>
				</object>

				<object name="unitQueuePanel"
					size="4 -56 100% 0"
					type="image"
					style="TranslucentPanelThinBorder"
				>
					<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="StoneButton"
				size="50%-84 50%+128 50%+84 50%+160"
				tooltip_style="sessionToolTip"
				hidden="true"
			>
				<object size="0 0 100% 100%" type="text" style="CenteredButtonText" name="disconnectedExitButtonText" ghost="true">Return to Main Menu</object>
				<action on="Press">leaveGame()</action>
			</object>

	</object>

</objects>
