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

	<!-- Team Chat: Does the same as the above, but sets the window up to only send messages to teammates. -->
	<object hotkey="teamchat">
	    <action on="Press">toggleChatWindow(true);</action>
	</object>

	<!-- Menu -->
	<object hotkey="menu.toggle">
	    <action on="Press">openMenu();</action>
	</object>
		
	<!-- Unit silhouettes -->
	<object hotkey="silhouettes">
	    <action on="Press">renderer.silhouettes = !renderer.silhouettes;</action>
	</object>

	<!-- Sky -->
	<object hotkey="showsky">
	    <action on="Press">renderer.showsky = !renderer.showsky;</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>
	
	<!-- queue first unit in the training queue  -->
	<object hotkey="session.queueunit.1">
	    <action on="Press">addTrainingByPosition(0);</action>
	</object>

	<!-- queue 2nd unit in the training queue  -->
	<object hotkey="session.queueunit.2">
	    <action on="Press">addTrainingByPosition(1);</action>
	</object>

	<!-- queue 3rd unit in the training queue  -->
	<object hotkey="session.queueunit.3">
	    <action on="Press">addTrainingByPosition(2);</action>
	</object>

	<!-- queue 4th unit in the training queue  -->
	<object hotkey="session.queueunit.4">
	    <action on="Press">addTrainingByPosition(3);</action>
	</object>
	
	<!-- queue 5th unit in the training queue  -->
	<object hotkey="session.queueunit.5">
	    <action on="Press">addTrainingByPosition(4);</action>
	</object>

	<!-- queue 6th unit in the training queue  -->
	<object hotkey="session.queueunit.6">
	    <action on="Press">addTrainingByPosition(5);</action>
	</object>

	<!-- queue 7th unit in the training queue  -->
	<object hotkey="session.queueunit.7">
	    <action on="Press">addTrainingByPosition(6);</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" z="40"
		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">
        if (this.checked)
          messageBox(500, 250, "Note: time warp mode is a developer option, and not intended\nfor use over long periods of time. Using it incorrectly may\ncause the game to run out of memory or crash.", "Time warp mode", 2);
        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 60 50%+300 120" 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 130 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%-48 50%+180 50%+36" 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="16 100%-40 30%+16 100%-12" type="button" style="StoneButton">
		Send
		<action on="Press">submitChatInput();</action>
	    </object>

	    <object size="30%+24 100%-40 60%+24 100%-12" type="button" style="StoneButton">
		Cancel
		<action on="Press">closeChat();</action>
	    </object>
	    <object name="toggleTeamChat" size="60%+32 100%-34 60%+48 100%-6" type="checkbox" style="StoneCrossBox"/>
	    <object size="60%+48 100%-40 100% 100%-12" type="text"  style="LeftLabelText">
		Team Only
	    </object>
	</object>

	<!-- ================================  ================================ -->
	<!-- Diplomacy Window -->
	<!-- ================================  ================================ -->
	<object name="diplomacyDialogPanel"
		size="50%-300 50%-200 50%+300 50%+150"
		type="image"
		hidden="true"
		sprite="StoneDialog"
	>
		<object type="text" style="TitleText" size="50%-96 -16 50%+96 16">Diplomacy</object>

		<object name="diplomacyHeader" size="32 32 100%-32 64">
			<object name="diplomacyHeaderName" size="0 0 150 100%" type="text" style="chatPanel" ghost="true" caption="Name"/>
			<object name="diplomacyHeaderCiv" size="150 0 250 100%" type="text" style="chatPanel" ghost="true" caption="Civilization"/>
			<object name="diplomacyHeaderTeam" size="250 0 300 100%" type="text" style="chatPanel" ghost="true" caption="Team"/>
			<object name="diplomacyHeaderTheirs" size="300 0 360 100%" type="text" style="chatPanel" ghost="true" caption="Theirs"/>
			<object name="diplomacyHeaderAlly" size="100%-180 0 100%-160 100%" type="text" style="chatPanel" caption="A" tooltip="Ally" tooltip_style="sessionToolTipBold"/>
			<object name="diplomacyHeaderNeutral" size="100%-160 0 100%-140 100%" type="text" style="chatPanel" caption="N" tooltip="Neutral" tooltip_style="sessionToolTipBold"/>
			<object name="diplomacyHeaderEnemy" size="100%-140 0 100%-120 100%" type="text" style="chatPanel" caption="E" tooltip="Enemy" tooltip_style="sessionToolTipBold"/>
			<object name="diplomacyHeaderTribute" size="100%-110 0 100% 100%" type="text" style="chatPanel" caption="Tribute"/>
		</object>

		<object size="32 64 100%-32 384">
			<repeat count="16">
				<object name="diplomacyPlayer[n]" size="0 0 100% 20" type="image" hidden="false">
					<object name="diplomacyPlayerName[n]" size="0 0 150 100%" type="text" style="chatPanel" ghost="true"/>
					<object name="diplomacyPlayerCiv[n]" size="150 0 250 100%" type="text" style="chatPanel" ghost="true"/>
					<object name="diplomacyPlayerTeam[n]" size="250 0 300 100%" type="text" style="chatPanel" ghost="true"/>
					<object name="diplomacyPlayerTheirs[n]" size="300 0 360 100%" type="text" style="chatPanel" ghost="true"/>

					<!-- Diplomatic stance - selection -->
					<object name="diplomacyPlayerAlly[n]" size="100%-180 0 100%-160 100%" type="button" style="StoneButton" hidden="true"/>
					<object name="diplomacyPlayerNeutral[n]" size="100%-160 0 100%-140 100%" type="button" style="StoneButton" hidden="true"/>
					<object name="diplomacyPlayerEnemy[n]" size="100%-140 0 100%-120 100%" type="button" style="StoneButton" hidden="true"/>

					<!-- Tribute -->
					<object name="diplomacyPlayerTributeFood[n]" size="100%-110 0 100%-90 100%" type="button" style="iconButton" tooltip="Food" hidden="true">
						<object name="diplomacyPlayerTributeFoodImage[n]" type="image" size="0 0 100% 100%" sprite="stretched:session/icons/resources/food.png" ghost="true"/>
					</object>
					<object name="diplomacyPlayerTributeWood[n]" size="100%-90 0 100%-70 100%" type="button" style="iconButton" tooltip="Wood" hidden="true">
						<object name="diplomacyPlayerTributeWoodImage[n]" type="image" size="0 0 100% 100%" sprite="stretched:session/icons/resources/wood.png" ghost="true"/>
					</object>
					<object name="diplomacyPlayerTributeStone[n]" size="100%-70 0 100%-50 100%" type="button" style="iconButton" tooltip="Stone" hidden="true">
						<object name="diplomacyPlayerTributeStoneImage[n]" type="image" size="0 0 100% 100%" sprite="stretched:session/icons/resources/stone.png" ghost="true"/>
					</object>
					<object name="diplomacyPlayerTributeMetal[n]" size="100%-50 0 100%-30 100%" type="button" style="iconButton" tooltip="Metal" hidden="true">
						<object name="diplomacyPlayerTributeMetalImage[n]" type="image" size="0 0 100% 100%" sprite="stretched:session/icons/resources/metal.png" ghost="true"/>
					</object>
				</object>
			</repeat>
		</object>

		<object size="50%-64 100%-50 50%+64 100%-22" type="button" style="StoneButton">
		    Close
		    <action on="Press">closeDiplomacy();</action>
		</object>
	</object>

	<!-- ================================  ================================ -->
	<!-- Settings Window -->
	<!-- ================================  ================================ -->
		<object name="settingsDialogPanel"
			style="StoneDialog"
			type="image"
			size="50%-180 50%-225 50%+180 50%+225"
			hidden="true"
			z="200"
			>
			<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%-70"
				>
				<!-- 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 Normals -->
				<object size="0 60 100%-80 85" type="text" style="RightLabelText" ghost="true">Water - HQ Waviness</object>
				<object name="waterNormalCheckox" size="100%-56 65 100%-30 90"  type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.waternormal) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.waternormal = this.checked;</action>
				</object>
				
				<!-- Settings / Real Depth -->
				<object size="0 85 100%-80 110" type="text" style="RightLabelText" ghost="true">Water - Use Actual Depth</object>
				<object name="waterRealDepthCheckbox" size="100%-56 90 100%-30 115"  type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.waterrealdepth) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.waterrealdepth = this.checked; </action>
				</object>

				<!-- Settings / Reflection -->
				<object size="0 110 100%-80 135" type="text" style="RightLabelText" ghost="true">Water - Enable Reflections</object>
				<object name="waterReflectionCheckbox" size="100%-56 115 100%-30 140"  type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.waterreflection) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.waterreflection = this.checked; </action>
				</object>
				
				<!-- Settings / Refraction -->
				<object size="0 135 100%-80 160" type="text" style="RightLabelText" ghost="true">Water - Enable Refraction</object>
				<object name="waterRefractionCheckbox" size="100%-56 140 100%-30 165"  type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.waterrefraction) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.waterrefraction = this.checked; </action>
				</object>
				
				<!-- Settings / Foam -->
				<object size="0 160 100%-80 185" type="text" style="RightLabelText" ghost="true">Water - Enable Shore Foam</object>
				<object name="waterFoamCheckbox" size="100%-56 165 100%-30 190"  type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.waterfoam) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.waterfoam = this.checked; </action>
				</object>
				
				<!-- Settings / Waves -->
				<object size="0 185 100%-80 210" type="text" style="RightLabelText" ghost="true">Water - Enable Shore Waves</object>
				<object name="waterCoastalWavesCheckbox" size="100%-56 190 100%-30 215"  type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.watercoastalwaves) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.watercoastalwaves = this.checked; </action>
				</object>
				
				<!-- Settings / Shadows -->
				<object size="0 210 100%-80 235" type="text" style="RightLabelText" ghost="true">Water - Use Surface Shadows</object>
				<object name="waterShadowsCheckbox" size="100%-56 215 100%-30 240"  type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.watershadow) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.watershadow = this.checked; </action>
				</object>

				<!-- Settings / Particles -->
				<object size="0 235 100%-80 260" type="text" style="RightLabelText" ghost="true">Enable Particles</object>
				<object name="particlesCheckbox" size="100%-56 240 100%-30 265" type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.particles) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.particles = this.checked;</action>
				</object>
				
				<!-- Settings / Unit Silhouettes -->
				<object size="0 260 100%-80 285" type="text" style="RightLabelText" ghost="true">Enable Unit Silhouettes</object>
				<object name="silhouettesCheckbox" size="100%-56 265 100%-30 290" type="checkbox" style="StoneCrossBox" checked="true">
					<action on="Load">if (renderer.silhouettes) this.checked = true; else this.checked = false;</action>
					<action on="Press">renderer.silhouettes = this.checked;</action>
				</object>
				
				<!-- Settings / Music-->
				<object size="0 285 100%-80 310" type="text" style="RightLabelText" ghost="true">Enable Music</object>
				<object size="100%-56 290 100%-30 315" 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 310 100%-80 335" type="text" style="RightLabelText" ghost="true">Developer Overlay</object>
				<object size="100%-56 315 100%-30 340" 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" sprite="stretched:session/icons/resources/food.png" ghost="true"/>
		    <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" sprite="stretched:session/icons/resources/wood.png" ghost="true"/>
		    <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" sprite="stretched:session/icons/resources/stone.png" ghost="true"/>
		    <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" sprite="stretched:session/icons/resources/metal.png" ghost="true"/>
		    <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" sprite="stretched:session/icons/resources/population.png" ghost="true"/>
		    <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" tooltip_style="sessionToolTipBold"/>

	    <!-- ================================  ================================ -->
	    <!-- 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 XII : Loucetios<!-- IMPORTANT: remember to update pregame/mainmenu.xml in sync with this -->

		<!-- Displays build date and revision number-->
		<object size="50%-128 0 50%+128 100%-2" name="buildTimeLabel" type="text" style="BuildNameText" ghost="true">
		    <action on="Load"><![CDATA[this.caption = buildTime(0) + " (" + buildTime(2) + ")";]]>
		    </action>
		</object>
	    </object>

	    <!-- ================================  ================================ -->
	    <!-- Diplomacy Button -->
	    <!-- ================================  ================================ -->
	    <object type="button"
		name="diplomacyButton1"
		size="100%-196 0 100%-164 32"
		style="iconButton"
		tooltip_style="sessionToolTip"
		tooltip="Diplomacy"
	    >
		<!-- TODO make the button less ugly -->
		<object size="0 0 100% 100%" name="diplomacyButtonImage" type="image" sprite="stretched:session/icons/diplomacy.png" ghost="true"/>
		<action on="Press">
		    toggleDiplomacy();
		</action>
	    </object>

	    <!-- ================================  ================================ -->
	    <!-- Menu Button -->
	    <!-- ================================  ================================ -->
	    <object type="button"
		    name="menuButton"
		    size="100%-164 4 100%-8 32"
		    style="StoneButtonFancy"
		    tooltip_style="sessionToolTip"
		    z="70"
	    >
		<!-- 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"
		z="40"
	>
	    <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>

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

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

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

	<!-- In-progress research -->
	<object size="100%-50 85 100%-10 100%-200">
		<repeat count="10">
			<object name="researchStartedButton[n]" hidden="true" style="iconButton" type="button" size="0 0 40 40" tooltip_style="sessionToolTipBottom">
				<object name="researchStartedIcon[n]" ghost="true" type="image" size="3 3 37 37"/>
				<object name="researchStartedProgressSlider[n]" type="image" sprite="queueProgressSlider" ghost="true" size="3 3 37 37"/>
			</object>
		</repeat>
	</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
		Follows the mouse around if 'independent' is set to 'true'. -->
	<!-- ================================  ================================ -->
	<object name="informationTooltip" type="tooltip" independent="true" style="informationTooltip"/>

	<!-- ================================  ================================ -->
	<!-- Wall-dragging tooltip. Shows the total cost of building a wall while the player is dragging it. -->
	<!-- ================================  ================================ -->
	<object name="wallDragTooltip" 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 (Left of Selection Details) -->
	    <!-- ================================  ================================ -->
	    <object size="50%-304 100%-170 50%-110 100%" name="supplementalSelectionDetails" type="image" sprite="supplementalDetailsPanel" z="20">

		<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" ghost="true" size="3 3 33 33"/>
				<object name="unitFormationSelection[n]" hidden="true" type="image" ghost="true" size="3 3 33 33" sprite="stretched:session/icons/corners.png"/>
			    </object>
			</repeat>
		    </object>
		</object>

		<object name="unitGarrisonPanel"
			size="24 12 100% 100%"
		>
		    <object size="0 0 100% 100%">
			<repeat count="12">
			    <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" 
			size="6 36 100% 100%"
			hidden="true"
		>
		    <object ghost="true" style="resourceText" type="text" size="0 0 100% 20">Exchange resources:</object>
		    <object size="0 32 100% 78">
			<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="unitBarterSellUnaffordable[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="colour: 255 0 0 60"/>
				<object name="unitBarterSellAmount[n]" ghost="true" style="resourceText" type="text" size="0 0 100% 50%"/>
				<object name="unitBarterSellSelection[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="stretched:session/icons/corners.png"/>
			    </object>
			</repeat>
		    </object>
		    <object size="0 78 100% 124">
			<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="unitBarterBuyUnaffordable[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="colour: 255 0 0 60"/>
				<object name="unitBarterBuyAmount[n]" ghost="true" style="resourceText" type="text" size="0 0 100% 50%"/>
			    </object>
			</repeat>
		    </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 name="unitStanceSelection[n]" hidden="true" type="image" ghost="true" size="3 3 33 33" sprite="stretched:session/icons/corners.png"/>
			    </object>
			</repeat>
		    </object>
		</object>
	    </object>

	    <!-- ================================  ================================ -->
	    <!-- Selection Details Panel (Middle) -->
	    <!-- ================================  ================================ -->
	    <object name="selectionDetails"
		    type="image"
		    sprite="selectionDetailsPanel"
		    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">
		    
		    <!-- Stats Bars -->
		    <object size= "2 0 100%-2 98" type="image" tooltip_style="sessionToolTip">
			
			<object size="0 8 100% 60" type="image" sprite="edgedPanelShader">
			    <!-- Health bar -->
			    <object size="88 0 100% 24" name="healthSection">
				<object size="0 0 100% 16" name="healthLabel" type="text" style="StatsTextLeft" ghost="true">Health:</object>
				<object size="0 0 100% 16" name="healthStats" type="text" style="StatsTextRight" ghost="true"/>
				<object size="1 16 100% 23" name="health" type="image">
				    <object type="image" sprite="barBorder" ghost="true" size="-1 -1 100%+1 100%+1"/>
				    <object type="image" sprite="healthBackground" ghost="true"/>
				    <object type="image" sprite="healthForeground" ghost="true" name="healthBar"/>
				    <object type="image" sprite="statsBarShaderHorizontal" ghost="true"/>
				</object>
			    </object>

			    <!-- Stamina bar -->
			    <object size="88 28 100% 52" name="staminaSection">
				<object size="0 0 100% 16" name="staminaLabel" type="text" style="StatsTextLeft" ghost="true">Stamina:</object>
				<object size="0 0 100% 16" name="staminaStats" type="text" style="StatsTextRight" ghost="true"/>
				<object size="1 16 100% 23" name="stamina" type="image">
				    <object type="image" sprite="barBorder" ghost="true" size="-1 -1 100%+1 100%+1"/>
				    <object type="image" sprite="staminaBackground" ghost="true"/>
				    <object type="image" sprite="staminaForeground" ghost="true" name="staminaBar"/>
				    <object type="image" sprite="statsBarShaderHorizontal" ghost="true"/>
				</object>
			    </object>

			    <!-- Resource bar -->
			    <object size="88 28 100% 52" name="resourceSection">
				<object size="0 0 100% 16" name="resourceLabel" type="text" style="StatsTextLeft" ghost="true"/>
				<object size="0 0 100% 16" name="resourceStats" type="text" style="StatsTextRight" ghost="true"/>
				<object size="1 16 100% 23" name="resources" type="image">
				    <object type="image" sprite="barBorder" ghost="true" size="-1 -1 100%+1 100%+1"/>
				    <object type="image" sprite="resourceBackground" ghost="true"/>
				    <object type="image" sprite="resourceForeground" ghost="true" name="resourceBar"/>
				    <object type="image" sprite="statsBarShaderHorizontal" ghost="true"/>
				</object>
			    </object>
			</object>
			
			<object size="0 60 100% 96" type="image" sprite="edgedPanelShader">
			    <!-- Attack and Armor -->
			    <object size="90 -2 126 34" name="attackAndArmorStats" type="image" sprite="stretched:session/icons/stances/defensive.png" tooltip="Attack and Armor" tooltip_style="sessionToolTip"/>

			    <!-- Resource carrying icon/counter -->
			    <object size="100%-78 -2 100%-28 34" type="text" name="resourceCarryingText" style="CarryingTextRight"/>
			    <object size="100%-36 -2 100% 34" type="image" name="resourceCarryingIcon"/>
			</object>
			
			<!-- Big unit icon -->
			<object size="-8 -8 88 88" type="image" name="iconBorder" sprite="iconBorder" tooltip_style="sessionToolTip">
			    <object size="1 1 100%-1 100%-1" type="image" name="icon" ghost="true"/>
			
			    <!-- Experience bar -->
			    <object size="2 2 6 100%-2" type="image" name="experience" tooltip="Experience" tooltip_style="sessionToolTip">
				<object type="image" sprite="barBorder" ghost="true" size="-1 -1 100%+1 100%+1"/>
				<object type="image" sprite="experienceBackground" ghost="true"/>
				<object type="image" sprite="experienceForeground" ghost="true" name="experienceBar"/>
				<object type="image" sprite="statsBarShaderVertical" ghost="true"/>
			    </object>
			
			    <object z="20" size="4 4 20 20" name="rankIcon" type="image" tooltip="Rank" tooltip_style="sessionToolTip"/>
			</object>
		    </object>
		    
		    <!-- Names (this must come before the attack and armor icon to avoid clipping issues) -->
		    <object size="2 96 100%-2 100%-36" name="statsArea" type="image" sprite="edgedPanelShader">
			
			<!-- These images are used to clip off the top and bottom of the civ icon -->
			<object z="30" size="0 -5 100% 40" ghost="true" type="image" sprite="remove"/>
			<object z="30" size="0 100%-5 100% 100%+40" ghost="true" type="image" sprite="remove"/>
			
			<object z="30" size="0 2 100% 45" ghost="true">
			    <!-- Specific Name -->
			    <object size="0 0 100% 20" name="specific" ghost="true" type="text" style="SpecificNameCentered"/>

			    <!-- Generic Name -->
			    <object size="0 15 100% 36" name="generic" ghost="true" type="text" style="GenericNameCentered"/>
			</object>
			
			<!-- Player Name and Civ -->
			<object size="0 40 100% 100%">
			    <object size="50%-64 50%-64 50%+64 50%+64" name="playerCivIcon" type="image" ghost="true"/>
			    <object size="0 0 100% 100%" name="playerColorBackground" type="image" sprite="playerColorBackground" ghost="true"/>
			    <object size="0 0 100% 100%" type="image" sprite="bottomEdgedPanelShader" ghost="true"/>
			    
			    <!-- Why is this being automatically ghosted? In the mean time, set ghost to false -->
			    <object ghost="false" size="0 0 100% 100%-5" name="player" type="text" style="largeCenteredOutlinedText" tooltip_style="sessionToolTip"/>
			</object>
		    </object>

		</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 50 100%-18 100%-44" type="image" tooltip_style="sessionToolTip">
			<!-- Health bar -->
			<object size="4 0 11 100%" type="image" name="healthMultiple" tooltip="Hitpoints" tooltip_style="sessionToolTip">
			    <object type="image" sprite="barBorder" ghost="true" size="-1 -1 100%+1 100%+1"/>
			    <object type="image" sprite="healthBackground" ghost="true"/>
			    <object type="image" sprite="healthForeground" ghost="true" name="healthBarMultiple"/>
			    <object type="image" sprite="statsBarShaderVertical" ghost="true"/>
			</object>

			<!-- Stamina bar -->
			<object size="15 0 22 100%" type="image" name="staminaMultiple" tooltip="Stamina" tooltip_style="sessionToolTipBold">
			    <object type="image" sprite="barBorder" ghost="true" size="-1 -1 100%+1 100%+1"/>
			    <object type="image" sprite="staminaBackground" ghost="true"/>
			    <object type="image" sprite="staminaForeground" ghost="true" name="staminaBarMultiple"/>
			    <object type="image" sprite="statsBarShaderVertical" ghost="true"/>
			</object>
		    </object>
		</object>

		<!-- Unit Commands -->
		<object name="unitCommandPanel"
			size="0 100%-36 100% 100%-4"
			type="image"
			z="30"
		>
		    <object size="0 1 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>

		<!-- shading for unit commands area -->
		<object z="50" size="4 100%-36 100%-4 100%-4" ghost="true" type="image" sprite="bottomEdgedPanelShader"/>

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

	    <!-- ================================  ================================ -->
	    <!-- Commands Panel (Right of Selection Details) -->
	    <!-- ================================  ================================ -->
	    <object name="unitCommands"
		    type="image"
		    sprite="unitCommandsPanel"
		    size="50%+110 100%-170 50%+512 100%"
		    hidden="false"
		    z="20"
	    >
		<object name="unitConstructionPanel"
			size="10 12 100% 100%"
		>
		    <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 name="unitConstructionUnaffordable[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="colour: 255 0 0 127"/>
			    </object>
			</repeat>
		    </object>
		</object>

		<object name="unitResearchPanel"
			size="10 100%-102 100% 100%"
		>
		    <object size="0 0 100% 100%">
			<repeat count="16">
			    <object name="unitResearchButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
				<object name="unitResearchIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
				<object name="unitResearchSelection[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="colour: 255 0 0 127"/>
				<object name="unitResearchUnaffordable[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="colour: 255 0 0 60"/>
			    </object>
			</repeat>
			<repeat count="8">
			    <object name="unitResearchPair[n]" hidden="true" size="0 0 46 92">
				<object name="unitResearchPairIcon[n]" type="image" ghost="true" size="8 38 38 54" sprite="stretched:session/icons/vertical_pair.png"/>
			    </object>
			</repeat>
		    </object>
		</object>

		<object name="unitTrainingPanel"
			size="10 12 100% 100%"
		>
		    <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 name="unitTrainingUnaffordable[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="colour: 255 0 0 127"/>
			    </object>
			</repeat>
		    </object>
		</object>

		<object name="unitTradingPanel"
			size="10 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 name="unitTradingSelection[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="stretched:session/icons/corners.png"/>
			    </object>
			</repeat>
		    </object>
		</object>

		<object name="unitQueuePanel"
			size="4 -56 100% 0"
			type="image"
			sprite="queuePanelShader"
		>
		    <object size="-4 -2 52 54" type="image" sprite="stretched:session/icons/production.png" tooltip_style="sessionToolTipBottom" 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="3 3 37 37" z="20"/>
				<object name="unitQueueCount[n]" ghost="true" style="groupIconsText" type="text" z="20"/>
			    </object>
			</repeat>
		    </object>
		</object>

		<object name="unitGatePanel"
			size="10 12 100% 100%"
		>
		    <object size="0 0 100% 100%">
			<repeat count="8">
			    <object name="unitGateButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
				<object name="unitGateIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
				<object name="unitGateSelection[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="stretched:session/icons/corners.png"/>
				<object name="unitGateUnaffordable[n]" hidden="true" type="image" ghost="true" size="3 3 43 43" sprite="colour: 255 0 0 127"/>
			    </object>
			</repeat>
		    </object>
		</object>
    
    <object name="unitPackPanel"
			size="10 12 100% 100%"
		>
		    <object size="0 0 100% 100%">
			<repeat count="8">
			    <object name="unitPackButton[n]" hidden="true" style="iconButton" type="button" size="0 0 46 46" tooltip_style="sessionToolTipBottom">
				<object name="unitPackIcon[n]" type="image" ghost="true" size="3 3 43 43"/>
			    </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>
