<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="ActionButton.lua"/>
	<Frame name="CheeseActionBarButtonSpellActivationAlert" virtual="true">
		<Animations>
			<AnimationGroup parentKey="animIn">
				<Animation inherits="CheeseScaleTemplate" duration="0.2" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.scaleX, self.scaleY = self:GetRegionParent():GetName().."Spark", 1.5, 1.5;
						</OnLoad>
						<OnPlay>
							local frame = self:GetRegionParent();
							local frameWidth, frameHeight = frame:GetSize();
							frame.spark:SetSize(frameWidth, frameHeight);
							frame.spark:SetAlpha(0.3)
							frame.innerGlow:SetSize(frameWidth / 2, frameHeight / 2);
							frame.innerGlow:SetAlpha(1.0);
							frame.innerGlowOver:SetAlpha(1.0);
							frame.outerGlow:SetSize(frameWidth * 2, frameHeight * 2);
							frame.outerGlow:SetAlpha(1.0);
							frame.outerGlowOver:SetAlpha(1.0);
							frame.ants:SetSize(frameWidth * 0.85, frameHeight * 0.85)
							frame.ants:SetAlpha(0);
							frame:Show();
						</OnPlay>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseAlphaTemplate" duration="0.2" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."Spark", 1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseScaleTemplate" duration="0.3" endDelay="1" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.scaleX, self.scaleY = self:GetRegionParent():GetName().."InnerGlow", 2, 2;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseScaleTemplate" duration="0.3" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.scaleX, self.scaleY = self:GetRegionParent():GetName().."InnerGlowOver", 2, 2;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseAlphaTemplate" duration="0.3" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."InnerGlowOver", -1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseScaleTemplate" duration="0.3" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.scaleX, self.scaleY = self:GetRegionParent():GetName().."OuterGlow", 0.5, 0.5;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseScaleTemplate" duration="0.3" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.scaleX, self.scaleY = self:GetRegionParent():GetName().."OuterGlowOver", 0.5, 0.5;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseAlphaTemplate" duration="0.3" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."OuterGlowOver", -1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseScaleTemplate" startDelay="0.2" duration="0.2" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.scaleX, self.scaleY = self:GetRegionParent():GetName().."Spark", 0.666666, 0.666666;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseAlphaTemplate" startDelay="0.2" duration="0.2" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."Spark", -1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseAlphaTemplate" startDelay="0.3" duration="0.2" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."InnerGlow", -1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseAlphaTemplate" startDelay="0.3" duration="0.2" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."Ants", 1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Scripts>
					<OnFinished>
						local frame = self:GetParent();
						local frameWidth, frameHeight = frame:GetSize();
						frame.spark:SetAlpha(0);
						frame.innerGlow:SetAlpha(0);
						frame.innerGlow:SetSize(frameWidth, frameHeight);
						frame.innerGlowOver:SetAlpha(0.0);
						frame.outerGlow:SetSize(frameWidth, frameHeight);
						frame.outerGlowOver:SetAlpha(0.0);
						frame.outerGlowOver:SetSize(frameWidth, frameHeight);
						frame.ants:SetAlpha(1.0);
					</OnFinished>
				</Scripts>
			</AnimationGroup>
			<AnimationGroup parentKey="animOut">
				<Animation inherits="CheeseAlphaTemplate" duration="0.2" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."OuterGlowOver", 1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseAlphaTemplate" duration="0.2" order="1">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."Ants", -1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseAlphaTemplate" duration="0.2" order="2">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."OuterGlowOver", -1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Animation inherits="CheeseAlphaTemplate" duration="0.2" order="2">
					<Scripts>
						<OnLoad>
							self.target, self.change = self:GetRegionParent():GetName().."OuterGlow", -1;
						</OnLoad>
					</Scripts>
				</Animation>
				<Scripts>
					<OnPlay>
						self.isPlaying = true;
					</OnPlay>
					<OnStop>
						self.isPlaying = false;
					</OnStop>
					<OnFinished>
						self.isPlaying = false;
						CheeseActionButton_OverlayGlowAnimOutFinished(self);
					</OnFinished>
				</Scripts>
			</AnimationGroup>
		</Animations>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentSpark" parentKey="spark" file="Interface\AddOns\Cheese\SpellActivationOverlay\IconAlert" alpha="0" setAllPoints="true">
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
					<TexCoords left="0.00781250" right="0.61718750" top="0.00390625" bottom="0.26953125"/>
				</Texture>
			</Layer>
			<Layer level="ARTWORK">
				<Texture name="$parentInnerGlow" parentKey="innerGlow" file="Interface\AddOns\Cheese\SpellActivationOverlay\IconAlert" alpha="0" setAllPoints="true">
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
					<TexCoords left="0.00781250" right="0.50781250" top="0.27734375" bottom="0.52734375"/>
				</Texture>
				<Texture name="$parentInnerGlowOver" parentKey="innerGlowOver" file="Interface\AddOns\Cheese\SpellActivationOverlay\IconAlert" alpha="0">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentInnerGlow" relativePoint="TOPLEFT"/>
						<Anchor point="BOTTOMRIGHT" relativeTo="$parentInnerGlow" relativePoint="BOTTOMRIGHT"/>
					</Anchors>
					<TexCoords left="0.00781250" right="0.50781250" top="0.53515625" bottom="0.78515625"/>
				</Texture>
				<Texture name="$parentOuterGlow" parentKey="outerGlow" file="Interface\AddOns\Cheese\SpellActivationOverlay\IconAlert" alpha="0" setAllPoints="true">
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
					<TexCoords left="0.00781250" right="0.50781250" top="0.27734375" bottom="0.52734375"/>
				</Texture>
				<Texture name="$parentOuterGlowOver" parentKey="outerGlowOver" file="Interface\AddOns\Cheese\SpellActivationOverlay\IconAlert" alpha="0">
					<Anchors>
						<Anchor point="TOPLEFT" relativeTo="$parentOuterGlow" relativePoint="TOPLEFT"/>
						<Anchor point="BOTTOMRIGHT" relativeTo="$parentOuterGlow" relativePoint="BOTTOMRIGHT"/>
					</Anchors>
					<TexCoords left="0.00781250" right="0.50781250" top="0.53515625" bottom="0.78515625"/>
				</Texture>
			</Layer>
			<Layer level="OVERLAY">
				<Texture name="$parentAnts" parentKey="ants" file="Interface\AddOns\Cheese\SpellActivationOverlay\IconAlertAnts" alpha="0" setAllPoints="true">
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
		<Scripts>
			<OnLoad>
				local _G = _G;
				do
					local animIn = self.animIn;
					local animations = { animIn:GetAnimations() };
					for i=1, #animations do
						local animation = animations[i];
						animation.target = _G[animation.target];
					end
				end
				do
					local animOut = self.animOut;
					local animations = { animOut:GetAnimations() };
					for i=1, #animations do
						local animation = animations[i];
						animation.target = _G[animation.target];
					end
				end
			</OnLoad>
			<OnUpdate>
				Cheese_AnimateTexCoords(self.ants, 256, 256, 48, 48, 22, elapsed, 0.01)
			</OnUpdate>
			<OnHide>
				if ( self.animOut:IsPlaying() ) then
					self.animOut:Stop();
					CheeseActionButton_OverlayGlowAnimOutFinished(self.animOut);
				end
			</OnHide>
		</Scripts>
	</Frame>
</Ui>
