<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="RuneFrame.lua"/>
  <Button name="RuneButtonIndividualTemplate" virtual="true" hidden="false">
 	<Animations>
		<AnimationGroup parentKey="energize">
			<Scale target="$parentRuneWhiteGlow" endDelay="1" duration="0.15"  scaleX="4" scaleY="4" order="1"/>
			<Alpha target="$parentRuneWhiteGlow" endDelay="1" change="1.0" duration="0.2" order="1" />
			<Alpha target="$parentRuneColorGlow" startDelay="0.3" endDelay="4" change="1.0" duration="0.1" order="1" smoothing="IN_OUT"/>
			<Alpha target="$parentRuneWhiteGlow" change="-1.0" duration="0.1" order="2" smoothing="IN_OUT"/>
			<Alpha target="$parentRuneColorGlow" change="-1.0" duration="0.1" order="2" smoothing="IN_OUT"/>
		</AnimationGroup>
	</Animations>
   <Size>
      <AbsDimension x="18" y="18"/>
    </Size>
    <Frames>
		<Cooldown name="$parentCooldown" drawEdge="true" frameStrata="LOW" inherits="CooldownFrameTemplate">
			<Size x="15" y="15"/>
			<Anchors>
			  <Anchor point="CENTER" x="0" y="-1"/>
			</Anchors>
		</Cooldown>
		<Frame name="$parentBorder" frameStrata="LOW">
			<Size x="24" y="24"/>
			<Anchors>
				<Anchor point="CENTER">
					<Offset x="0" y="-1"/>
				</Anchor>
			</Anchors>
			<Layers>
				<Layer level="OVERLAY">
					<Texture name="$parentTexture" file="Interface\PlayerFrame\UI-PlayerFrame-Deathknight-Ring">
						<Color r=".6" g=".6" b=".6" a="1"/>
					</Texture>
				</Layer>
			</Layers>
			<Scripts>
				<OnLoad>	
					RaiseFrameLevel(self);
				</OnLoad>
			</Scripts>
		</Frame>
		<Frame frameStrata="MEDIUM" setAllPoints="true" name="$parentShine">
			<Layers>
				<Layer level="OVERLAY">
					<Texture name="$parentTexture" file="Interface\ComboFrame\ComboPoint" alphaMode="ADD" hidden="true">
						<Size x="60" y="35"/>
						<Anchors>
							<Anchor point="CENTER">
								<Offset x="0" y="0"/>
							</Anchor>
						</Anchors>
						<TexCoords left="0.5625" right="1" top="0" bottom="1"/>
					</Texture>
				</Layer>
			</Layers>
		</Frame>
		<Frame frameStrata="HIGH" setAllPoints="true">
			<Layers>
				<Layer level="OVERLAY" textureSubLevel = "-1">
					<Texture name="$parentRuneWhiteGlow" file="Interface\PlayerFrame\Deathknight-Energize-White" alpha="0">
						<Size x="8" y="8"/>
						<Anchors>
							<Anchor point="CENTER" x="0" y="-1"/>
						</Anchors>
					</Texture>
				</Layer>
				<Layer level="OVERLAY">
					<Texture name="$parentRuneColorGlow" file="Interface\PlayerFrame\Deathknight-Energize-Blood" alpha="0">
						<Size x="32" y="32"/>
						<Anchors>
							<Anchor point="CENTER" x="0" y="-1"/>
						</Anchors>
					</Texture>
				</Layer>
			</Layers>
		</Frame>
    </Frames>
    <Layers>
		<Layer level="ARTWORK">
			<Texture name="$parentRune" file="Interface\PlayerFrame\UI-PlayerFrame-Deathknight-Blood" parentKey="rune">
				<Size>
					<AbsDimension x="24" y="24"/>
				</Size>
				<Anchors>
					<Anchor point="CENTER">
						<Offset>
							<AbsDimension x="0" y="-1"/>
						</Offset>
					</Anchor>
				</Anchors>
			</Texture>
		</Layer>
    </Layers>
    <Scripts>
		<OnLoad>
			RuneButton_OnLoad(self);
		</OnLoad>
		<OnEnter>
			RuneButton_OnEnter(self, motion);
		</OnEnter>
		<OnLeave>
			RuneButton_OnLeave(self, motion);
		</OnLeave>
    </Scripts>
  </Button>
	
	<!--If you change anything about RuneFrame (specifically anchors), make sure to change the relevant information in UnitFrame_SetUnit -->
  <Frame name="RuneFrame" parent="PlayerFrame" frameStrata="LOW" toplevel="true" hidden="false">
    <Size>
      <AbsDimension x="130" y="18"/>
    </Size>
    <Anchors>
      <Anchor point="TOP" relativePoint="BOTTOM">
        <Offset>
          <AbsDimension x="54" y="34"/>
        </Offset>
      </Anchor>
    </Anchors>
    <Scripts>
      <OnLoad function="RuneFrame_OnLoad"/>
    </Scripts>
  </Frame>
  
  <!-- Rune order is 1,2,5,6,3,4  which coresponds to Blood, Blood, Frost, Frost, Unholy, Unholy -->
  <Button name="RuneButtonIndividual1" inherits="RuneButtonIndividualTemplate" parent="RuneFrame">
    <Anchors>
      <Anchor point="LEFT" relativeTo="RuneFrame" relativePoint="LEFT">
        <Offset>
          <AbsDimension x="0" y="0"/>
        </Offset>
      </Anchor>
    </Anchors>
  </Button>

  <Button name="RuneButtonIndividual2" inherits="RuneButtonIndividualTemplate" parent="RuneFrame">
    <Anchors>
      <Anchor point="LEFT" relativeTo="RuneButtonIndividual1" relativePoint="RIGHT">
        <Offset>
          <AbsDimension x="3" y="0"/>
        </Offset>
      </Anchor>
    </Anchors>
  </Button>

  <Button name="RuneButtonIndividual5" inherits="RuneButtonIndividualTemplate" parent="RuneFrame">
    <Anchors>
      <Anchor point="LEFT" relativeTo="RuneButtonIndividual2" relativePoint="RIGHT">
        <Offset>
          <AbsDimension x="3" y="0"/>
        </Offset>
      </Anchor>
    </Anchors>
  </Button>

  <Button name="RuneButtonIndividual6" inherits="RuneButtonIndividualTemplate" parent="RuneFrame">
    <Anchors>
      <Anchor point="LEFT" relativeTo="RuneButtonIndividual5" relativePoint="RIGHT">
        <Offset>
          <AbsDimension x="3" y="0"/>
        </Offset>
      </Anchor>
    </Anchors>
  </Button>

  <Button name="RuneButtonIndividual3" inherits="RuneButtonIndividualTemplate" parent="RuneFrame">
    <Anchors>
      <Anchor point="LEFT" relativeTo="RuneButtonIndividual6" relativePoint="RIGHT">
        <Offset>
          <AbsDimension x="3" y="0"/>
        </Offset>
      </Anchor>
    </Anchors>
  </Button>

  <Button name="RuneButtonIndividual4" inherits="RuneButtonIndividualTemplate" parent="RuneFrame">
    <Anchors>
      <Anchor point="LEFT" relativeTo="RuneButtonIndividual3" relativePoint="RIGHT">
        <Offset>
          <AbsDimension x="3" y="0"/>
        </Offset>
      </Anchor>
    </Anchors>
  </Button>

</Ui>