<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.blizzard.com/wow/ui/">

	<Script file="MenuUI.lua"/>
	<Script file="MenuHint.lua"/>
	<Script file="MenuButton.lua"/>
	<Script file="MenuSelect.lua"/>

	<Button name="CPUIListCategoryTemplate" virtual="true">
		<Size x="230" y="50"/>
		<HighlightTexture parentKey="HighlightTexture" file="Interface\AddOns\ConsolePort\Textures\Button\UI\Menu_Button_Hilite" alphaMode="ADD">
			<Anchors>
					<Anchor point="TOPLEFT" x="0" y="0"/>
					<Anchor point="BOTTOMRIGHT" x="0" y="0"/>
			</Anchors>
			<Color r="0.47" g="0.86" b="1" a="1"/>
		</HighlightTexture>
		<ButtonText parentKey="Label" inherits="Fancy22Font" justifyH="CENTER">
			<Anchors>
				<Anchor point="CENTER"/>
			</Anchors>
		</ButtonText>
		<Animations>
			<AnimationGroup parentKey="OnFocusAnim">
				<Scale childKey="HighlightTexture" duration="0.1" order="1" fromScaleX="0.1" fromScaleY="1" toScaleX="1.05" toScaleY="1"/>
				<Scale childKey="HighlightTexture" duration="0.1" order="2" fromScaleX="1.05" fromScaleY="1" toScaleX="1" toScaleY="1"/>
			</AnimationGroup>
		</Animations>
	</Button>

	<Button name="CPUIMenuButtonBaseTemplate" virtual="true" mixin="ConsolePortMenuButtonMixin">
		<Size x="230" y="60"/>
		<HighlightTexture parentKey="HighlightTexture" file="Interface\PVPFrame\PvPMegaQueue" alphaMode="ADD">
			<TexCoords left="0.00195313" right="0.63867188" top="0.70703125" bottom="0.76757813"/>
			<Anchors>
				<Anchor point="TOPLEFT" y="-4"/>
				<Anchor point="BOTTOMRIGHT" y="4"/>
			</Anchors>
		</HighlightTexture>
		<ButtonText parentKey="Label" inherits="Game12Font" justifyH="LEFT">
			<Size x="150"/>
			<Anchors>
				<Anchor point="LEFT" x="60" y="0"/>
			</Anchors>
		</ButtonText>
		<Layers>
			<Layer level="ARTWORK" textureSubLevel="1">
				<Texture parentKey="Icon">
					<Size x="40" y="40"/>
					<Anchors>
						<Anchor point="LEFT" x="12"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK" textureSubLevel="2">
				<Texture parentKey="Mask" file="Interface\AddOns\ConsolePort\Textures\Button\UI\Icon_Mask32">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Icon"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Icon"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Frames>
			<Frame parentKey="Overlay" setAllPoints="true">
				<Scripts>
					<OnLoad>
						local media = ConsolePortUI.Media;
						self:SetFrameLevel(self:GetFrameLevel() + 1);
						media:SetBackdrop(self, "GOSSIP_NORMAL");
						media:SetBackdrop(self:GetParent(), "GOSSIP_BG");
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame parentKey="Hilite" setAllPoints="true" alpha="0">
				<Scripts>
					<OnLoad>
						ConsolePortUI.Media:SetBackdrop(self, "GOSSIP_HILITE");
					</OnLoad>
				</Scripts>
			</Frame>
		</Frames>
	</Button>

	<Button name="CPUIMenuButtonMaskTemplate" virtual="true" inherits="CPUIMenuButtonBaseTemplate">
		<Layers>
			<Layer level="OVERLAY">
				<MaskTexture parentKey="IconMask" file="Interface\AddOns\ConsolePort\Textures\Button\Mask" hWrapMode="CLAMPTOBLACKADDITIVE" vWrapMode="CLAMPTOBLACKADDITIVE">
					<Anchors>
						<Anchor point="TOPLEFT" relativeKey="$parent.Icon"/>
						<Anchor point="BOTTOMRIGHT" relativeKey="$parent.Icon"/>
					</Anchors>
					<MaskedTextures>
						<MaskedTexture childKey="Icon"/>
					</MaskedTextures>
				</MaskTexture>
			</Layer>
		</Layers>
	</Button>

	<Frame name="CPUILineSheenTemplate" virtual="true" mixin="ConsolePortLineSheenMixin">
		<Size x="235" y="25"/>
		<Layers>
			<Layer level="ARTWORK">
				<Texture parentKey="LineSheen" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_LineBurst">
					<Size x="60" y="20"/>
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent" x="0" y="0"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnShow method="OnShow"/>
			<OnHide method="OnHide"/>
		</Scripts>
		<Animations>
			<AnimationGroup parentKey="OnShowAnim" setToFinalAlpha="true">
				<Alpha childKey="LineSheen" startDelay="0" duration="0.5" order="1" fromAlpha="0" toAlpha="0.75"/>
				<Alpha childKey="LineSheen" startDelay="0.5" duration="0.5" order="1" fromAlpha="0.75" toAlpha="0"/>
				<Translation parentKey="LineSheenTranslation" childKey="LineSheen" startDelay="0.15" duration="1" order="1" offsetX="230" offsetY="0"/>
			</AnimationGroup>
		</Animations>
	</Frame>

	<Frame name="CPUILootHeaderTemplate" virtual="true">
		<Size x="235" y="25"/>
		<Layers>
			<Layer level="ARTWORK">
				<Texture parentKey="Background" hidden="false" alpha="1" atlas="Objective-Header" useAtlasSize="true">
					<Anchors>
						<Anchor point="TOPLEFT" x="-29" y="14"/>
					</Anchors>
				</Texture>
				<FontString parentKey="Text" inherits="GameFontNormalMed2" justifyH="LEFT">
					<Size x="170" y="16"/>
					<Anchors>
						<Anchor point="LEFT" x="4" y="-1"/>
					</Anchors>
				</FontString>
				<Texture parentKey="LineGlow" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_LineGlow" useAtlasSize="true">
					<Anchors>
						<Anchor point="LEFT" relativeKey="$parent.Background" x="-50" y="18"/>
					</Anchors>
				</Texture>
				<Texture parentKey="SoftGlow" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_Glow" useAtlasSize="true">
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent.Background" relativePoint="LEFT" x="20" y="20"/>
					</Anchors>
				</Texture>
				<Texture parentKey="StarBurst" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_StarBurst" useAtlasSize="true">
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent.SoftGlow"/>
					</Anchors>
				</Texture>
				<Texture parentKey="LineSheen" hidden="false" alpha="0" alphaMode="ADD" atlas="OBJFX_LineBurst">
					<Size x="60" y="15"/>
					<Anchors>
						<Anchor point="CENTER" relativeKey="$parent.SoftGlow" x="0" y="-13"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				self.SetDurationMultiplier = function(self, multiplier)
					for _, animation in ipairs({self.HeaderOpenAnim:GetAnimations()}) do
						animation:SetDuration(animation:GetDuration() * multiplier)
					end
				end
			</OnLoad>
		</Scripts>
		<Animations>
			<AnimationGroup parentKey="HeaderOpenAnim" setToFinalAlpha="true">
				<Alpha childKey="Background" startDelay="0" duration="0" order="1" fromAlpha="0" toAlpha="0"/>
				<Alpha childKey="Background" startDelay="0.25" duration="0.5" order="1" fromAlpha="0" toAlpha="1"/>
				<Alpha childKey="LineGlow" duration="0.15" order="1" fromAlpha="0" toAlpha="1"/>
				<Alpha childKey="LineGlow" startDelay="0.25" duration="0.65" order="1" fromAlpha="1" toAlpha="0"/>
				<Scale childKey="LineGlow" duration="0.15" order="1" fromScaleX="0.1" fromScaleY="1.5" toScaleX="2" toScaleY="1.5">
					<Origin point="CENTER">
						<Offset x="-50" y="0"/>
					</Origin>
				</Scale>
				<Translation childKey="LineGlow" duration="0.75" order="1" offsetX="50" offsetY="0"/>
				<Alpha childKey="SoftGlow" duration="0.25" order="1" fromAlpha="0" toAlpha="1"/>
				<Alpha childKey="SoftGlow" startDelay="0.25" duration="0.5" order="1" fromAlpha="1" toAlpha="0"/>
				<Scale childKey="SoftGlow" duration="0.25" order="1" fromScaleX="0.5" fromScaleY="0.5" toScaleX="0.8" toScaleY="0.8"/>
				<Alpha childKey="StarBurst" duration="0.25" order="1" fromAlpha="0" toAlpha="1"/>
				<Alpha childKey="StarBurst" startDelay="0.25" duration="0.5" order="1" fromAlpha="1" toAlpha="0"/>
				<Scale childKey="StarBurst" duration="0.25" order="1" fromScaleX="0.5" fromScaleY="0.5" toScaleX="1" toScaleY="1"/>
				<Alpha childKey="LineSheen" startDelay="0.15" duration="0.5" order="1" fromAlpha="0" toAlpha="0.75"/>
				<Alpha childKey="LineSheen" startDelay="0.75" duration="0.5" order="1" fromAlpha="0.75" toAlpha="0"/>
				<Translation childKey="LineSheen" startDelay="0.15" duration="1.5" order="1" offsetX="250" offsetY="0"/>
			</AnimationGroup>
		</Animations>
	</Frame>

	<Frame name="CPUIHintTemplate" virtual="true" hidden="true" mixin="ConsolePortHintMixin">
		<Size y="64"/>
		<Layers>
			<Layer level="ARTWORK">
				<Texture parentKey="Icon" name="$parentIcon">
					<Size x="40" y="40"/>
					<Anchors>
						<Anchor point="LEFT"/>
					</Anchors>
				</Texture>
				<FontString parentKey="Text" name="$parentText" inherits="Game20Font">
					<Anchors>
						<Anchor point="LEFT" relativeKey="$parent.Icon" relativePoint="RIGHT" x="8"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad method="OnLoad"/>
			<OnShow method="OnShow"/>
			<OnHide method="OnHide"/>
		</Scripts>
	</Frame>

	<Frame name="CPUIHintBarTemplate" frameStrata="FULLSCREEN_DIALOG" virtual="true" hidden="true" mixin="ConsolePortHintBarMixin">
		<Size x="0" y="72"/>
		<Scripts>
			<OnLoad method="OnLoad"/>
		</Scripts>
	</Frame>

	<Texture name="CPUIMenuBackgroundStripTemplate" virtual="true" file="Interface\AddOns\ConsolePort\Textures\Window\Gradient">
		<TexCoords left="0" right="1" top="0.25" bottom="0"/>
	</Texture>

	<!-- Call Frame:LoadArt() to initiate art handler -->
	<!-- Call Frame:DrawIndex(headerFunc) to draw headers -->
	<!-- Call Frame:StartEnvironment() to initiate secure environment -->
	<Frame name="CPUIMenuTemplate" frameStrata="FULLSCREEN" virtual="true" inherits="SecureHandlerShowHideTemplate" mixin="ConsolePortMenuSecureMixin, ConsolePortMenuArtMixin">
		<Size x="0" y="54"/>
		<Anchors>
			<Anchor point="TOPLEFT" relativeTo="UIParent"/>
			<Anchor point="TOPRIGHT" relativeTo="UIParent"/>
		</Anchors>
		<Frames>
			<PlayerModel parentKey="Flair" name="$parentFlair" hidden="true" alpha="0.25">
				<Size x="230" y="52"/>
				<Scripts>
					<OnLoad>
						self:SetDisplayInfo(54419);
						self:SetCamDistanceScale(3);
						self:SetPosition(0, 0, -1.5);
					</OnLoad>
				</Scripts>
			</PlayerModel>
			<Frame parentKey="GlowLeft" name="$parentGlowLeft" inherits="CPUILineSheenTemplate" hidden="true">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" x="0" y="12"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetDirection('LEFT', 1.5);
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame parentKey="GlowRight" name="$parentGlowRight" inherits="CPUILineSheenTemplate" hidden="true">
				<Anchors>
					<Anchor point="TOP" relativePoint="BOTTOM" x="0" y="12"/>
				</Anchors>
				<Scripts>
					<OnLoad>
						self:SetDirection('RIGHT', 1.5);
					</OnLoad>
				</Scripts>
			</Frame>
			<Frame parentKey="Decor" name="$parentDecor" setAllPoints="true">
				<Layers>
					<Layer level="ARTWORK" textureSubLevel="1">
						<Texture parentKey="TopLine" file="Interface\AddOns\ConsolePort\Textures\Window\Menu-TopLine.blp">
							<Size y="8"/>
							<Anchors>
								<Anchor point="BOTTOMLEFT" y="-4"/>
								<Anchor point="BOTTOMRIGHT" y="-4"/>
							</Anchors>
						</Texture>
					</Layer>
					<Layer level="ARTWORK" textureSubLevel="2">
						<Texture parentKey="Emblem" file="Interface\AddOns\ConsolePort\Textures\Window\Menu-TopLine-Emblem.blp">
							<Size x="1024" y="16"/>
							<Anchors>
								<Anchor point="BOTTOM" y="-15"/>
							</Anchors>
						</Texture>
					</Layer>
				</Layers>
			</Frame>
		</Frames>
		<Layers>
			<Layer level="BACKGROUND" textureSubLevel="1">
				<Texture parentKey="BG" name="$parentBG" setAllPoints="true" hidden="true" inherits="CPUIMenuBackgroundStripTemplate"/>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="2">
				<Texture parentKey="Art" name="$parentArt" setAllPoints="true" hidden="true" desaturated="true" file="Interface\GLUES\LOADINGSCREENS\LoadingScreen_8xp_ForlornVictory_wide"/>
			</Layer>
		</Layers>
	</Frame>

</Ui>

