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

<objects>

	<script file="gui/common/network.js"/>
	<script file="gui/common/functions_civinfo.js"/>
	<script file="gui/common/functions_global_object.js"/>
	<script file="gui/common/functions_utility.js"/>
	<script file="gui/gamesetup/gamesetup.js"/>

	<!-- Add a translucent black background to fade out the menu page -->
	<object type="image" z="0" sprite="BackgroundTranslucent"/>

	<object type="image" style="StoneDialog" size="50%-190 50%-80 50%+190 50%+80" name="loadingWindow">

		<object type="text" style="TitleText" size="50%-128 0%-16 50%+128 16">
			Loading
		</object>

		<object type="text" style="CenteredLabelText">
			Loading map data. Please wait...
		</object>

	</object>

	<object type="image" style="StoneWindow" size="0 0 100% 100%" hidden="true" name="setupWindow">

		<action on="Tick">
			onTick();
		</action>

		<object style="TitleText" type="text" size="50%-128 4 50%+128 36">
			Match Setup
		</object>

		<!-- Map selection -->
		<object size="24 64 300 100%-24">

			<object size="0 0 100%-180 100%">
				<object type="text" style="RightLabelText" size="0 0 100% 28">Match Type:</object>
				<object type="text" style="RightLabelText" size="0 34 100% 60">Map Filter:</object>
			</object>

			<object size="100%-180 0 100% 100%">
				<object name="mapTypeText" type="text" style="LeftLabelText" size="0 0 100% 28" hidden="true"/>
				<object name="mapFilterText" type="text" style="LeftLabelText" size="0 34 100% 60" hidden="true"/>
			</object>

			<object name="mapTypeSelection"
				type="dropdown"
				style="StoneDropDown"
				size="100%-180 0 100% 30"
				tooltip_style="onscreenToolTip"
				tooltip="Select a map type.">
				<action on="SelectionChange">selectMapType(this.list_data[this.selected]);</action>
			</object>

			<object name="mapFilterSelection"
				type="dropdown"
				style="StoneDropDown"
				size="100%-180 34 100% 64"
				tooltip_style="onscreenToolTip"
				tooltip="Select a map filter.">
				<action on="SelectionChange">selectMapFilter(this.list[this.selected]);</action>
			</object>

			<object name="mapSelection"
				style="StoneList"
				type="list"
				size="0 70 100% 100%-200"
				tooltip_style="onscreenToolTip"
				tooltip="Select a map to play on.">
				<action on="SelectionChange">selectMap(this.list_data[this.selected]);</action>
			</object>

			<object size="0 100%-190 100% 100%">
				<object name="mapInfoName" type="text" style="LeftLabelText" size="0 0 100% 30"/>
				<object type="image" sprite="BackgroundIndentFillDark" size="0 30 100% 100%">
					<object name="mapInfoDescription" type="text" style="MapDescription" size="0 0 100% 100%"/>
				</object>
			</object>

		</object>

		<!-- Player assignments -->
		<object size="320 64 100%-24 358" type="image" sprite="BackgroundIndentFillDark">
			<object size="0 6 100% 30">
				<object name="playerNameHeading" type="text" style="CenteredLabelText" size="0 0 180 100%">Player Name</object>
				<object name="playerPlacementHeading" type="text" style="CenteredLabelText" size="180 0 340 100%">Player Placement</object>
				<object name="playerCivHeading" type="text" style="CenteredLabelText" size="350 0 530 100%">Civilization</object>
				<object name="civInfoButton"
					type="button"
					sprite="iconInfo"
					sprite_over="iconInfoOver"
					size="484 0 500 16"
					tooltip_style="onscreenToolTip"
					tooltip="View civilization info"
				>
					<action on="Press"><![CDATA[
						Engine.PushGuiPage("page_civinfo.xml");
					]]></action>
				</object>
				<object name="playerTeamHeading" type="text" style="CenteredLabelText" size="530 0 630 100%">Team</object>
			</object>
			<object size="1 36 100%-1 100%">
				<repeat count="8">
					<object name="playerBox[n]" size="0 0 100% 32" hidden="true">
						<object name="playerColour[n]" type="image" size="0 0 100% 100%"/>
						<object name="playerName[n]" type="text" style="CenteredLabelText" size="0 2 180 30"/>
						<object name="playerAssignment[n]" type="dropdown" style="StoneDropDown" size="190 2 340 30" tooltip_style="onscreenToolTip" tooltip="Select player."/>
						<object name="playerConfig[n]" type="button" style="StoneButton" size="345 6 370 26"
							tooltip_style="onscreenToolTip"
							tooltip="Configure AI settings."
						>C</object>
						<object name="playerCiv[n]" type="dropdown" style="StoneDropDown" size="375 2 505 30" tooltip_style="onscreenToolTip" tooltip="Select player's civilization."/>
						<object name="playerCivText[n]" type="text" style="CenteredLabelText" size="375 0 505 30"/>
						<object name="playerTeam[n]" type="dropdown" style="StoneDropDown" size="515 2 615 30" tooltip_style="onscreenToolTip" tooltip="Select player's team."/>
						<object name="playerTeamText[n]" type="text" style="CenteredLabelText" size="545 0 615 100%"/>
					</object>
				</repeat>
			</object>
		</object>


		<!-- Options -->
		<object name="gameOptionsBox" size="320 366 100%-24 470">

			<!-- First Column -->
			<object size="0 0 150 100%">

				<!-- Number of Players-->
				<object size="0 0 100% 32">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Number of players:</object>
				</object>

				<object size="0 32 100% 64">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Map size:</object>
				</object>

				<object size="0 64 100% 96">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Victory condition:</object>
				</object>

			</object>

			<!-- Second Column -->
			<object size="150 0 330 100%">

				<!-- Number of Players-->
				<object size="0 0 100% 32">
					<object name="numPlayersText" size="0 0 100% 100%" type="text" style="LeftLabelText"/>
						<object name="numPlayersSelection"
							type="dropdown"
							style="StoneDropDown"
							size="0 2 100% 30"
							tooltip_style="onscreenToolTip"
							tooltip="Select number of players.">
						<action on="SelectionChange">selectNumPlayers(this.list_data[this.selected]);</action>
					</object>
				</object>

				<object size="0 32 100% 64">
					<object name="mapSizeText" size="0 0 100% 100%" type="text" style="LeftLabelText"/>
					<object name="mapSize" size="0 2 100% 30" type="dropdown" style="StoneDropDown" hidden="true" tooltip_style="onscreenToolTip" tooltip="Select map size. (Larger sizes may reduce performance.)"/>
				</object>

				<object size="0 64 100% 96">
					<object name="victoryConditionText" size="0 0 100% 100%" type="text" style="LeftLabelText"/>
					<object name="victoryCondition" size="0 2 100% 30" type="dropdown" style="StoneDropDown" hidden="true" tooltip_style="onscreenToolTip" tooltip="Select victory condition."/>
				</object>
			</object>

			<!-- Third Column -->
			<object size="330 0 450 100%">
				<object size="0 0 100% 32">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Reveal map:</object>
				</object>
				<object size="0 32 100% 64">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Teams locked:</object>
				</object>
			</object>

			<!-- Fourth Column -->
			<object size="450 0 600 100%">
				<object size="0 0 100% 32">
					<object name="revealMapText" size="0 0 100% 100%" type="text" style="LeftLabelText"/>
					<object name="revealMap" size="0 50%-8 16 50%+8" type="checkbox" style="StoneCrossBox" hidden="true" tooltip_style="onscreenToolTip" tooltip="Toggle reveal map."/>
				</object>
				<object size="0 32 100% 64">
					<object name="lockTeamsText" size="0 0 100% 100%" type="text" style="LeftLabelText"/>
					<object name="lockTeams" size="0 50%-8 16 50%+8" type="checkbox" style="StoneCrossBox" hidden="true" tooltip_style="onscreenToolTip" tooltip="Toggle locked teams."/>
				</object>
			</object>
		<!-- End Options -->
		</object>


		<!-- Chat window -->
		<object name="chatPanel" size="320 470 100%-24 100%-58" type="image" sprite="BackgroundIndentFillDark">
			<object name="chatText" size="2 2 100%-2 100%-26" type="text" style="ChatPanel"/>

			<object name="chatInput" size="4 100%-24 100%-76 100%-4" type="input" style="StoneInput">
				<action on="Press">submitChatInput();</action>
			</object>

			<object size="100%-72 100%-24 100%-4 100%-4" type="button" style="StoneButton">
				Send
				<action on="Press">submitChatInput();</action>
			</object>
		</object>


		<!-- Tooltip -->
		<object name="onscreenToolTip"
			type="text"
			font="serif-14"
			textcolor="white"
			sprite="BackgroundTranslucent"
			hidden="true"
			size="100%-700 100%-56 100%-312 100%-24"
		>[Tooltip text]</object>

		<!-- Start Button -->
		<object
			name="startGame"
			type="button"
			style="StoneButton"
			size="100%-308 100%-52 100%-168 100%-24"
			tooltip_style="onscreenToolTip"
			tooltip="Start a new game with the current settings."
		>
			Start game!
			<action on="Press">launchGame();</action>
		</object>

		<!-- Cancel Button -->
		<object
			name="cancelGame"
			type="button"
			style="StoneButton"
			size="100%-164 100%-52 100%-24 100%-24"
			tooltip_style="onscreenToolTip"
			tooltip="Return to the main menu."
		>
			Main menu
			<action on="Press">
				<![CDATA[
					cancelSetup();
					Engine.PopGuiPage();
				]]>
			</action>
		</object>

	</object>

</objects>
