<?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>
		
		<!-- Number of Players-->
		<object size="24 26 224 54">

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

		</object>
		
		<!-- Player assignments -->
		<object size="24 59 100%-440 358" type="image" sprite="BackgroundIndentFillDark" name="playerAssignmentsPannel">
			<object size="0 6 100% 30">
				<object name="playerNameHeading" type="text" style="CenteredLabelText" size="0 0 25% 100%">Player Name</object>
				<object name="playerPlacementHeading" type="text" style="CenteredLabelText" size="25%+5 0 55% 100%">Player Placement</object>
				<object name="playerCivHeading" type="text" style="CenteredLabelText" size="55%+35 0 85% 100%">Civilization</object>
				<object name="civInfoButton"
					type="button"
					sprite="iconInfoGold"
					sprite_over="iconInfoWhite"
					size="85%-26 0 85%-10 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="85%+5 0 100%-5 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 25% 30"/>
						<object name="playerAssignment[n]" type="dropdown" style="StoneDropDown" size="25%+5 2 55% 30" tooltip_style="onscreenToolTip" tooltip="Select player."/>
						<object name="playerConfig[n]" type="button" style="StoneButton" size="55%+5 6 55%+30 26"
							tooltip_style="onscreenToolTip"
							tooltip="Configure AI settings."
						>C</object>
						<object name="playerCiv[n]" type="dropdown" style="StoneDropDown" size="55%+35 2 85% 30" tooltip_style="onscreenToolTip" tooltip="Select player's civilization."/>
						<object name="playerCivText[n]" type="text" style="CenteredLabelText" size="55%+35 0 85% 30"/>
						<object name="playerTeam[n]" type="dropdown" style="StoneDropDown" size="85%+5 2 100%-5 30" tooltip_style="onscreenToolTip" tooltip="Select player's team."/>
						<object name="playerTeamText[n]" type="text" style="CenteredLabelText" size="85%+5 0 100%-5 100%"/>
					</object>
				</repeat>
			</object>
		</object>
		<object size="24 64 100%-460 358" type="image" sprite="CoverFillDark" name="playerAssignmentsPannelCover" hidden="true"/>
		<!-- Map selection -->
		
		
		<object size="100%-425 363 100%-325 455" name="mapTypeSelectionTooltip">
			<object type="text" style="RightLabelText" size="0 66 100% 88">Select Map:</object>
			<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 type="text" style="RightLabelText" size="0 94 100% 122">Map Size:</object>
		</object>

		<object size="100%-327 363 100%-25 423" name="mapFilterSelectionTooltip">
			<object name="mapTypeText" type="text" style="LeftLabelText" size="0 0 100% 28"  hidden="true"/>
			<object name="mapFilterText" type="text" style="LeftLabelText" size="0 32 100% 60"  hidden="true"/>
			<object name="mapSelectionText" type="text" style="LeftLabelText" size="0 64 100% 92"  hidden="true"/>
		</object>
		
		<object name="mapTypeSelection"
			type="dropdown"
			style="StoneDropDown"
			size="100%-327 363 100%-25 391"
			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%-327 395 100%-25 423"
			tooltip_style="onscreenToolTip"
			tooltip="Select a map filter.">
			<action on="SelectionChange">selectMapFilter(this.list[this.selected]);</action>
		</object>
		
		<object size="100%-327 427 100%-25 455" name="mapSelectionPannel" z="55">

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

		</object>
		
		<object size="100%-327 459 100%-25 487">
			
			<!-- Map Size-->	
			<object size="0 0 100% 100%">
				<object name="mapSizeText" size="0 0 100% 100%" type="text" style="LeftLabelText"/>
				<object name="mapSize" size="0 0 100% 28" type="dropdown" style="StoneDropDown" hidden="true" tooltip_style="onscreenToolTip" tooltip="Select map size. (Larger sizes may reduce performance.)"/>
			</object>
		
		</object>
		
		<!-- Map Preview -->
		<object  type="image" sprite="BackgroundIndentFillDark" name="gamePreviewBox" size="100%-426 57 100%-24 359">
			<object type="image" sprite="snMapPreview" size="1 1 401 301" name="mapPreview"/>
		</object>
		
		<!-- Map Description -->
		<object size="100%-425 497 100%-25 100%-60">
			<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>
		
		<!-- Options -->
		<object name="gameOptionsBox" size="100%-425 497 100%-25 525">
			<!-- More Options Button -->
			<object
				name="showMoreOptions"
				type="button"
				style="StoneButton"
				size="100%-120 0 100% 28"
				tooltip_style="onscreenToolTip"
				tooltip="See more game options"
			>
				More Options
				<action on="Press">toggleMoreOptions();</action>
			</object>
			
		<!-- End Options -->
		</object>

		<!-- More Options -->
		<object name="moreOptions" type="image" sprite="StoneWindow" size="50%-190 50%-120 50%+190 50%+155" z="55" hidden="true">
			<object style="TitleText" type="text" size="50%-128 11 50%+128 27">
				More Options
			</object>
			
			<object size="14 38 94% 66">
				<object size="0 0 40% 28">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Victory condition:</object>
				</object>
				<object name="victoryConditionText" size="40% 0 100% 100%" type="text" style="LeftLabelText"/>
				<object name="victoryCondition" size="40% 0 100% 28" type="dropdown" style="StoneDropDown" hidden="true" tooltip_style="onscreenToolTip" tooltip="Select victory condition."/>
			</object>
			
			<object size="14 68 94% 96">
				<object size="0 0 40% 28">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Population Cap:</object>
				</object>
				<object name="populationCapText" size="40% 0 100% 100%" type="text" style="LeftLabelText"/>
				<object name="populationCap" size="40% 0 100% 28" type="dropdown" style="StoneDropDown" hidden="true" tooltip_style="onscreenToolTip" tooltip="Select population cap."/>
			</object>
			
			<object size="14 98 94% 126">
				<object size="0 0 40% 28">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Starting Resources:</object>
				</object>
				<object name="startingResourcesText" size="40% 0 100% 100%" type="text" style="LeftLabelText"/>
				<object name="startingResources" size="40% 0 100% 28" type="dropdown" style="StoneDropDown" hidden="true" tooltip_style="onscreenToolTip" tooltip="Select the game's starting resources."/>
			</object>
			
			<object size="14 128 94% 216">
				<object size="0 0 40% 28">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Reveal map:</object>
				</object>
				<object size="0 30 40% 58">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Teams locked:</object>
				</object>
				<object size="0 60 40% 88" name="enableCheatsDesc" hidden="true">
					<object size="0 0 100% 100%" type="text" style="RightLabelText">Cheats:</object>
				</object>
				
				<object size="40% 0 100% 28">
					<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="40% 30 100% 58">
					<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 size="40% 60 100% 88">
					<object name="enableCheatsText" size="0 0 100% 100%" type="text" style="LeftLabelText" hidden="true"/>
					<object name="enableCheats" size="0 50%-8 16 50%+8" type="checkbox" style="StoneCrossBox" hidden="true" tooltip_style="onscreenToolTip" tooltip="Toggle the usability of cheats."/>
				</object>
			</object>

			<!-- Hide More Options Button -->
			<object
				name="hideMoreOptions"
				type="button"
				style="StoneButton"
				size="50%-70 218 50%+70 246"
				tooltip_style="onscreenToolTip"
				tooltip="Close more game options window"
			>
				OK
				<action on="Press">toggleMoreOptions();</action>
			</object>
		<!-- End More Options -->
		</object>
		


		<!-- Chat window -->
		<object name="chatPanel" size="24 370 100%-435 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>
