<!--
    Spell Alert
        Author:         Awen  Modified by: Mithryn
-->

<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/
C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
	<Script file="localization.lua"/>
	<Script file="SpellAlert.lua"/>
	<CheckButton name="SA_RadioButtonTemplate" virtual="true">
		<Size>
			<AbsDimension x="20" y="20"/>
		</Size>
		<Layers>
			<Layer level="ARTWORK">
				<FontString inherits="GameFontNormalSmall" name="$parentName">
					<Anchors>
						<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent">
							<Offset>
								<AbsDimension x="0" y="0"/>
							</Offset>
						</Anchor>
					</Anchors>
					<Color r="1" g="1" b="1"/>
				</FontString>
			</Layer>
		</Layers>
		<NormalTexture name="$parentNormalTexture" file="Interface\Buttons\UI-RadioButton"> 
			<TexCoords left="0" right="0.25" top="0" bottom="1"/> 
		</NormalTexture>		
		<PushedTexture name="$parentPushedTexture" file="Interface\Buttons\UI-RadioButton"> 
			<TexCoords left="0.25" right="0.5" top="0" bottom="1"/> 
		</PushedTexture> 
		<HighlightTexture name="$parentHighlightTexture" file="Interface\Buttons\UI-RadioButton" alphaMode="ADD">
			<TexCoords left="0.51" right="0.75" top="0" bottom="1"/> 
		</HighlightTexture>
		<CheckedTexture name="$parentCheckedTexture" file="Interface\Buttons\UI-RadioButton"> 
			<TexCoords left="0.25" right="0.5" top="0" bottom="1"/> 
		</CheckedTexture> 
		<Scripts>
			<OnClick>
				SA_Radio_OnClick();
			</OnClick>
		</Scripts>
	</CheckButton>
	<Frame name="SAOptions" toplevel="true" frameStrata="LOW" movable="false" enableMouse="true" hidden="true" parent="UIParent">
		<Size>
			<AbsDimension x="400" y="550" />
		</Size>
		<Anchors>
			<Anchor point="CENTER" />
		</Anchors>
		<Layers>
			<Layer level="ARTWORK">
				<Texture name="SAFrameTitle" file="Interface\DialogFrame\UI-DialogBox-Header">
					<Size>
						<AbsDimension x="400" y="64" />
					</Size>
					<Anchors>
						<Anchor point="TOP">
							<Offset>
								<AbsDimension x="0" y="12" />
							</Offset>
						</Anchor>
					</Anchors>
				</Texture>
				<FontString inherits="GameFontNormal" text="SpellAlert Modified 1.4">
					<Anchors>
						<Anchor point="TOP" relativeTo="SAOptions">
							<Offset>
								<AbsDimension x="0" y="-3" />
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
			<BackgroundInsets>
				<AbsInset left="11" right="12" top="12" bottom="11" />	
				<Size>
					<AbsDimension x="128" y="17" />
				</Size>
			</BackgroundInsets>
			<TileSize>
				<AbsValue val="32" />
			</TileSize>
			<EdgeSize>
				<AbsValue val="32" />
			</EdgeSize>
		</Backdrop>
		<Frames>
			<CheckButton name="SAOptionsEnable" inherits="OptionsCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAFrameTitle" relativePoint="left">
						<Offset>
							<AbsDimension x="30" y="-40" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Enable Spell Alert");
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="SAOptionsTargetOnly" inherits="OptionsCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAOptionsEnable" relativePoint="left">
						<Offset>
							<AbsDimension x="0" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Alerts spells from the selected target only.");
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="SAOptionsHeals" inherits="OptionsCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAOptionsTargetOnly" relativePoint="left">
						<Offset>
							<AbsDimension x="0" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Alert healing spells");
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="SAOptionsCC" inherits="OptionsCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAOptionsHeals" relativePoint="left">
						<Offset>
							<AbsDimension x="0" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Alert crowd control spells");
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="SAOptionsDispelable" inherits="OptionsCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAOptionsCC" relativePoint="left">
						<Offset>
							<AbsDimension x="0" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Alert dispelable abilities");
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="SAOptionsDamage" inherits="OptionsCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAOptionsDispelable" relativePoint="left">
						<Offset>
							<AbsDimension x="0" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Alert damage spells");
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="SAOptionsMisc" inherits="OptionsCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAOptionsDamage" relativePoint="left">
						<Offset>
							<AbsDimension x="0" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Alert other spell/abilities");
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="SAOptionsEmote" inherits="OptionsCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAOptionsMisc" relativePoint="left">
						<Offset>
							<AbsDimension x="0" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Enable Emote");
					</OnLoad>
				</Scripts>
			</CheckButton>
			<CheckButton name="SAOptionsRetarget" inherits="OptionsCheckButtonTemplate">
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAOptionsEmote" relativePoint="left">
						<Offset>
							<AbsDimension x="0" y="-30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Retarget after Fear/Scattor Shot/Feign Death effect");
					</OnLoad>
				</Scripts>
			</CheckButton>

			<Frame name="SAColorLabel">
                <Size>
                    <AbsDimension x="200" y="16"/>
                </Size>
                <Anchors>
                    <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" relativeTo="SAOptionsRetarget">
                        <Offset>
                            <AbsDimension x="0" y="-30"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Layers>
                    <Layer level="BACKGROUND">
                        <FontString inherits="GameFontNormalSmall" text="Alert text colors">
                            <Anchors>
                                <Anchor point="TOPLEFT">
                                    <Offset>
                                        <AbsDimension x="0" y="-20"/>
                                    </Offset>
                                </Anchor>
                            </Anchors>
                        </FontString>                           
                    </Layer>
				</Layers>
			</Frame>

			<Frame name="SARadioLabels">
                <Size>
                    <AbsDimension x="200" y="16"/>
                </Size>
                <Anchors>
                    <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" relativeTo="SAColorLabel">
                        <Offset>
                            <AbsDimension x="44" y="-25"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Layers>
                    <Layer level="BACKGROUND">
                        <FontString inherits="GameFontNormalSmall" text="All                 All except spell           Only spell">
                            <Anchors>
                                <Anchor point="TOPLEFT">
                                    <Offset>
                                        <AbsDimension x="0" y="-25"/>
                                    </Offset>
                                </Anchor>
                            </Anchors>
                        </FontString>                           
                    </Layer>
				</Layers>
			</Frame>

			<CheckButton name="$parentRadio1" id="1" inherits="SA_RadioButtonTemplate"> <!-- Color all -->
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAColorLabel" relativePoint="left">
						<Offset>
							<AbsDimension x="43" y="-50"/>
						</Offset>
					</Anchor>
				</Anchors>
			</CheckButton>
			<CheckButton name="$parentRadio2" id="2" inherits="SA_RadioButtonTemplate"> <!-- Color except spell -->
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentRadio1" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="90" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</CheckButton>
			<CheckButton name="$parentRadio3" id="3" inherits="SA_RadioButtonTemplate"> <!-- Color only spell -->
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentRadio2" relativePoint="RIGHT">
						<Offset>
							<AbsDimension x="90" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
			</CheckButton>

			<Frame name="SAColorLabels">
                <Size>
                    <AbsDimension x="200" y="16"/>
                </Size>
                <Anchors>
                    <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" relativeTo="SAColorLabel">
                        <Offset>
                            <AbsDimension x="30" y="-60"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Layers>
                    <Layer level="BACKGROUND">
                        <FontString inherits="GameFontNormalSmall" text="Hostile      Heal         Buff       Emote      Totem">
                            <Anchors>
                                <Anchor point="TOPLEFT">
                                    <Offset>
                                        <AbsDimension x="0" y="-25"/>
                                    </Offset>
                                </Anchor>
                            </Anchors>
                        </FontString>                           
                    </Layer>
				</Layers>
			</Frame>

			<Button name="SAat">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAColorLabels" relativePoint="left">
						<Offset>
							<AbsDimension x="15" y="-40" />
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="SAat_SwatchBg">
							<Size>
								<AbsDimension x="14" y="14"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
							<Color r="1.0" g="1.0" b="1.0"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnClick>
						SpellAlert_OpenColorPicker(this:GetParent(), 0);
					</OnClick>
					<OnEnter>
						getglobal("SAat_SwatchBg"):SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
					</OnEnter>
					<OnLeave>
						getglobal("SAat_SwatchBg"):SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
					</OnLeave>
				</Scripts>
				<NormalTexture name="SAat_NormalTexture" file="Interface\ChatFrame\ChatFrameColorSwatch"/>
			</Button>

			<Button name="SAhe">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAat" relativePoint="left">
						<Offset>
							<AbsDimension x="55" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="SAhe_SwatchBg">
							<Size>
								<AbsDimension x="14" y="14"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
							<Color r="1.0" g="1.0" b="1.0"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnClick>
						SpellAlert_OpenColorPicker(this:GetParent(), 1);
					</OnClick>
					<OnEnter>
						getglobal("SAhe_SwatchBg"):SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
					</OnEnter>
					<OnLeave>
						getglobal("SAhe_SwatchBg"):SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
					</OnLeave>
				</Scripts>
				<NormalTexture name="SAhe_NormalTexture" file="Interface\ChatFrame\ChatFrameColorSwatch"/>
			</Button>

			<Button name="SAbu">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAhe" relativePoint="left">
						<Offset>
							<AbsDimension x="55" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="SAbu_SwatchBg">
							<Size>
								<AbsDimension x="14" y="14"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
							<Color r="1.0" g="1.0" b="1.0"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnClick>
						SpellAlert_OpenColorPicker(this:GetParent(), 2);
					</OnClick>
					<OnEnter>
						getglobal("SAbu_SwatchBg"):SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
					</OnEnter>
					<OnLeave>
						getglobal("SAbu_SwatchBg"):SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
					</OnLeave>
				</Scripts>
				<NormalTexture name="SAbu_NormalTexture" file="Interface\ChatFrame\ChatFrameColorSwatch"/>
			</Button>

			<Button name="SAem">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAbu" relativePoint="left">
						<Offset>
							<AbsDimension x="55" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="SAem_SwatchBg">
							<Size>
								<AbsDimension x="14" y="14"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
							<Color r="1.0" g="1.0" b="1.0"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnClick>
						SpellAlert_OpenColorPicker(this:GetParent(), 3);
					</OnClick>
					<OnEnter>
						getglobal("SAem_SwatchBg"):SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
					</OnEnter>
					<OnLeave>
						getglobal("SAem_SwatchBg"):SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
					</OnLeave>
				</Scripts>
				<NormalTexture name="SAem_NormalTexture" file="Interface\ChatFrame\ChatFrameColorSwatch"/>
			</Button>

			<Button name="SAto">
				<Size>
					<AbsDimension x="16" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAem" relativePoint="left">
						<Offset>
							<AbsDimension x="55" y="0" />
						</Offset>
					</Anchor>
				</Anchors>
				<Layers>
					<Layer level="BACKGROUND">
						<Texture name="SAto_SwatchBg">
							<Size>
								<AbsDimension x="14" y="14"/>
							</Size>
							<Anchors>
								<Anchor point="CENTER">
									<Offset>
										<AbsDimension x="0" y="0"/>
									</Offset>
								</Anchor>
							</Anchors>
							<Color r="1.0" g="1.0" b="1.0"/>
						</Texture>
					</Layer>
				</Layers>
				<Scripts>
					<OnClick>
						SpellAlert_OpenColorPicker(this:GetParent(), 4);
					</OnClick>
					<OnEnter>
						getglobal("SAto_SwatchBg"):SetVertexColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
					</OnEnter>
					<OnLeave>
						getglobal("SAto_SwatchBg"):SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
					</OnLeave>
				</Scripts>
				<NormalTexture name="SAto_NormalTexture" file="Interface\ChatFrame\ChatFrameColorSwatch"/>
			</Button>

			<Slider name="SASizeSlider" inherits="OptionsSliderTemplate">
				<Size>
					<AbsDimension x="240" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="SAColorLabel" relativePoint="left">
						<Offset>
							<AbsDimension x="45" y="-120" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Alert size");
						getglobal(this:GetName().."High"):SetText("Big");
						getglobal(this:GetName().."Low"):SetText("Small");
						SASizeSlider:SetMinMaxValues(15,37);
						SASizeSlider:SetValueStep(1);
					</OnLoad>
					<OnValueChanged>
						SAConfig.zoom = SASizeSlider:GetValue();
						SpellAlert_UpdatePosition();
					</OnValueChanged>
				</Scripts>
			</Slider>

			<Slider name="SAPosSlider" inherits="OptionsSliderTemplate">
				<Size>
					<AbsDimension x="240" y="16"/>
				</Size>
				<Anchors>
					<Anchor point="LEFT" relativeTo="SASizeSlider" relativePoint="left">
						<Offset>
							<AbsDimension x="0" y="-45" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						getglobal(this:GetName().."Text"):SetText("Alert text position");
						getglobal(this:GetName().."High"):SetText("Near Top");
						getglobal(this:GetName().."Low"):SetText("Near Bottom");
						SAPosSlider:SetMinMaxValues(-1080,80);
						SAPosSlider:SetValueStep(10);
					</OnLoad>
					<OnValueChanged>
						SAConfig.pos = SAPosSlider:GetValue();
						SpellAlert_UpdatePosition();
					</OnValueChanged>
				</Scripts>
			</Slider>

			<Button name="SAOptionsSave" inherits="GameMenuButtonTemplate" text="CLOSE">
				<Anchors>
					<Anchor point="CENTER" relativePoint="BOTTOM" relativeTo="SAOptions">
						<Offset>
							<AbsDimension x="0" y="30" />
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnClick>
						SpellAlert_OptionsClose();
					</OnClick>
				</Scripts>
			</Button>
		</Frames>
	</Frame>

	<MessageFrame name="AlertFrame" insertMode="TOP" parent="UIParent" frameStrata="HIGH" toplevel="true">
		<Size>
			<AbsDimension x="3000" y="200"/>
		</Size>
		<Anchors>
			<Anchor point="TOP">
				<Offset>
					<AbsDimension x="0" y="0"/>
				</Offset>
			</Anchor>
		</Anchors>
		<Layers>
			<Layer level="ARTWORK">
				<FontString name="AlertFrameText" inherits="ZoneTextFont">
					<Size>
						<AbsDimension x="1200" y="0"/>
					</Size>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
            <OnLoad>
                SpellAlert_OnLoad();
            </OnLoad>
            <OnEvent>
                SpellAlert_OnEvent();
            </OnEvent>
			<OnUpdate>
				SpellAlert_OnUpdate();
			</OnUpdate>
		</Scripts>
	</MessageFrame>

</Ui>
