<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/
..\FrameXML\UI.xsd">
  <Script file="EclipseBarFrame.lua"/>


<!--size=256,128
	<Texture name="EclipseBarActivate_Moon.png" >
		<Size x="140" y="38"/>
		<TexCoords left="0.00390625" right="0.55078125" top="0.00781250" bottom="0.30468750"/>
	</Texture>
	<Texture name="EclipseBarActivate_Sun.png" >
		<Size x="140" y="38"/>
		<TexCoords left="0.00390625" right="0.55078125" top="0.32031250" bottom="0.61718750"/>
	</Texture>
	<Texture name="EclipseBarFrame.png" >
		<Size x="140" y="38"/>	
		<TexCoords left="0.00390625" right="0.55078125" top="0.63281250" bottom="0.92968750"/>
	</Texture>
	<Texture name="Icon_Sun_Large.png" >
		<Size x="43" y="45"/>
		<TexCoords left="0.55859375" right="0.72656250" top="0.00781250" bottom="0.35937500"/>
	</Texture>
	<Texture name="Icon_Moon_Large.png" >
		<Size x="43" y="45"/>
		<TexCoords left="0.73437500" right="0.90234375" top="0.00781250" bottom="0.35937500"/>
	</Texture>
	<Texture name="EclipseSlider.png" >
		<Size x="10" y="20"/>
		<TexCoords left="0.91015625" right="0.94921875" top="0.00781250" bottom="0.16406250"/>
	</Texture>
	<Texture name="Icon_Moon_dark.png" >
		<Size x="23" y="23"/>
		<TexCoords left="0.55859375" right="0.64843750" top="0.37500000" bottom="0.55468750"/>
	</Texture>
	<Texture name="Icon_Moon_reg.png" >
		<Size x="23" y="23"/>
		<TexCoords left="0.55859375" right="0.64843750" top="0.57031250" bottom="0.75000000"/>
	</Texture>
	<Texture name="Icon_Sun_dark.png" >
		<Size x="23" y="23"/>
		<TexCoords left="0.55859375" right="0.64843750" top="0.76562500" bottom="0.94531250"/>
	</Texture>
	<Texture name="Icon_Sun_reg.png" >
		<Size x="23" y="23"/>
		<TexCoords left="0.65625000" right="0.74609375" top="0.37500000" bottom="0.55468750"/>
	</Texture>
-->
  

	<Frame name="EclipseBarFrame" parent="PlayerFrame" frameStrata="LOW" toplevel="true" hidden="true">
		<Animations>
			<AnimationGroup looping="REPEAT" parentKey="pulse">
				<Scale target="$parentGlow" scaleX="1.08" scaleY="1.08" duration="0.5" smoothing="IN_OUT" order="1"/>
				<Scale target="$parentGlow" scaleX="0.9259" scaleY="0.9259" duration="0.5" smoothing="IN_OUT" order="2"/>
			</AnimationGroup>
			<AnimationGroup parentKey="sunActivate">
				<Alpha target="$parentSunBar" 		change="1" duration="0.6" order="1"/>
				<Alpha target="$parentGlow" 		change="1" duration="0.6" order="1"/>
				<Alpha target="$parentDarkMoon" 	change="1" duration="0.6" order="1"/>
				<Scripts>
					<OnPlay>
						self:GetParent().MoonBar:SetAlpha(0);
						self:GetParent().DarkSun:SetAlpha(0);
					</OnPlay>
					<OnFinished>
						self:GetParent().SunBar:SetAlpha(1);
						self:GetParent().Glow:SetAlpha(1);
						self:GetParent().DarkMoon:SetAlpha(1);
						self:GetParent().MoonCover:SetAlpha(1);
						self:GetParent().pulse:Play();
					</OnFinished>
				</Scripts>
			</AnimationGroup>
			<AnimationGroup parentKey="sunDeactivate">
				<Alpha target="$parentSunBar"		change="-1" duration="2" order="1"/>
				<Alpha target="$parentGlow" 		change="-1" duration="2" order="1"/>
				<Alpha target="$parentDarkMoon"		change="-1" duration="2" order="1"/>
				<Alpha target="$parentMoonCover"	change="-1" duration="2" order="1"/>
				<Scripts>
					<OnPlay>
						self:GetParent().pulse:Stop();
					</OnPlay>
					<OnFinished>
						self:GetParent().SunBar:SetAlpha(0);
						self:GetParent().Glow:SetAlpha(0);
						self:GetParent().DarkMoon:SetAlpha(0);
						self:GetParent().MoonCover:SetAlpha(0);
					</OnFinished>
				</Scripts>
			</AnimationGroup>
			<AnimationGroup parentKey="switchToSun">
				<Alpha target="$parentMoonBar"		change="-1" duration="0.5" order="1"/>
				<Alpha target="$parentGlow" 		change="-1" duration="0.5" order="1"/>
				<Alpha target="$parentDarkSun"		change="-1" duration="0.5" order="1"/>
				<Alpha target="$parentSunCover"		change="-1" duration="0.5" order="1"/>
				<Alpha target="$parentSunBar" 		change="1" duration="0.5" order="2"/>
				<Alpha target="$parentGlow" 		change="1" duration="0.5" order="2"/>
				<Alpha target="$parentDarkMoon" 	change="1" duration="0.5" order="2"/>
				<Alpha target="$parentMoonCover"	change="1" duration="0.5" order="2"/>
				<Scripts>
					<OnPlay>
						self:GetParent().Glow:SetAlpha(0);
						self:GetParent().MoonCover:SetAlpha(0);
					</OnPlay>
					<OnFinished>
						self:GetParent().MoonBar:SetAlpha(0);
						self:GetParent().DarkSun:SetAlpha(0);
						self:GetParent().SunCover:SetAlpha(0);
						self:GetParent().SunBar:SetAlpha(1);
						self:GetParent().Glow:SetAlpha(1);
						self:GetParent().DarkMoon:SetAlpha(1);
						self:GetParent().MoonCover:SetAlpha(1);
						self:GetParent().pulse:Play();
					</OnFinished>
				</Scripts>
			</AnimationGroup>
			<AnimationGroup parentKey="moonActivate">
				<Alpha target="$parentMoonBar" 	change="1" duration="0.6" order="1"/>
				<Alpha target="$parentGlow" 	change="1" duration="0.6" order="1"/>
				<Alpha target="$parentDarkSun" 	change="1" duration="0.6" order="1"/>
				<Scripts>
					<OnPlay>
						self:GetParent().SunBar:SetAlpha(0);
						self:GetParent().DarkMoon:SetAlpha(0);
					</OnPlay>
					<OnFinished>
						self:GetParent().MoonBar:SetAlpha(1);
						self:GetParent().Glow:SetAlpha(1);
						self:GetParent().DarkSun:SetAlpha(1);
						self:GetParent().SunCover:SetAlpha(1);
						self:GetParent().pulse:Play();
					</OnFinished>
				</Scripts>
			</AnimationGroup>
			<AnimationGroup parentKey="moonDeactivate">
				<Alpha target="$parentMoonBar" 	change="-1" duration="2" order="1"/>
				<Alpha target="$parentGlow" 	change="-1" duration="2" order="1"/>
				<Alpha target="$parentDarkSun" 	change="-1" duration="2" order="1"/>
				<Alpha target="$parentSunCover" change="-1" duration="2" order="1"/>
				<Scripts>
					<OnPlay>
						self:GetParent().pulse:Stop();
					</OnPlay>
					<OnFinished>
						self:GetParent().MoonBar:SetAlpha(0);
						self:GetParent().Glow:SetAlpha(0);
						self:GetParent().DarkSun:SetAlpha(0);
						self:GetParent().SunCover:SetAlpha(0);
					</OnFinished>
				</Scripts>
			</AnimationGroup>
			<AnimationGroup parentKey="switchToMoon">
				<Alpha target="$parentSunBar"		change="-1" duration="0.5" order="1"/>
				<Alpha target="$parentDarkMoon"		change="-1" duration="0.5" order="1"/>
				<Alpha target="$parentMoonCover"		change="-1" duration="0.5" order="1"/>
				<Alpha target="$parentMoonBar" 		change="1" duration="0.5" order="2"/>
				<Alpha target="$parentGlow" 		change="1" duration="0.5" order="2"/>
				<Alpha target="$parentDarkSun" 	change="1" duration="0.5" order="2"/>
				<Alpha target="$parentSunCover"	change="1" duration="0.5" order="2"/>
				<Scripts>
					<OnPlay>
						self:GetParent().Glow:SetAlpha(0);
						self:GetParent().SunCover:SetAlpha(0);
					</OnPlay>
					<OnFinished>
						self:GetParent().SunBar:SetAlpha(0);
						self:GetParent().DarkMoon:SetAlpha(0);
						self:GetParent().MoonCover:SetAlpha(0);
						self:GetParent().MoonBar:SetAlpha(1);
						self:GetParent().Glow:SetAlpha(1);
						self:GetParent().DarkSun:SetAlpha(1);
						self:GetParent().SunCover:SetAlpha(1);
						self:GetParent().pulse:Play();
					</OnFinished>
				</Scripts>
			</AnimationGroup>
		</Animations>
		<Size x="140" y="38"/>
		<Anchors>
		  <Anchor point="TOP" relativeTo="PlayerFrame" relativePoint="BOTTOM">
			<Offset>
			  <AbsDimension x="48" y="40"/>
			</Offset>
		  </Anchor>
		</Anchors>
		<HitRectInsets>
			<AbsInset left="4" right="4" top="6" bottom="6"/>
		</HitRectInsets>
		<Layers>
			<Layer level="ARTWORK">
				<Texture name="$parentBar" atlas="DruidEclipse-BaseBar" useAtlasSize="true">
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND">
				<Texture parentKey="Sun" name="$parentSun" atlas="DruidEclipse-BaseSun" useAtlasSize="true">
					<Anchors>
						<Anchor point="CENTER" relativeTo="$parentBar"  relativePoint="RIGHT" x="-17" y="1"/>
					</Anchors>
				</Texture>
				<Texture parentKey="Moon" name="$parentMoon" atlas="DruidEclipse-BaseMoon" useAtlasSize="true">
					<Anchors>
						<Anchor point="CENTER" relativeTo="$parentBar" relativePoint="LEFT" x="17" y="1"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="BACKGROUND" textureSubLevel="1">
				<Texture parentKey="DarkSun" name="$parentDarkSun" atlas="DruidEclipse-LunarSun" useAtlasSize="true">
					<Anchors>
						<Anchor point="CENTER" relativeTo="$parentSun"/>
					</Anchors>
				</Texture>
				<Texture parentKey="DarkMoon" name="$parentDarkMoon" atlas="DruidEclipse-SolarMoon" useAtlasSize="true">
					<Anchors>
						<Anchor point="CENTER" relativeTo="$parentMoon"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="ARTWORK" textureSubLevel="1">
				<Texture parentKey="SunBar" name="$parentSunBar" atlas="DruidEclipse-SolarBar" useAtlasSize="true">
					<Anchors>
						<Anchor point="CENTER" x="15"/>
					</Anchors>
				</Texture>
				<Texture parentKey="MoonBar" name="$parentMoonBar" atlas="DruidEclipse-LunarBar" useAtlasSize="true">
					<Anchors>
						<Anchor point="CENTER" x="-15"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="OVERLAY" textureSubLevel="-1">
				<Texture parentKey="MoonCover" name="$parentMoonCover" atlas="DruidEclipse-SolarCover" useAtlasSize="true" hidden="true">
					<Anchors>
						<Anchor point="LEFT" x="20" y="1"/>
					</Anchors>
				</Texture>
				<Texture parentKey="SunCover" name="$parentSunCover" atlas="DruidEclipse-LunarCover" useAtlasSize="true" hidden="true">
					<Anchors>
						<Anchor point="RIGHT" x="-30"/>
					</Anchors>
				</Texture>
			</Layer>
			<Layer level="OVERLAY">
				<Texture parentKey="Marker" name="$parentMarker" atlas="DruidEclipse-Arrow" useAtlasSize="true" alphaMode="ADD">
					<Anchors>
						<Anchor point="CENTER" y="2"/>
					</Anchors>
				</Texture>
				<Texture parentKey="Glow" name="$parentGlow" atlas="DruidEclipse-SolarSun">
					<Size x="43" y="45"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
				<FontString name="$parentPowertext" inherits="TextStatusBarText" justifyH="CENTER" parentKey="PowerText" hidden="true">
					<Anchors>
						<Anchor point="CENTER" x="0" y="0"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnEnter>
				self.PowerText:Show();
				GameTooltip_SetDefaultAnchor(GameTooltip, self);
				GameTooltip:SetText(BALANCE, 1, 1, 1);
				GameTooltip:AddLine(BALANCE_TOOLTIP, nil, nil, nil, true);
				GameTooltip:Show();
			</OnEnter>
			<OnLeave>
				if not self.lockShow then
					self.PowerText:Hide();
				end
				GameTooltip:Hide();
			</OnLeave>
			<OnLoad function="EclipseBar_OnLoad"/>
			<OnShow function="EclipseBar_OnShow"/>
			<OnEvent function="EclipseBar_OnEvent"/>
			<OnUpdate function="EclipseBar_Update"/>
		</Scripts>
	</Frame>
</Ui>