<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="EventAlert_Options.lua"/>

    <Frame name="EA_Options_Frame" toplevel="true" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true" parent="UIParent" enableKeyboard="true">

        <Size>
            <AbsDimension x="300" y="470"/>
        </Size>

        <Anchors>
            <Anchor point="CENTER"/>
        </Anchors>

        <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"/>
            </BackgroundInsets>
            <TileSize>
                <AbsValue val="32"/>
            </TileSize>
            <EdgeSize>
                <AbsValue val="32"/>
            </EdgeSize>
        </Backdrop>

        <Layers>

            <Layer level="ARTWORK">

                <Texture name="$parent_Header" file="Interface\DialogFrame\UI-DialogBox-Header">
                    <Size>
                        <AbsDimension x="350" y="64"/>
                    </Size>
                    <Anchors>
                        <Anchor point="TOP">
                            <Offset>
                                <AbsDimension x="0" y="12"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                </Texture>

                <FontString name="$parent_Header_Text" inherits="GameFontNormal" text="">
                    <Anchors>
                        <Anchor point="TOP" relativeTo="$parent_Header">
                            <Offset>
                                <AbsDimension x="0" y="-14"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                </FontString>

                <!-- <FontString name="$parent_VerUrlText" inherits="GameFontNormal" text="">
                    <Anchors>
                        <Anchor point="BOTTOM" relativeTo="$parent">
                            <Offset>
                                <AbsDimension x="-80" y="40"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                </FontString> -->

                <!-- <FontString name="$parent_VersionText" inherits="GameFontNormal" text="">
                    <Anchors>
                        <Anchor point="BOTTOM" relativeTo="$parent">
                            <Offset>
                                <AbsDimension x="100" y="40"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                </FontString> -->
            </Layer>

        </Layers>

        <Frames>
            <Button name="$parent_ToggleIconOptions" inherits="OptionsButtonTemplate" text="">
                <Anchors>
                    <Anchor point="TOP" relativeTo="$parent">
                        <Offset>
                            <AbsDimension x="0" y="-25"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Size>
		            <AbsDimension x="165" y="25"/>
        		</Size>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_ICONPOSOPT);
                    </OnLoad>
                    <OnClick>
                        PlaySound("gsTitleOptionOK");
                        EventAlert_Options_ToggleIconOptionsFrame();
                    </OnClick>
                </Scripts>
            </Button>

        	<CheckButton name="$parent_ShowFrame" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent">
                        <Offset>
                            <AbsDimension x="50" y="-60"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_ALTFRAME);
                    </OnLoad>
                    <OnClick>
                        if (this:GetChecked()) then
                            EA_Config.ShowFrame = true;
                        else
                            EA_Config.ShowFrame = false;
                        end
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_TTIP_SHOWFRAME);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>

        	<CheckButton name="$parent_ShowName" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_ShowFrame" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="0" y="0"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_BUFFNAME);
                    </OnLoad>
                    <OnClick>
                        if (this:GetChecked()) then
                            EA_Config.ShowName = true;
                        else
                            EA_Config.ShowName = false;
                        end
                        EventAlert_Icon_Options_Frame_PaintAlertFrame();
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_TTIP_SHOWNAME);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>

            <CheckButton name="$parent_ShowTimer" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_ShowName" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="0" y="0"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_TIMER);
                    </OnLoad>
                    <OnClick>
                        if (this:GetChecked()) then
                            EA_Config.ShowTimer = true;
                        else
                            EA_Config.ShowTimer = false;
                        end
                        EventAlert_Icon_Options_Frame_PaintAlertFrame();
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_TTIP_SHOWTIMER);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>

            <CheckButton name="$parent_ChangeTimer" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_ShowTimer" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="20" y="0"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_OMNICC);
                    </OnLoad>
                    <OnClick>
                        if (this:GetChecked()) then
                            EA_Config.ChangeTimer = true;
                        else
                            EA_Config.ChangeTimer = false;
                        end
                        EventAlert_Icon_Options_Frame_AdjustTimerFontSize();
                        EventAlert_Icon_Options_Frame_PaintAlertFrame();
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_TTIP_CHANGETIMER);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>

        	<CheckButton name="$parent_ShowFlash" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_ChangeTimer" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="-20" y="0"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_FULLFLASH);
                    </OnLoad>
                    <OnClick>
                        if (this:GetChecked()) then
                            EA_Config.ShowFlash = true;
                        else
                            EA_Config.ShowFlash = false;
                        end
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_TTIP_SHOWFLASH);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>

            <CheckButton name="$parent_DoAlertSound" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_ShowFlash" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="0" y="0"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_PLAY_SOUNDALERT);
                    </OnLoad>
                    <OnClick>
                        if (this:GetChecked()) then
                            EA_Config.DoAlertSound = true;
                        else
                            EA_Config.DoAlertSound = false;
                        end
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_TTIP_DOALERTSOUND);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>

            <CheckButton name="$parent_AlertSoundSelect" inherits="UIDropDownMenuTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_DoAlertSound" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="0" y="0"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                    	EventAlert_Options_AlertSoundSelect_OnLoad();
                    </OnLoad>
					<OnShow>
                    	EventAlert_Options_AlertSoundSelect_OnLoad();
                    </OnShow>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_TTIP_ALERTSOUNDSELECT);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>

            <CheckButton name="$parent_AllowESC" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_DoAlertSound" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="0" y="-30"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_ESC_CLOSEALERT);
                    </OnLoad>
                    <OnClick>
                        if (this:GetChecked()) then
                            EA_Config.AllowESC = true;
                        else
                            EA_Config.AllowESC = false;
                        end
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_TTIP_ALLOWESC);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>

        	<CheckButton name="$parent_AltAlerts" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_AllowESC" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="0" y="0"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_ALTERALERT);
                    </OnLoad>
                    <OnClick>
                        if (this:GetChecked()) then
                            EA_Config.AllowAltAlerts = true;
                            if (EA_Class_Events_Frame:IsVisible()) then
	                            EA_Alt_Alerts_Frame:Show();
                            end
                         else
                            EA_Config.AllowAltAlerts = false;
							EA_Alt_Alerts_Frame:Hide();
                        end
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_TTIP_ALTALERTS);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>
			
			<CheckButton name="$parent_SHOWSELF" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_AltAlerts" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="0" y="0"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_SHOWSELF);
                    </OnLoad>
                    <OnClick>
                        EventAlert_ShowVerBuff(1);
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_SHOWSELF);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>
			
			<CheckButton name="$parent_SHOWTARGET" inherits="OptionsCheckButtonTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT" relativeTo="$parent_SHOWSELF" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="0" y="0"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_SHOWTARGET);
                    </OnLoad>
                    <OnClick>
                        EventAlert_ShowVerBuff(2);
                    </OnClick>
                    <OnEnter>
                        GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
                        GameTooltip:SetText(EA_SHOWTARGET);
                    </OnEnter>
                    <OnLeave>
                        GameTooltip:Hide();
                    </OnLeave>
                </Scripts>
            </CheckButton>

            <Button name="$parent_ToggleClassEvents" inherits="OptionsButtonTemplate" text="">
                <Anchors>
                    <Anchor point="BOTTOM">
                        <Offset>
                            <AbsDimension x="0" y="100"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Size>
		            <AbsDimension x="175" y="25"/>
        		</Size>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_CLASSALERT);
                    </OnLoad>
                    <OnClick>
                        PlaySound("gsTitleOptionOK");
                        EventAlert_Options_ToggleClassEventsFrame();
                    </OnClick>
                </Scripts>
            </Button>

            <Button name="$parent_ToggleOtherEvents" inherits="OptionsButtonTemplate" text="">
                <Anchors>
                    <Anchor point="BOTTOM" relativeTo="$parent_ToggleClassEvents" relativePoint="BOTTOM">
                        <Offset>
                            <AbsDimension x="0" y="-25"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Size>
		            <AbsDimension x="175" y="25"/>
        		</Size>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_OTHERALERT);
                    </OnLoad>
                    <OnClick>
                        PlaySound("gsTitleOptionOK");
                        EventAlert_Options_ToggleOtherEventsFrame();
                    </OnClick>
                </Scripts>
            </Button>

            <Button name="$parent_ToggleTargetEvents" inherits="OptionsButtonTemplate" text="">
                <Anchors>
                    <Anchor point="BOTTOM" relativeTo="$parent_ToggleOtherEvents" relativePoint="BOTTOM">
                        <Offset>
                            <AbsDimension x="0" y="-25"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Size>
		            <AbsDimension x="175" y="25"/>
        		</Size>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_SHOW_TARGETALERT);
                    </OnLoad>
                    <OnClick>
                        PlaySound("gsTitleOptionOK");
                        EventAlert_Options_ToggleTargetEventsFrame();
                    </OnClick>
                </Scripts>
            </Button>

            <Button name="$parent_Okay" inherits="OptionsButtonTemplate" text="">
                <Anchors>
                    <Anchor point="BOTTOM">
                        <Offset>
                            <AbsDimension x="0" y="15"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Size>
		            <AbsDimension x="125" y="25"/>
        		</Size>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_XOPT_OKAY);
                    </OnLoad>
                    <OnClick>
                        PlaySound("gsTitleOptionOK");
                        HideUIPanel(EA_Options_Frame);
                        if EA_Anchor_Frame1 ~= nil then
	                        EA_Anchor_Frame1:Hide();
	                        EA_Anchor_Frame2:Hide();
	                        EA_Anchor_Frame3:Hide();
	                        EA_Anchor_Frame4:Hide();
	                        EA_Anchor_Frame5:Hide();
                        end
                    </OnClick>
                </Scripts>
            </Button>

            <!-- <Button name="$parent_ShowSelf" inherits="OptionsButtonTemplate" text="">
                <Anchors>
                    <Anchor point="BOTTOM" relativeTo="$parent_ToggleTargetEvents" relativePoint="BOTTOMLEFT">
                        <Offset>
                            <AbsDimension x="15" y="-25"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Size>
		            <AbsDimension x="125" y="25"/>
        		</Size>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_SHOWSELF);
                    </OnLoad>
                    <OnClick>
                    	EventAlert_ShowVerBuff(1);
                    </OnClick>
                </Scripts>
            </Button>

            <Button name="$parent_ShowTarget" inherits="OptionsButtonTemplate" text="">
                <Anchors>
                    <Anchor point="BOTTOM" relativeTo="$parent_ToggleTargetEvents" relativePoint="BOTTOMRIGHT">
                        <Offset>
                            <AbsDimension x="-15" y="-25"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <Size>
		            <AbsDimension x="125" y="25"/>
        		</Size>
                <Scripts>
                    <OnLoad>
                        getglobal(this:GetName().."Text"):SetText(EA_SHOWTARGET);
                    </OnLoad>
                    <OnClick>
                    	EventAlert_ShowVerBuff(2);
                    </OnClick>
                </Scripts>
            </Button> -->

        </Frames>

        <Scripts>
            <OnLoad>
	            this:RegisterForDrag("LeftButton");
                EventAlert_Options_OnLoad();
            </OnLoad>
            <OnHide>
                if EA_Anchor_Frame1 ~= nil then
                    EA_Anchor_Frame1:Hide();
                    EA_Anchor_Frame2:Hide();
                    EA_Anchor_Frame3:Hide();
                    EA_Anchor_Frame4:Hide();
                    EA_Anchor_Frame5:Hide();
                end
            </OnHide>
        	<OnMouseDown>
	        	EventAlert_Options_MouseDown(button);
	      	</OnMouseDown>
	      	<OnMouseUp>
	        	EventAlert_Options_MouseUp(button);
	      	</OnMouseUp>
        </Scripts>

    </Frame>

</Ui>