<xml>
	<ui style="ui/styles/style.css">
		<OnEvent id="ConfirmLevel" />
		<OnEvent id="ConfirmStage" />
		
		<core.Widget 
			id="Menu_EndlessShift"
			class="levels"
			visible="false">
			<core.Widget id="Stages">
				<stagemap.LevelSelectWidget id="Stage_%" repeatme="5">
					<OnEvent id="MouseUp">
						if core.profiles.selected.IsStageUnlocked(self.number):
							(core.Lib.scene.ui >> 'Menu_Diffuculty').stage = self.number
							(core.Lib.scene.ui >> 'Menu_Diffuculty').FadeIn()
					</OnEvent>
				</stagemap.LevelSelectWidget>
			</core.Widget>
			<core.Widget width="200" position="0,600">
				<core.Widget 
					id="Button_Play"
					class="button ok"
 					visible="False" />
				<core.Widget 
					id="Button_Cancel"
					class="button cancel"
					text="*BACK">
					<OnEvent id="MouseUp">
						self.window.HideWindow()
					</OnEvent>
				</core.Widget>
			</core.Widget>
			<OnEvent id="Created">
				map(lambda x: x.UnlockStage(), (self >> 'Stages').linked)
			</OnEvent>
		</core.Widget>
		
		<core.Widget
			id="Menu_Buildings"
			class="overlay" />
		
		<core.Widget
			id="Menu_Diffuculty"
			fader="darkness"
			visible="false"
			class="darkness">
			<core.Widget 
				id="Window"
				class="window window_small">
				<core.Widget
					class="title" 
					text="*SELECTDIFFICULTY" />
				<core.Widget class="cross">
					<OnEvent id="MouseUp">
						self.window.FadeOut()
					</OnEvent>
				</core.Widget>
				<core.Widget
					class="buttonbox"
					columns="2">
					<core.Widget 
						id="Button_%"
						class="button"
						repeatme="2">
						<OnEvent id="MouseUp">
							import start
							core.Lib.scene.result = 'level.Level(index = {0}, endless_shift = \'{1}\')'\
								.format(50 + self.window.stage, ['Normal', 'Hard'][self.number])
						</OnEvent>
						<OnEvent id="Created">
							self.text = [ "*NORMAL", "*HARD" ][self.number]
						</OnEvent>
					</core.Widget>
				</core.Widget>
			</core.Widget>
		</core.Widget>
		
		<core.Widget 
			class="stage_panel">
			<core.Widget
				class="buttonbox"
				columns="2"
				position="0,-279">
				<core.Widget 
					class="button cancel"
					text="*BACK"
					position="680,0">
					<OnEvent id="MouseUp">
						core.Lib.scene.result = 'menu.Menu()'
					</OnEvent>
				</core.Widget>
			</core.Widget>
		</core.Widget>
		
		<core.Widget
			position="100,620"
			class="upgrade_chest overlay"
			image="ui/widgets/hud_shop">
			<core.Widget 
				text="XXXXX" 
				class="coins">
				<OnEvent id="Created">
					p = core.profiles.selected
					if 1 >= len(p.levels) or p.levels[-1].coins == 0:
						self.window.Dispose()
					self.text = str(p.levels[-1].coins)
				</OnEvent>
			</core.Widget>
		</core.Widget>
		
		<core.Widget
			id="ConfirmStage"
			fadein="ConfirmStage"
			class="darkness"
			fader="darkness">
			<core.Widget
				id="Window"
				class="window">
				<core.Widget id="Title" class="title" text="*STAGETITLE" />
				<core.Widget class="cross">
					<OnEvent id="MouseUp">
						self.window.FadeOut()
					</OnEvent>
				</core.Widget>
				
				<core.Widget columns="5" class="roundbuttonholder">
					<core.Widget id="Level_%" text="15" class="levelbutton" repeatme="10">
						<core.Widget id="Stars" nohover="True">
							<core.Widget class="star" position="10,30" color="#80000000" />
							<core.Widget class="star" position="26,33" color="#80000000" />
							<core.Widget class="star" position="42,30" color="#80000000" />
							<core.Widget id="Star_0" class="star" position="9,29" />
							<core.Widget id="Star_1" class="star" position="25,32" />
							<core.Widget id="Star_2" class="star" position="41,29" />
						</core.Widget>
						<OnEvent id="MouseUp">
							core.Lib.scene.OnLevelClicked(self, None)
						</OnEvent>
					</core.Widget>
				</core.Widget>
				
				<core.Widget height="2" />
				
				<core.Widget id="LevelStats_Holder">
					<core.Widget id="LevelStats_%" class="stats_table inner_overlay" columns="2" repeatme="2">
						<level.Stat id="Stat_1" label="*GOALSCORE" value="{goal_0}" class="important" >
							<core.Widget class="label star_container" position="26,0">
								<core.Widget class="star" position="1,1" color="black" />
								<core.Widget class="star" position="26,1" color="black" />
								<core.Widget class="star" position="51,1" color="black" />
								<core.Widget id="GoalStar_0" class="star" position="0,0" />
								<core.Widget id="GoalStar_1" class="star" position="25,0" />
								<core.Widget id="GoalStar_2" class="star" position="50,0" />
							</core.Widget>
							<OnEvent id="Created">
								(self >> 'Label').transparency = 0
							</OnEvent>
						
						</level.Stat>
						<level.Stat id="Stat_2" label="*BEST" value="{score}" class="unimportant" position="0,6">
							<core.Widget class="label star_container" position="3,5">
								<core.Widget class="star" position="1,1" color="black" />
								<core.Widget class="star" position="19,1" color="black" />
								<core.Widget class="star" position="37,1" color="black" />
								<core.Widget id="BestStar_0" class="star" position="0,0" />
								<core.Widget id="BestStar_1" class="star" position="18,0" />
								<core.Widget id="BestStar_2" class="star" position="36,0" />
							</core.Widget>
							<OnEvent id="Created">
								(self >> 'Label').transparency = 0
							</OnEvent>
						</level.Stat>
					</core.Widget>
				</core.Widget>
				
				<!--core.Widget height="8" />
				
				<core.Widget id="Stats" class="stats_table" columns="4">
					<level.Stat id="Stat_%" label="..." value="{goal_0}" class="unimportant" repeatme="3">
						<core.Widget class="label star_container" position="-18,5">
							<core.Widget class="star" position="1,1" color="black" />
							<core.Widget class="star" position="19,1" color="black" />
							<core.Widget class="star" position="37,1" color="black" />
							<core.Widget id="Star_0" class="star" position="0,0" />
							<core.Widget id="Star_1" class="star" position="18,0" />
							<core.Widget id="Star_2" class="star" position="36,0" />
						</core.Widget>
						<OnEvent id="Created">
							(self >> 'Label').transparency = 0
							self.value = '{goal_%i}' % (2 - self.number)
							if self.number == 2:
								(self >> 'Star_1').enabled = False
								(self >> 'Star_2').enabled = False
							elif self.number == 1:
								(self >> 'Star_2').enabled = False
						</OnEvent>
					</level.Stat>
					<level.Stat label="*BEST" value="{goal_1}" class="unimportant" />
				</core.Widget-->

				<core.Widget columns="2" class="buttonbox">
					<core.Widget text="*PLAY" class="button ok">
						<!--OnEvent id="Created">
							self.Attach(core.mod.Animator, type = 'pulse', amount = 0.1, speed = 2.0)
						</OnEvent-->
						<OnEvent id="MouseUp">
							import start
							core.Lib.scene.result = start.GetNextLevelName(core.Lib.scene.level)
						</OnEvent>
					</core.Widget>
					<core.Widget text="*CANCEL" class="button cancel">
						<OnEvent id="MouseUp">
							self.window.FadeOut()
						</OnEvent>
					</core.Widget>
				</core.Widget>
				<core.Widget id="Character" image="ui/characters/boy_customer_geek" position="205,-345" visible="false" />
			</core.Widget>
		</core.Widget>
		
	</ui>
	<scene>
		<core.media.Camera id="Camera01" position="1311.5,1792.25,1607.35" rotation="0.0149218,-0.488393,-0.872089,0.0266449" znear="100" zfar="5000" fov="34.516" />
		<core.Object id="Stage_00" position="1955.39,0.9478,263.58" rotation="-0,-0,-0.953717,0.300706"/>
		<core.Object id="Stage_01" position="1659.28,133.8188,149.08" rotation="-0,-0,-0.984808,0.173648"/>
		<core.Object id="Stage_02" position="835.863,153.621,149.08" rotation="-0,-0,-0.984808,-0.173648"/>
		<core.Object id="Stage_03" position="677.148,-534.981,416.426" rotation="-0,-0,-0.906308,-0.422618"/>
		<core.Object id="Stage_04" position="1473.9,-589.568,416.426" rotation="-0,-0,-0.953717,0.300706"/>
		
		<core.Object id="EffectStage_00" position="2027,-58,263.58"/>
		<core.Object id="EffectStage_01" position="1556,-16,149.08"/>
		<core.Object id="EffectStage_02" position="940,20,149.08"/>
		<core.Object id="EffectStage_03" position="816,-693,416.426"/>
		<core.Object id="EffectStage_04" position="1748,-882,416.426"/>
	</scene>	
</xml>