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

    <CheckButton name="MegaDamage_CheckBoxTemplate" inherits="UICheckButtonTemplate" virtual="true">
        <HitRectInsets>
            <AbsInset bottom="0" left="0" right="-100" top="0"/>
        </HitRectInsets>
        <Scripts>
            <OnClick>
                MegaDamageConfig_CheckBox_OnClick(self, self:GetID());
                if (self:GetChecked()) then
                PlaySound("igMainMenuOptionCheckBoxOff");
                else
                PlaySound("igMainMenuOptionCheckBoxOn");
                end
            </OnClick>
            <OnEnter>
                MegaDamageConfig_Option_OnEnter(self);
            </OnEnter>
            <OnLeave>
                MegaDamageConfig_Option_OnLeave(self);
            </OnLeave>
        </Scripts>
    </CheckButton>

    <Slider name="MegaDamage_SliderTemplate" inherits="OptionsSliderTemplate" virtual="true">
        <Size>
            <AbsDimension x="305" y="20"/>
        </Size>
        <Layers>
            <Layer level="BACKGROUND">
                <FontString name="$parentText1" inherits="GameFontNormalSmall">
                    <Color r="1.0" g="1.0" b="1.0"/>
                    <Anchors>
                        <Anchor point="BOTTOM" relativePoint="TOP">
                            <Offset>
                                <AbsDimension x="0" y="2"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                </FontString>
                <FontString name="$parentText2" inherits="GameFontNormalSmall">
                    <Anchors>
                        <Anchor point="CENTER">
                            <Offset>
                                <AbsDimension x="0" y="-15"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                </FontString>
            </Layer>
        </Layers>
        <Scripts>
            <OnEnter>
                MegaDamageConfig_Option_OnEnter(self);
            </OnEnter>
            <OnLeave>
                MegaDamageConfig_Option_OnLeave(self);
            </OnLeave>
        </Scripts>
    </Slider>

    <Frame name="MegaDamage_ContainerTemplate" virtual="true">
        <Size>
            <AbsDimension x="100" y="20"/>
        </Size>
        <Layers>
            <Layer level="ARTWORK">
                <FontString name="$parentTitle" inherits="GameFontNormal">
                    <Anchors>
                        <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
                            <Offset x="10" y="0"/>
                        </Anchor>
                    </Anchors>
                </FontString>
            </Layer>
        </Layers>
        <Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
            <BorderColor r="0.5" g="0.5" b="0.5"/>
            <Color r="0.25" g="0.25" b="0.25" a="0.5"/>
            <BackgroundInsets>
                <AbsInset left="3" right="3" top="3" bottom="3"/>
            </BackgroundInsets>
            <TileSize>
                <AbsValue val="16"/>
            </TileSize>
            <EdgeSize>
                <AbsValue val="16"/>
            </EdgeSize>
        </Backdrop>
    </Frame>

    <Frame name="MegaDamageConfigContainer">
        <Layers>
            <Layer level="BACKGROUND">
                <Texture name="$parentBackground">
                    <Size>
                        <AbsDimension x="1" y="1"/>
                    </Size>
                    <Anchors>
                        <Anchor point="TOPLEFT">
                            <Offset>
                                <AbsDimension x="5" y="-5"/>
                            </Offset>
                        </Anchor>
                        <Anchor point="BOTTOMRIGHT">
                            <Offset>
                                <AbsDimension x="-5" y="5"/>
                            </Offset>
                        </Anchor>
                    </Anchors>
                    <Color r="0" g="0" b="0" a="0.75"/>
                </Texture>
            </Layer>
        </Layers>
        <Frames>
            <ScrollFrame name="$parentScroll" inherits="UIPanelScrollFrameTemplate">
                <Anchors>
                    <Anchor point="TOPLEFT">
                        <Offset>
                            <AbsDimension x="5" y="-5"/>
                        </Offset>
                    </Anchor>
                    <Anchor point="BOTTOMRIGHT">
                        <Offset>
                            <AbsDimension x="-28" y="5"/>
                        </Offset>
                    </Anchor>
                </Anchors>
                <ScrollChild>
                    <Frame name="MegaDamageConfig">
                        <Size>
                            <AbsDimension x="600" y="555"/>
                        </Size>
                        <Layers>
                            <Layer level="ARTWORK">
                                <FontString name="$parentTitle" inherits="GameFontNormalLarge">
                                    <Anchors>
                                        <Anchor point="TOPLEFT">
                                            <Offset>
                                                <AbsDimension x="20" y="-20"/>
                                            </Offset>
                                        </Anchor>
                                    </Anchors>
                                </FontString>
                            </Layer>
                        </Layers>
                        <Frames>
                            <Frame name="$parent_SoundOptions" inherits="MegaDamage_ContainerTemplate">
                                <Anchors>
                                    <Anchor point="TOPLEFT">
                                        <Offset x="20" y="-70"/>
                                    </Anchor>
                                    <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT">
                                        <Offset x="-20" y="-190"/>
                                    </Anchor>
                                </Anchors>
                                <Layers>
                                    <Layer level="ARTWORK">
                                        <FontString name="$parent_DamageSoundLabel" inherits="GameFontNormal" justifyH="LEFT">
                                            <Anchors>
                                                <Anchor point="TOPLEFT">
                                                    <Offset>
                                                        <AbsDimension x="15" y="-50"/>
                                                    </Offset>
                                                </Anchor>
                                            </Anchors>
                                        </FontString>
                                        <FontString name="$parent_HealingSoundLabel" inherits="GameFontNormal" justifyH="LEFT">
                                            <Anchors>
                                                <Anchor point="TOPLEFT" relativeTo="$parent_DamageSoundLabel" relativePoint="BOTTOMLEFT">
                                                    <Offset>
                                                        <AbsDimension x="0" y="-20"/>
                                                    </Offset>
                                                </Anchor>
                                            </Anchors>
                                        </FontString>
                                    </Layer>
                                </Layers>
                                <Frames>
                                    <CheckButton name="$parent_Enable" id="1" inherits="MegaDamage_CheckBoxTemplate">
                                        <Anchors>
                                            <Anchor point="TOPLEFT">
                                                <Offset>
                                                    <AbsDimension x="10" y="-10"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                    </CheckButton>

                                    <Button name="$parent_DamageSoundSelect" inherits="UIDropDownMenuTemplate" id="1">
                                        <Anchors>
                                            <Anchor point="TOPLEFT">
                                                <Offset x="180" y="-40"/>
                                            </Anchor>
                                        </Anchors>
                                        <Scripts>
                                            <OnClick>
                                                MegaDamageConfig_DropDown_OnClick(self);
                                            </OnClick>
                                        </Scripts>
                                    </Button>
                                    <Button name="$parent_DamageSoundPreview" inherits="GameMenuButtonTemplate">
                                        <Size>
                                            <AbsDimension x="70" y="24"/>
                                        </Size>
                                        <Anchors>
                                            <Anchor point="LEFT" relativeTo="$parent_DamageSoundSelect" relativePoint="RIGHT">
                                                <Offset>
                                                    <AbsDimension x="0" y="2"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                        <Scripts>
                                            <OnClick>
                                                PlaySound("gsTitleOptionOK");
                                                MegaDamageConfig_PreviewSound(0);
                                            </OnClick>
                                        </Scripts>
                                    </Button>

                                    <Button name="$parent_HealingSoundSelect" inherits="UIDropDownMenuTemplate" id="2">
                                        <Anchors>
                                            <Anchor point="TOP" relativeTo="$parent_DamageSoundSelect" relativePoint="BOTTOM">
                                                <Offset x="0" y="-2"/>
                                            </Anchor>
                                        </Anchors>
                                        <Scripts>
                                            <OnClick>
                                                MegaDamageConfig_DropDown_OnClick(self);
                                            </OnClick>
                                        </Scripts>
                                    </Button>
                                    <Button name="$parent_HealingSoundPreview" inherits="GameMenuButtonTemplate">
                                        <Size>
                                            <AbsDimension x="70" y="24"/>
                                        </Size>
                                        <Anchors>
                                            <Anchor point="LEFT" relativeTo="$parent_HealingSoundSelect" relativePoint="RIGHT">
                                                <Offset>
                                                    <AbsDimension x="0" y="2"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                        <Scripts>
                                            <OnClick>
                                                PlaySound("gsTitleOptionOK");
                                                MegaDamageConfig_PreviewSound(1);
                                            </OnClick>
                                        </Scripts>
                                    </Button>
                                </Frames>
                            </Frame>

                            <Frame name="$parent_FrameOptions" inherits="MegaDamage_ContainerTemplate">
                                <Anchors>
                                    <Anchor point="TOPLEFT" relativeTo="$parent_SoundOptions" relativePoint="BOTTOMLEFT">
                                        <Offset x="0" y="-20"/>
                                    </Anchor>
                                    <Anchor point="BOTTOMRIGHT" relativeTo="$parent_SoundOptions" relativePoint="BOTTOMRIGHT">
                                        <Offset x="0" y="-130"/>
                                    </Anchor>
                                </Anchors>
                                <Frames>
                                    <Slider id="1" name="$parent_Scale" minValue="5" maxValue="15" valueStep="1" inherits="MegaDamage_SliderTemplate">
                                        <Anchors>
                                            <Anchor point="TOPLEFT">
                                                <Offset>
                                                    <AbsDimension x="20" y="-30"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                        <Scripts>
                                            <OnLoad>
                                                _G[self:GetName().."Low"]:SetText("50%");
                                                _G[self:GetName().."High"]:SetText("150%");
                                            </OnLoad>
                                            <OnValueChanged>
                                                MegaDamageConfig_Slider_OnValueChanged(self, self:GetID());
                                            </OnValueChanged>
                                        </Scripts>
                                    </Slider>

                                    <Slider id="4" name="$parent_Alpha" minValue="0" maxValue="10" valueStep="1" inherits="MegaDamage_SliderTemplate">
                                        <Anchors>
                                            <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_Scale">
                                                <Offset>
                                                    <AbsDimension x="0" y="-20"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                        <Scripts>
                                            <OnLoad>
                                                _G[self:GetName().."Low"]:SetText("50%");
                                                _G[self:GetName().."High"]:SetText("100%");
                                            </OnLoad>
                                            <OnValueChanged>
                                                MegaDamageConfig_Slider_OnValueChanged(self, self:GetID());
                                            </OnValueChanged>
                                        </Scripts>
                                    </Slider>

                                    <CheckButton name="$parent_Lock" id="10" inherits="MegaDamage_CheckBoxTemplate">
                                        <Anchors>
                                            <Anchor point="LEFT" relativeTo="$parent_Scale" relativePoint="RIGHT">
                                                <Offset>
                                                    <AbsDimension x="20" y="0"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                    </CheckButton>

                                    <Button name="$parent_ResetPos" inherits="GameMenuButtonTemplate">
                                        <Size>
                                            <AbsDimension x="200" y="24"/>
                                        </Size>
                                        <Anchors>
                                            <Anchor point="LEFT" relativeTo="$parent_Alpha" relativePoint="RIGHT">
                                                <Offset>
                                                    <AbsDimension x="20" y="0"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                        <Scripts>
                                            <OnClick>
                                                PlaySound("gsTitleOptionOK");
                                                MegaDamage_ResetPosition();
                                            </OnClick>
                                        </Scripts>
                                    </Button>
                                </Frames>
                            </Frame>

                            <Frame name="$parent_OtherOptions" inherits="MegaDamage_ContainerTemplate">
                                <Anchors>
                                    <Anchor point="TOPLEFT" relativeTo="$parent_FrameOptions" relativePoint="BOTTOMLEFT">
                                        <Offset x="0" y="-20"/>
                                    </Anchor>
                                    <Anchor point="BOTTOMRIGHT" relativeTo="$parent_FrameOptions" relativePoint="BOTTOMRIGHT">
                                        <Offset x="0" y="-130"/>
                                    </Anchor>
                                </Anchors>
                                <Frames>

                                    <Slider id="2" name="$parent_DamageThreshold" minValue="10" maxValue="80" valueStep="1" inherits="MegaDamage_SliderTemplate">
                                        <Anchors>
                                            <Anchor point="TOPLEFT">
                                                <Offset>
                                                    <AbsDimension x="20" y="-30"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                        <Scripts>
                                            <OnLoad>
                                                _G[self:GetName().."Low"]:SetText("10k");
                                                _G[self:GetName().."High"]:SetText("80k");
                                            </OnLoad>
                                            <OnValueChanged>
                                                MegaDamageConfig_Slider_OnValueChanged(self, self:GetID());
                                            </OnValueChanged>
                                        </Scripts>
                                    </Slider>

                                    <Slider id="3" name="$parent_HealThreshold" minValue="10" maxValue="80" valueStep="1" inherits="MegaDamage_SliderTemplate">
                                        <Anchors>
                                            <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parent_DamageThreshold">
                                                <Offset>
                                                    <AbsDimension x="0" y="-20"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                        <Scripts>
                                            <OnLoad>
                                                _G[self:GetName().."Low"]:SetText("10k");
                                                _G[self:GetName().."High"]:SetText("80k");
                                            </OnLoad>
                                            <OnValueChanged>
                                                MegaDamageConfig_Slider_OnValueChanged(self, self:GetID());
                                            </OnValueChanged>
                                        </Scripts>
                                    </Slider>

                                    <CheckButton id="20" inherits="MegaDamage_CheckBoxTemplate" name="$parent_Prefix">
                                        <Anchors>
                                            <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_DamageThreshold">
                                                <Offset>
                                                    <AbsDimension x="20" y="0"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                    </CheckButton>

                                    <CheckButton id="21" inherits="MegaDamage_CheckBoxTemplate" name="$parent_LoadMessage">
                                        <Anchors>
                                            <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_HealThreshold">
                                                <Offset>
                                                    <AbsDimension x="20" y="0"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                    </CheckButton>

                                </Frames>
                            </Frame>

                            <Frame name="$parent_LifetimeRecords" inherits="MegaDamage_ContainerTemplate">
                                <Anchors>
                                    <Anchor point="TOPLEFT" relativeTo="$parent_OtherOptions" relativePoint="BOTTOMLEFT">
                                        <Offset x="0" y="-20"/>
                                    </Anchor>
                                    <Anchor point="BOTTOMRIGHT" relativeTo="$parent_OtherOptions" relativePoint="BOTTOMRIGHT">
                                        <Offset x="0" y="-95"/>
                                    </Anchor>
                                </Anchors>
                                <Layers>
                                    <Layer level="ARTWORK">
                                        <FontString name="$parent_DamageTotal" inherits="GameFontNormal" justifyH="LEFT">
                                            <Anchors>
                                                <Anchor point="TOPLEFT">
                                                    <Offset>
                                                        <AbsDimension x="15" y="-15"/>
                                                    </Offset>
                                                </Anchor>
                                            </Anchors>
                                        </FontString>
                                        <FontString name="$parent_HealingTotal" inherits="GameFontNormal" justifyH="LEFT">
                                            <Anchors>
                                                <Anchor point="TOPLEFT" relativePoint="TOP">
                                                    <Offset>
                                                        <AbsDimension x="0" y="-15"/>
                                                    </Offset>
                                                </Anchor>
                                            </Anchors>
                                        </FontString>
                                    </Layer>
                                </Layers>
                                <Frames>
                                    <CheckButton id="30" inherits="MegaDamage_CheckBoxTemplate" name="$parent_UseThreshold">
                                        <Size>
                                            <AbsDimension x="25" y="25"/>
                                        </Size>
                                        <Anchors>
                                            <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parent_DamageTotal">
                                                <Offset>
                                                    <AbsDimension x="10" y="-5"/>
                                                </Offset>
                                            </Anchor>
                                        </Anchors>
                                    </CheckButton>
                                </Frames>
                            </Frame>
                        </Frames>
                    </Frame>
                </ScrollChild>
            </ScrollFrame>
        </Frames>
        <Scripts>
            <OnLoad>
                MegaDamageConfig_OnLoad(self);
            </OnLoad>
        </Scripts>
    </Frame>
    

</Ui>
