режим предателя + UI референсы и DragonUI

This commit is contained in:
2026-04-09 02:05:29 +04:00
parent 1109d19bb5
commit e8f1ae4ab9
397 changed files with 202750 additions and 37 deletions
@@ -0,0 +1,354 @@
KEY_BINDINGS_DISPLAYED = 17;
KEY_BINDING_HEIGHT = 25;
DEFAULT_BINDINGS = 0;
ACCOUNT_BINDINGS = 1;
CHARACTER_BINDINGS = 2;
UIPanelWindows["KeyBindingFrame"] = { area = "center", pushable = 0, whileDead = 1 };
StaticPopupDialogs["CONFIRM_DELETING_CHARACTER_SPECIFIC_BINDINGS"] = {
text = CONFIRM_DELETING_CHARACTER_SPECIFIC_BINDINGS,
button1 = OKAY,
button2 = CANCEL,
OnAccept = function(self)
SaveBindings(KeyBindingFrame.which);
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
HideUIPanel(KeyBindingFrame);
CONFIRMED_DELETING_CHARACTER_SPECIFIC_BINDINGS = 1;
end,
timeout = 0,
whileDead = 1,
showAlert = 1,
};
StaticPopupDialogs["CONFIRM_LOSE_BINDING_CHANGES"] = {
text = CONFIRM_LOSE_BINDING_CHANGES,
button1 = OKAY,
button2 = CANCEL,
OnAccept = function(self)
KeyBindingFrame_ChangeBindingProfile();
KeyBindingFrame.bindingsChanged = nil;
end,
OnCancel = function(self)
if ( KeyBindingFrameCharacterButton:GetChecked() ) then
KeyBindingFrameCharacterButton:SetChecked();
else
KeyBindingFrameCharacterButton:SetChecked(1);
end
end,
timeout = 0,
whileDead = 1,
showAlert = 1,
};
function KeyBindingFrame_OnLoad(self)
self:RegisterForClicks("AnyUp");
KeyBindingFrame_SetSelected(nil);
end
function KeyBindingFrame_OnShow()
KeyBindingFrame_Update();
-- Update character button
KeyBindingFrameCharacterButton:SetChecked(GetCurrentBindingSet() == 2);
-- Update header text
if ( KeyBindingFrameCharacterButton:GetChecked() ) then
KeyBindingFrameHeaderText:SetFormattedText(CHARACTER_KEY_BINDINGS, UnitName("player"));
else
KeyBindingFrameHeaderText:SetText(KEY_BINDINGS);
end
-- Reset bindingsChanged
KeyBindingFrame.bindingsChanged = nil;
end
function KeyBindingFrame_Update()
local numBindings = GetNumBindings();
local keyOffset;
local keyBindingButton1, keyBindingButton2, commandName, binding1, binding2;
local keyBindingName, keyBindingDescription;
local keyBindingButton1NormalTexture, keyBindingButton1PushedTexture, keyBindingButton2NormalTexture, keyBindingButton2PushedTexture;
for i=1, KEY_BINDINGS_DISPLAYED, 1 do
keyOffset = FauxScrollFrame_GetOffset(KeyBindingFrameScrollFrame) + i;
if ( keyOffset <= numBindings) then
keyBindingButton1 = _G["KeyBindingFrameBinding"..i.."Key1Button"];
keyBindingButton1NormalTexture = _G["KeyBindingFrameBinding"..i.."Key1ButtonNormalTexture"];
keyBindingButton1PushedTexture = _G["KeyBindingFrameBinding"..i.."Key1ButtonPushedTexture"];
keyBindingButton2NormalTexture = _G["KeyBindingFrameBinding"..i.."Key2ButtonNormalTexture"];
keyBindingButton2PushedTexture = _G["KeyBindingFrameBinding"..i.."Key2ButtonPushedTexture"];
keyBindingButton2 = _G["KeyBindingFrameBinding"..i.."Key2Button"];
keyBindingDescription = _G["KeyBindingFrameBinding"..i.."Description"];
-- Set binding text
commandName, binding1, binding2 = GetBinding(keyOffset, KeyBindingFrame.mode);
-- Handle header
local headerText = _G["KeyBindingFrameBinding"..i.."Header"];
if ( strsub(commandName, 1, 6) == "HEADER" ) then
headerText:SetText(_G["BINDING_"..commandName]);
headerText:Show();
keyBindingButton1:Hide();
keyBindingButton2:Hide();
keyBindingDescription:Hide();
else
headerText:Hide();
keyBindingButton1:Show();
keyBindingButton2:Show();
keyBindingDescription:Show();
keyBindingButton1.commandName = commandName;
keyBindingButton2.commandName = commandName;
if ( binding1 ) then
keyBindingButton1:SetText(GetBindingText(binding1, "KEY_"));
keyBindingButton1:SetAlpha(1);
else
keyBindingButton1:SetText(NORMAL_FONT_COLOR_CODE..NOT_BOUND..FONT_COLOR_CODE_CLOSE);
keyBindingButton1:SetAlpha(0.8);
end
if ( binding2 ) then
keyBindingButton2:SetText(GetBindingText(binding2, "KEY_"));
keyBindingButton2:SetAlpha(1);
else
keyBindingButton2:SetText(NORMAL_FONT_COLOR_CODE..NOT_BOUND..FONT_COLOR_CODE_CLOSE);
keyBindingButton2:SetAlpha(0.8);
end
-- Set description
keyBindingDescription:SetText(GetBindingText(commandName, "BINDING_NAME_"));
-- Handle highlight
keyBindingButton1:UnlockHighlight();
keyBindingButton2:UnlockHighlight();
if ( KeyBindingFrame.selected == commandName ) then
if ( KeyBindingFrame.keyID == 1 ) then
keyBindingButton1:LockHighlight();
else
keyBindingButton2:LockHighlight();
end
end
_G["KeyBindingFrameBinding"..i]:Show();
end
else
_G["KeyBindingFrameBinding"..i]:Hide();
end
end
-- Scroll frame stuff
FauxScrollFrame_Update(KeyBindingFrameScrollFrame, numBindings, KEY_BINDINGS_DISPLAYED, KEY_BINDING_HEIGHT );
-- Update Unbindkey button
KeyBindingFrame_UpdateUnbindKey();
end
function KeyBindingFrame_UnbindKey(keyPressed)
local oldAction = GetBindingAction(keyPressed, KeyBindingFrame.mode);
if ( oldAction ~= "" and oldAction ~= KeyBindingFrame.selected ) then
local key1, key2 = GetBindingKey(oldAction, KeyBindingFrame.mode);
if ( (not key1 or key1 == keyPressed) and (not key2 or key2 == keyPressed) ) then
--Error message
KeyBindingFrameOutputText:SetFormattedText(KEY_UNBOUND_ERROR, GetBindingText(oldAction, "BINDING_NAME_"));
end
end
SetBinding(keyPressed, nil, KeyBindingFrame.mode);
end
function KeyBindingFrame_OnKeyDown(self, keyOrButton)
if ( GetBindingFromClick(keyOrButton) == "SCREENSHOT" ) then
RunBinding("SCREENSHOT");
return;
end
if ( KeyBindingFrame.selected ) then
local keyPressed = keyOrButton;
if ( keyPressed == "UNKNOWN" ) then
return;
end
-- Convert the mouse button names
if ( keyPressed == "LeftButton" ) then
keyPressed = "BUTTON1";
elseif ( keyPressed == "RightButton" ) then
keyPressed = "BUTTON2";
elseif ( keyPressed == "MiddleButton" ) then
keyPressed = "BUTTON3";
elseif ( keyPressed == "Button4" ) then
keyPressed = "BUTTON4"
elseif ( keyOrButton == "Button5" ) then
keyPressed = "BUTTON5"
elseif ( keyPressed == "Button6" ) then
keyPressed = "BUTTON6"
elseif ( keyOrButton == "Button7" ) then
keyPressed = "BUTTON7"
elseif ( keyPressed == "Button8" ) then
keyPressed = "BUTTON8"
elseif ( keyOrButton == "Button9" ) then
keyPressed = "BUTTON9"
elseif ( keyPressed == "Button10" ) then
keyPressed = "BUTTON10"
elseif ( keyOrButton == "Button11" ) then
keyPressed = "BUTTON11"
elseif ( keyPressed == "Button12" ) then
keyPressed = "BUTTON12"
elseif ( keyOrButton == "Button13" ) then
keyPressed = "BUTTON13"
elseif ( keyPressed == "Button14" ) then
keyPressed = "BUTTON14"
elseif ( keyOrButton == "Button15" ) then
keyPressed = "BUTTON15"
elseif ( keyPressed == "Button16" ) then
keyPressed = "BUTTON16"
elseif ( keyOrButton == "Button17" ) then
keyPressed = "BUTTON17"
elseif ( keyPressed == "Button18" ) then
keyPressed = "BUTTON18"
elseif ( keyOrButton == "Button19" ) then
keyPressed = "BUTTON19"
elseif ( keyPressed == "Button20" ) then
keyPressed = "BUTTON20"
elseif ( keyOrButton == "Button21" ) then
keyPressed = "BUTTON21"
elseif ( keyPressed == "Button22" ) then
keyPressed = "BUTTON22"
elseif ( keyOrButton == "Button23" ) then
keyPressed = "BUTTON23"
elseif ( keyPressed == "Button24" ) then
keyPressed = "BUTTON24"
elseif ( keyOrButton == "Button25" ) then
keyPressed = "BUTTON25"
elseif ( keyPressed == "Button26" ) then
keyPressed = "BUTTON26"
elseif ( keyOrButton == "Button27" ) then
keyPressed = "BUTTON27"
elseif ( keyPressed == "Button28" ) then
keyPressed = "BUTTON28"
elseif ( keyOrButton == "Button29" ) then
keyPressed = "BUTTON29"
elseif ( keyPressed == "Button30" ) then
keyPressed = "BUTTON30"
elseif ( keyOrButton == "Button31" ) then
keyPressed = "BUTTON31"
end
if ( keyPressed == "BUTTON1" or keyPressed == "BUTTON2" ) then
return;
end
if ( keyPressed == "LSHIFT" or
keyPressed == "RSHIFT" or
keyPressed == "LCTRL" or
keyPressed == "RCTRL" or
keyPressed == "LALT" or
keyPressed == "RALT" ) then
return;
end
if ( IsShiftKeyDown() ) then
keyPressed = "SHIFT-"..keyPressed;
end
if ( IsControlKeyDown() ) then
keyPressed = "CTRL-"..keyPressed;
end
if ( IsAltKeyDown() ) then
keyPressed = "ALT-"..keyPressed;
end
-- Unbind the current action
local key1, key2 = GetBindingKey(KeyBindingFrame.selected, KeyBindingFrame.mode);
if ( key1 ) then
SetBinding(key1, nil, KeyBindingFrame.mode);
end
if ( key2 ) then
SetBinding(key2, nil, KeyBindingFrame.mode);
end
-- Unbind the current key and rebind current action
KeyBindingFrameOutputText:SetText(KEY_BOUND);
KeyBindingFrame_UnbindKey(keyPressed);
if ( KeyBindingFrame.keyID == 1 ) then
KeyBindingFrame_SetBinding(keyPressed, KeyBindingFrame.selected, key1);
if ( key2 ) then
SetBinding(key2, KeyBindingFrame.selected, KeyBindingFrame.mode);
end
else
if ( key1 ) then
KeyBindingFrame_SetBinding(key1, KeyBindingFrame.selected);
end
KeyBindingFrame_SetBinding(keyPressed, KeyBindingFrame.selected, key2);
end
KeyBindingFrame_Update();
-- Button highlighting stuff
KeyBindingFrame_SetSelected(nil);
KeyBindingFrame.buttonPressed:UnlockHighlight();
KeyBindingFrame.bindingsChanged = 1;
elseif ( GetBindingFromClick(keyOrButton) == "TOGGLEGAMEMENU" ) then
LoadBindings(GetCurrentBindingSet());
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
HideUIPanel(self);
end
KeyBindingFrame_UpdateUnbindKey();
end
function KeyBindingButton_OnClick(self, button)
if ( KeyBindingFrame.selected ) then
-- Code to be able to deselect or select another key to bind
if ( button == "LeftButton" or button == "RightButton" ) then
-- Deselect button if it was the pressed previously pressed
if (KeyBindingFrame.buttonPressed == self) then
KeyBindingFrame_SetSelected(nil);
KeyBindingFrameOutputText:SetText("");
else
-- Select a different button
KeyBindingFrame.buttonPressed = self;
KeyBindingFrame_SetSelected(self.commandName);
KeyBindingFrame.keyID = self:GetID();
KeyBindingFrameOutputText:SetFormattedText(BIND_KEY_TO_COMMAND, GetBindingText(self.commandName, "BINDING_NAME_"));
end
KeyBindingFrame_Update();
return;
end
KeyBindingFrame_OnKeyDown(self, button);
else
if (KeyBindingFrame.buttonPressed) then
KeyBindingFrame.buttonPressed:UnlockHighlight();
end
KeyBindingFrame.buttonPressed = self;
KeyBindingFrame_SetSelected(self.commandName);
KeyBindingFrame.keyID = self:GetID();
KeyBindingFrameOutputText:SetFormattedText(BIND_KEY_TO_COMMAND, GetBindingText(self.commandName, "BINDING_NAME_"));
KeyBindingFrame_Update();
end
KeyBindingFrame_UpdateUnbindKey();
end
function KeyBindingFrame_SetBinding(key, selectedBinding, oldKey)
if ( SetBinding(key, selectedBinding, KeyBindingFrame.mode) ) then
return;
else
if ( oldKey ) then
SetBinding(oldKey, selectedBinding, KeyBindingFrame.mode);
end
--Error message
KeyBindingFrameOutputText:SetText(KEYBINDINGFRAME_MOUSEWHEEL_ERROR);
end
end
function KeyBindingFrame_UpdateUnbindKey()
if ( KeyBindingFrame.selected ) then
KeyBindingFrameUnbindButton:Enable();
else
KeyBindingFrameUnbindButton:Disable();
end
end
function KeyBindingFrame_ChangeBindingProfile()
if ( KeyBindingFrameCharacterButton:GetChecked() ) then
LoadBindings(CHARACTER_BINDINGS);
KeyBindingFrameHeaderText:SetFormattedText(CHARACTER_KEY_BINDINGS, UnitName("player"));
else
LoadBindings(ACCOUNT_BINDINGS);
KeyBindingFrameHeaderText:SetText(KEY_BINDINGS);
end
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
KeyBindingFrame_Update();
end
function KeyBindingFrame_SetSelected(value)
KeyBindingFrame.selected = value;
end
@@ -0,0 +1,6 @@
## Interface: 30300
## Title: Blizzard Key Binding UI
## Secure: 1
## LoadOnDemand: 1
Blizzard_BindingUI.xml
Localization.lua
@@ -0,0 +1,553 @@
<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="Blizzard_BindingUI.lua"/>
<Button name="KeyBindingFrameBindingButtonTemplate" inherits="UIPanelButtonTemplate2" virtual="true">
<Scripts>
<OnClick>
KeyBindingButton_OnClick(self, button, down);
</OnClick>
<OnLoad>
self:RegisterForClicks("AnyUp");
</OnLoad>
</Scripts>
<NormalFont style="GameFontHighlightSmall"/>
<DisabledFont style="GameFontDisable"/>
<HighlightFont style="GameFontHighlightSmall"/>
</Button>
<Frame name="KeyBindingFrameBindingTemplate" virtual="true">
<Size>
<AbsDimension x="560" y="25"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentDescription" inherits="GameFontNormalSmall" justifyH="LEFT">
<Size>
<AbsDimension x="170" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentHeader" inherits="GameFontHighlight">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parentKey1Button" inherits="KeyBindingFrameBindingButtonTemplate" id="1">
<Size>
<AbsDimension x="180" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="175" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="$parentKey2Button" inherits="KeyBindingFrameBindingButtonTemplate" id="2">
<Size>
<AbsDimension x="180" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentKey1Button" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Button>
</Frames>
</Frame>
<Button name="KeyBindingFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true" enableKeyboard="true">
<Size>
<AbsDimension x="640" y="512"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-100"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-TopLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-Top">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="256" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-TopRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
</Texture>
</Layer>
<Layer level="BACKGROUND">
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-BotLeft">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
</Texture>
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-Bot">
<Size>
<AbsDimension x="256" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="256" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<Texture file="Interface\KeyBindingFrame\UI-KeyBindingFrame-BotRight">
<Size>
<AbsDimension x="128" y="256"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
</Texture>
<FontString name="KeyBindingFrameCommandLabel" inherits="GameFontNormal" text="COMMAND">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="26" y="-35"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="KeyBindingFrameKey1Label" inherits="GameFontNormal" text="KEY1">
<Anchors>
<Anchor point="LEFT" relativeTo="KeyBindingFrameCommandLabel" relativePoint="RIGHT">
<Offset>
<AbsDimension x="185" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="KeyBindingFrameKey2Label" inherits="GameFontNormal" text="KEY2">
<Anchors>
<Anchor point="LEFT" relativeTo="KeyBindingFrameKey1Label" relativePoint="RIGHT">
<Offset>
<AbsDimension x="145" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="KeyBindingFrameOutputText" inherits="GameFontNormal">
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="0" y="52"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="ARTWORK">
<Texture name="KeyBindingFrameHeader" file="Interface\DialogFrame\UI-DialogBox-Header">
<Size>
<AbsDimension x="400" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="-30" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="KeyBindingFrameHeaderText" inherits="GameFontNormal" text="KEY_BINDINGS">
<Size>
<AbsDimension x="175" y="13"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="KeyBindingFrameHeader">
<Offset>
<AbsDimension x="0" y="-13"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="KeyBindingFrameBinding1" inherits="KeyBindingFrameBindingTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="27" y="-53"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding2" inherits="KeyBindingFrameBindingTemplate" id="2">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding3" inherits="KeyBindingFrameBindingTemplate" id="3">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding2" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding4" inherits="KeyBindingFrameBindingTemplate" id="4">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding3" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding5" inherits="KeyBindingFrameBindingTemplate" id="5">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding4" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding6" inherits="KeyBindingFrameBindingTemplate" id="6">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding5" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding7" inherits="KeyBindingFrameBindingTemplate" id="7">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding6" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding8" inherits="KeyBindingFrameBindingTemplate" id="8">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding7" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding9" inherits="KeyBindingFrameBindingTemplate" id="9">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding8" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding10" inherits="KeyBindingFrameBindingTemplate" id="10">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding9" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding11" inherits="KeyBindingFrameBindingTemplate" id="11">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding10" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding12" inherits="KeyBindingFrameBindingTemplate" id="12">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding11" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding13" inherits="KeyBindingFrameBindingTemplate" id="13">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding12" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding14" inherits="KeyBindingFrameBindingTemplate" id="14">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding13" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding15" inherits="KeyBindingFrameBindingTemplate" id="15">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding14" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding16" inherits="KeyBindingFrameBindingTemplate" id="16">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding15" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<Frame name="KeyBindingFrameBinding17" inherits="KeyBindingFrameBindingTemplate" id="17">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="KeyBindingFrameBinding16" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</Frame>
<ScrollFrame name="KeyBindingFrameScrollFrame" inherits="FauxScrollFrameTemplate">
<Size>
<AbsDimension x="560" y="390"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="2" y="-53"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnVerticalScroll>
FauxScrollFrame_OnVerticalScroll(self, offset, KEY_BINDING_HEIGHT, KeyBindingFrame_Update);
</OnVerticalScroll>
<OnMouseWheel>
if ( KeyBindingFrame.selected ) then
if ( delta > 0 ) then
KeyBindingFrame_OnKeyDown(self, "MOUSEWHEELUP");
else
KeyBindingFrame_OnKeyDown(self, "MOUSEWHEELDOWN");
end
else
ScrollFrameTemplate_OnMouseWheel(self, delta);
end
</OnMouseWheel>
</Scripts>
</ScrollFrame>
<CheckButton name="KeyBindingFrameCharacterButton" inherits="UICheckButtonTemplate">
<Size>
<AbsDimension x="20" y="20"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-245" y="-12"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="-100" top="0" bottom="0"/>
</HitRectInsets>
<Scripts>
<OnLoad>
KeyBindingFrameCharacterButtonText:SetText(HIGHLIGHT_FONT_COLOR_CODE..CHARACTER_SPECIFIC_KEYBINDINGS..FONT_COLOR_CODE_CLOSE);
</OnLoad>
<OnClick>
if ( KeyBindingFrame.bindingsChanged ) then
StaticPopup_Show("CONFIRM_LOSE_BINDING_CHANGES");
else
KeyBindingFrame_ChangeBindingProfile();
end
</OnClick>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(CHARACTER_SPECIFIC_KEYBINDING_TOOLTIP, nil, nil, nil, nil, 1);
</OnEnter>
<OnLeave function="GameTooltip_Hide"/>
</Scripts>
</CheckButton>
<Button name="KeyBindingFrameDefaultButton" inherits="UIPanelButtonGrayTemplate" text="RESET_TO_DEFAULT">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="10" y="21"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
LoadBindings(DEFAULT_BINDINGS);
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
KeyBindingFrame_Update();
</OnClick>
</Scripts>
</Button>
<Button name="KeyBindingFrameCancelButton" inherits="UIPanelButtonTemplate" text="CANCEL">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-50" y="21"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
LoadBindings(GetCurrentBindingSet());
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
HideUIPanel(KeyBindingFrame);
</OnClick>
</Scripts>
</Button>
<Button name="KeyBindingFrameOkayButton" inherits="UIPanelButtonTemplate" text="OKAY">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="KeyBindingFrameCancelButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
if ( KeyBindingFrameCharacterButton:GetChecked() ) then
KeyBindingFrame.which = CHARACTER_BINDINGS;
else
KeyBindingFrame.which = ACCOUNT_BINDINGS;
if ( GetCurrentBindingSet() == CHARACTER_BINDINGS ) then
if ( not CONFIRMED_DELETING_CHARACTER_SPECIFIC_BINDINGS ) then
StaticPopup_Show("CONFIRM_DELETING_CHARACTER_SPECIFIC_BINDINGS");
return;
end
end
end
SaveBindings(KeyBindingFrame.which);
KeyBindingFrameOutputText:SetText("");
KeyBindingFrame_SetSelected(nil);
HideUIPanel(KeyBindingFrame);
</OnClick>
</Scripts>
</Button>
<Button name="KeyBindingFrameUnbindButton" inherits="UIPanelButtonTemplate" text="UNBIND">
<Size>
<AbsDimension x="130" y="22"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="KeyBindingFrameOkayButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
local key1, key2 = GetBindingKey(KeyBindingFrame.selected, KeyBindingFrame.mode);
if ( key1 ) then
SetBinding(key1, nil, KeyBindingFrame.mode);
end
if ( key2 ) then
SetBinding(key2, nil, KeyBindingFrame.mode);
end
if ( key1 and KeyBindingFrame.keyID == 1 ) then
KeyBindingFrame_SetBinding(key1, nil, key1);
if ( key2 ) then
SetBinding(key2, KeyBindingFrame.selected, KeyBindingFrame.mode);
end
else
if ( key1 ) then
KeyBindingFrame_SetBinding(key1, KeyBindingFrame.selected);
end
if ( key2 ) then
KeyBindingFrame_SetBinding(key2, nil, key2);
end
end
KeyBindingFrame_Update();
-- Button highlighting stuff
KeyBindingFrame_SetSelected(nil);
KeyBindingFrame.buttonPressed:UnlockHighlight();
KeyBindingFrame_UpdateUnbindKey();
KeyBindingFrameOutputText:SetText();
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnClick function="KeyBindingFrame_OnKeyDown"/>
<OnKeyDown function="KeyBindingFrame_OnKeyDown"/>
<OnLoad function="KeyBindingFrame_OnLoad"/>
<OnShow>
KeyBindingFrame_OnShow(self);
Disable_BagButtons();
UpdateMicroButtons();
</OnShow>
<OnHide>
KeyBindingFrameOutputText:SetText("");
PlaySound("gsTitleOptionExit");
ShowUIPanel(GameMenuFrame);
UpdateMicroButtons();
</OnHide>
</Scripts>
</Button>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load