view SkeletonKey/SkeletonKey.xml @ 19:67db6b712bf3

- option checkbutton literals are stored by enclosure - detect and save any old keybindings when a slot is assigned (anything that begins with 'CLICK KeyBinder*' is ours) - mouseover mode key input will stay active after leaving a button - button border flashes when a non-modifier key is pressed
author Nenue
date Sat, 30 Jul 2016 19:08:11 -0400
parents 91398d284a99
children 73df13211b22
line wrap: on
line source
<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">
  <Button name="KeyBinderMacro" inherits="SecureActionButtonTemplate">
    <Attributes>
      <Attribute name="*type*" value="macro" />
    </Attributes>
  </Button>
  <Button name="KeyBinderKey" inherits="SecureActionButtonTemplate" />
  <CheckButton name="KeyButton" virtual="true">
    <Size x="32" y="32" />
    <Layers>
      <Layer level="BACKGROUND">
        <Texture parentKey="border" setAllPoints="true">
          <Color a="1" r=".25" g=".25" b=".25" />
        </Texture>
      </Layer>
      <Layer level="BORDER">

        <Texture parentKey="bg">
          <Anchors>
            <Anchor point="TOPLEFT" x="2" y="-2" />
            <Anchor point="BOTTOMRIGHT" x="-2" y="2" />
          </Anchors>
          <Color a="0.5" r="0" g="0" b="0" />
        </Texture>
      </Layer>
      <Layer level="ARTWORK">
        <Texture setAllPoints="true" parentKey="icon">
          <Anchors>
            <Anchor point="TOPLEFT" x="2" y="-2" />
            <Anchor point="BOTTOMRIGHT" x="-2" y="2" />
          </Anchors>

          <TexCoords left="0.1" right="0.9" top="0.1" bottom="0.9" />

        </Texture>
      </Layer>
      <Layer level="OVERLAY">
        <FontString inherits="NumberFontNormal" parentKey="header" wordwrap="false" justifyH="LEFT">

          <Anchors>
            <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" x="2" y="-2" />
            <Anchor point="RIGHT" x="128" y="0" />
          </Anchors>
        </FontString>
        <FontString inherits="NumberFontNormal" parentKey="bind">
          <Anchors>
            <Anchor point="BOTTOMRIGHT" x="-2" y="2" />
          </Anchors>
        </FontString>
        <FontString inherits="KTMacroButtonFont" parentKey="macro">
          <Anchors>
            <Anchor point="TOPLEFT" x="2" y="-2" />
            <Anchor point="RIGHT" x="-2" y="0" />
          </Anchors>
        </FontString>
        <FontString inherits="NumberFontNormal" parentKey="details" justifyH="LEFT">
          <Anchors>
            <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" x="0" y="-2" relativeKey="$parent.header" />
            <Anchor point="RIGHT" x="128" y="0" />
          </Anchors>
        </FontString>

        <Texture parentKey="ignoreTexture" file="Interface\PaperDollInfoFrame\UI-GearManager-LeaveItem-Transparent" hidden="true">
          <Anchors>
            <Anchor point="TOPLEFT" x="0" y="0" />
            <Anchor point="BOTTOMRIGHT" x="0" y="0" />
          </Anchors>
        </Texture>
      </Layer>
    </Layers>
    <HighlightTexture alphaMode="ADD">
      <Anchors>
        <Anchor point="TOPLEFT" x="2" y="-2" />
        <Anchor point="BOTTOMRIGHT" x="-2" y="2" />
      </Anchors>
      <Color a="1" r="0.15" g="0.15" b="0.15" />
    </HighlightTexture>
  </CheckButton>

  <Frame name="KeyBinder" parent="UIParent" hidden="true" clampedToScreen="true" movable="true" enableMouse="true">
    <Anchors>
      <Anchor point="TOP" y="-25" x="0" />
    </Anchors>
    <Size x="600" y="200" />
    <Scripts>
      <OnLoad>
        self:RegisterForDrag('LeftButton')
      </OnLoad>
      <OnShow>
      </OnShow>
      <OnDragStart>
        self:StartMoving()
      </OnDragStart>
      <OnDragStop>
        self:StopMovingOrSizing()
      </OnDragStop>
      <OnMouseWheel>
        self:OnMouseWheel(delta)
      </OnMouseWheel>
      <OnHide>
        self:OnHide()
      </OnHide>
    </Scripts>
    <Layers>
      <Layer level="BACKGROUND">

        <Texture parentKey="info">
          <Anchors>
            <Anchor point="TOPLEFT" />
            <Anchor point="RIGHT" />
          </Anchors>
          <Size y="42" />
        </Texture>

        <Texture parentKey="headerbg" alphaMode="MOD">
          <Size y="32" />
          <Anchors>
            <Anchor point="TOPLEFT" />
            <Anchor point="RIGHT" />
          </Anchors>
          <Color a="1" r="1" g="1" b="1" />
          <Gradient orientation="VERTICAL">
            <MinColor r="0" g="0" b="0"/>
            <MaxColor r="1" g="1" b="1"/>
          </Gradient>
        </Texture>

        <Texture parentKey="sourcesbg">
          <Size x="100" />
          <Anchors>
            <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeKey="$parent.headerbg" />
            <Anchor point="BOTTOM" />
          </Anchors>
          <Color a=".75" r="0" g="0" b="0" />
        </Texture>



        <Texture parentKey="profilebg">
          <Size  y="102" />
          <Anchors>
            <Anchor point="TOP" relativePoint="BOTTOM" relativeKey="$parent.headerbg" />
            <Anchor point="LEFT" relativePoint="RIGHT" relativeKey="$parent.sourcesbg" />
            <Anchor point="RIGHT" />
          </Anchors>
          <Color a="1" r="0" g="0" b="0" />
        </Texture>

        <Texture parentKey="bg">
          <Anchors>
            <Anchor point="TOP" relativePoint="BOTTOM" relativeKey="$parent.profilebg" />
            <Anchor point="LEFT" relativePoint="RIGHT" relativeKey="$parent.sourcesbg" />
          </Anchors>
          <Color a="0.5" r="0" g="0" b="0" />
        </Texture>

        <Texture parentKey="footer">
          <Size y="52" />
          <Anchors>
            <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeKey="$parent.bg" x="0" y="0" />
            <Anchor point="RIGHT"  />
          </Anchors>
          <Color a="1" r="0" g="0" b="0" />
        </Texture>
      </Layer>
      <Layer level="OVERLAY">

        <FontString inherits="KTHeaderFont" text="Bindings" parentKey="header">
          <Anchors>
            <Anchor point="TOPLEFT" />
          </Anchors>
        </FontString>

        <FontString parentKey="profiletext" inherits="KTHeader2Font" justifyH="LEFT" text="Foobar">
          <Anchors>
            <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" relativeKey="$parent.header" x="8" y="5" />
          </Anchors>
          <Color a="1" r="1" g="0.7" b="0" />
        </FontString>

        <FontString parentKey="statustext" inherits="NumberFont_Outline_Large" justifyH="LEFT" justifyV="TOP">
          <Anchors>
            <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" relativeKey="$parent.bg" x="12" y="7" />
          </Anchors>
        </FontString>


        <FontString parentKey="bindingstext" inherits="NumberFont_Outline_Large" justifyH="RIGHT" justifyV="TOP">
          <Anchors>
            <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" relativeKey="$parent.bg" x="-12" y="7" />
          </Anchors>
          <Color a="1" r="0" g="1" b="0" />
        </FontString>

        <FontString parentKey="savingText" inherits="KTHeaderFont" text="Press a key." />
      </Layer>
    </Layers>
    <Frames>
      <Button inherits="UIPanelCloseButton" parentKey="CloseButton">
        <Anchors>
          <Anchor point="TOPRIGHT" />
        </Anchors>
      </Button>

      <Button name="$parentUnbindButton" hidden="true">
        <Size x="60" y="24" />
        <Anchors>
          <Anchor point="CENTER" />
        </Anchors>
        <Layers>
          <Layer level="OVERLAY">
            <FontString inherits="KTUIPanelFont" text="Unbind" />
          </Layer>
        </Layers>
        <NormalTexture>
          <Color a="1" r="1" g="0.4" b="0" />
        </NormalTexture>
        <HighlightTexture alphaMode="ADD">

          <Color a="1" r=".15" g="0.15" b=".15" />
        </HighlightTexture>
      </Button>


      <CheckButton name="KeyBinderStickyMode" text="Receiving">
        <Size  y="28" x="72" />
        <Anchors>
          <Anchor point="TOPRIGHT" x="-4" y="-48" relativeKey="$parent.headerbg" />
        </Anchors>
        <Layers>
          <Layer level="OVERLAY">
            <FontString inherits="KTLogString" text="Sticky Mode:">
              <Anchors>
                <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="4" y="4" />
              </Anchors>
            </FontString>
            <FontString parentKey="label" inherits="KTUIPanelFont" text="STICKY_MODE">
              <Anchors>
                <Anchor point="LEFT" x="4" />
              </Anchors>
            </FontString>
          </Layer>
        </Layers>
        <NormalTexture>
          <Color a=".5" r=".3" g="0.5" b="0.2" />
        </NormalTexture>
        <CheckedTexture>
          <Color a="1" r=".3" g="0.9" b=".2" />
        </CheckedTexture>
        <HighlightTexture alphaMode="ADD">
          <Color a="1" r="0.2" g="0.2" b="0.2" />
        </HighlightTexture>
      </CheckButton>

      <CheckButton name="KeyBinderHoverInput">
        <Size  y="28" x="72" />
        <Anchors>
          <Anchor point="TOPRIGHT" relativePoint="TOPLEFT" x="-4" y="0" relativeTo="KeyBinderStickyMode" />
        </Anchors>

        <Layers>
          <Layer level="OVERLAY">
            <FontString parentKey="label" inherits="KTUIPanelFont" text="HOVER_INPUT">
              <Anchors>
                <Anchor point="LEFT" x="4" />
              </Anchors>
            </FontString>
            <FontString inherits="KTLogString" text="Bind on:">
              <Anchors>
                <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="4" y="4" />
              </Anchors>
            </FontString>
            <FontString inherits="KTHeaderFont" text="Options">
              <Anchors>
                <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="4" y="24" />
              </Anchors>
            </FontString>
          </Layer>
        </Layers>
        <NormalTexture>
          <Color a=".7" r=".5" g=".15" b=".1" />
        </NormalTexture>
        <CheckedTexture>
          <Color a="1" r="1" g=".3" b=".2" />
        </CheckedTexture>
        <HighlightTexture alphaMode="ADD">
          <Color a="1" r="0.2" g="0.2" b="0.2" />
        </HighlightTexture>
      </CheckButton>
    </Frames>
  </Frame>

  <ScrollingMessageFrame hidden="true" fade="false"  name="KeyBinderImportLog" parent="KeyBinder" clampedToScreen="true" parentKey="ImportLog" insertMode="BOTTOM" maxLines="500">

    <Scripts>
      <OnLoad>
        self:AddMessage('SkeletonKey import tool')
      </OnLoad>
      <OnMouseWheel>
        if delta >= 0 then
          if IsControlKeyDown() then
            -- extremely janky but avoids having one line at the bottom
            for i =1, self:GetMaxLines() do
              self:ScrollUp()
            end
          end

          return self:ScrollUp()
        else

          if IsControlKeyDown() then
            return self:ScrollToBottom()
          end

          self:ScrollDown()
        end
      </OnMouseWheel>
    </Scripts>
    <Anchors>
      <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" x="2" y="0" />
      <Anchor point="BOTTOM" />
    </Anchors>
    <Size x="400" />
    <Layers>
      <Layer level="BACKGROUND">
        <Texture setAllPoints="true">
          <Color a="1" r="0" g="0" b="0" />
        </Texture>
      </Layer>
    </Layers>
    <FontString inherits="NumberFontNormal" justifyH="LEFT">

      <Anchors>
        <Anchor point="TOPLEFT" />
      </Anchors>
        </FontString>
  </ScrollingMessageFrame>
</Ui>