flickerstreak@2
|
1 <Ui xmlns="http://www.blizzard.com/wow/ui/"
|
flickerstreak@2
|
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
flickerstreak@2
|
3 xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
|
flickerstreak@2
|
4
|
flickerstreak@2
|
5
|
flickerstreak@2
|
6 <Button name="ReBinderClickBindingTemplate" virtual="true" hidden="true" toplevel="true" setAllPoints="true">
|
flickerstreak@2
|
7 <HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/>
|
flickerstreak@2
|
8 <Layers>
|
flickerstreak@2
|
9 <Layer level="BACKGROUND">
|
flickerstreak@2
|
10 <Texture>
|
flickerstreak@2
|
11 <Color r="0" g="0" b="0" a="0"/>
|
flickerstreak@2
|
12 </Texture>
|
flickerstreak@2
|
13 </Layer>
|
flickerstreak@2
|
14 </Layers>
|
flickerstreak@2
|
15 <Scripts>
|
flickerstreak@2
|
16 <OnLoad>
|
flickerstreak@2
|
17 this:RegisterForClicks("LeftButtonUp","RightButtonUp")
|
flickerstreak@2
|
18 </OnLoad>
|
flickerstreak@2
|
19 <OnClick>
|
flickerstreak@2
|
20 local mouseBtn = arg1
|
flickerstreak@2
|
21 if mouseBtn == "LeftButton" then
|
flickerstreak@2
|
22 ReBinder:BindSelectedKeyTo(this.keybindTarget)
|
flickerstreak@2
|
23 elseif mouseBtn == "RightButton" then
|
flickerstreak@2
|
24 ReBinder:ClearBinding(this.keybindTarget)
|
flickerstreak@2
|
25 end
|
flickerstreak@2
|
26 </OnClick>
|
flickerstreak@2
|
27 <PostClick>
|
flickerstreak@2
|
28 this:SetButtonState("NORMAL")
|
flickerstreak@2
|
29 </PostClick>
|
flickerstreak@2
|
30 <OnEnter>
|
flickerstreak@2
|
31 ReBinder:UpdateCurrentTarget(this.keybindTarget)
|
flickerstreak@2
|
32 </OnEnter>
|
flickerstreak@2
|
33 <OnLeave>
|
flickerstreak@2
|
34 ReBinder:UpdateCurrentTarget(nil)
|
flickerstreak@2
|
35 </OnLeave>
|
flickerstreak@2
|
36 </Scripts>
|
flickerstreak@2
|
37 </Button>
|
flickerstreak@2
|
38
|
flickerstreak@2
|
39
|
flickerstreak@2
|
40 <!-- this frame covers the entire UIParent. It is visible but empty and in the background, so all it does is consume key presses and unhandled mouse clicks -->
|
flickerstreak@2
|
41 <Button name="ReBinderFrame" frameStrata="BACKGROUND" movable="false" enableMouse="true" enableKeyboard="true" parent="UIParent" hidden="true" setAllPoints="true">
|
flickerstreak@2
|
42 <Frames>
|
flickerstreak@2
|
43 <!-- this is a dialog frame that appears to provide user feedback for the outer frame -->
|
flickerstreak@2
|
44 <Button name="$parentDialog" frameStrata="DIALOG" movable="true" enableMouse="true">
|
flickerstreak@2
|
45 <Size>
|
flickerstreak@2
|
46 <AbsDimension x="330" y="350"/>
|
flickerstreak@2
|
47 </Size>
|
flickerstreak@2
|
48 <Anchors>
|
flickerstreak@2
|
49 <Anchor point="CENTER"/>
|
flickerstreak@2
|
50 </Anchors>
|
flickerstreak@2
|
51 <TitleRegion>
|
flickerstreak@2
|
52 <Size>
|
flickerstreak@2
|
53 <AbsDimension x="350" y="30"/>
|
flickerstreak@2
|
54 </Size>
|
flickerstreak@2
|
55 <Anchors>
|
flickerstreak@2
|
56 <Anchor point="TOP">
|
flickerstreak@2
|
57 <Offset>
|
flickerstreak@2
|
58 <AbsDimension x="0" y="-10"/>
|
flickerstreak@2
|
59 </Offset>
|
flickerstreak@2
|
60 </Anchor>
|
flickerstreak@2
|
61 </Anchors>
|
flickerstreak@2
|
62 </TitleRegion>
|
flickerstreak@2
|
63 <Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
|
flickerstreak@2
|
64 <EdgeSize>
|
flickerstreak@2
|
65 <AbsValue val="16"/>
|
flickerstreak@2
|
66 </EdgeSize>
|
flickerstreak@2
|
67 <TileSize>
|
flickerstreak@2
|
68 <AbsValue val="16"/>
|
flickerstreak@2
|
69 </TileSize>
|
flickerstreak@2
|
70 <BackgroundInsets>
|
flickerstreak@2
|
71 <AbsInset left="4" right="4" top="4" bottom="4"/>
|
flickerstreak@2
|
72 </BackgroundInsets>
|
flickerstreak@2
|
73 </Backdrop>
|
flickerstreak@2
|
74 <Layers>
|
flickerstreak@2
|
75 <Layer level="BACKGROUND">
|
flickerstreak@2
|
76 <Texture>
|
flickerstreak@2
|
77 <Color r="0" g="0" b="0" a="0.7"/>
|
flickerstreak@2
|
78 </Texture>
|
flickerstreak@2
|
79 </Layer>
|
flickerstreak@2
|
80 <Layer level="ARTWORK">
|
flickerstreak@2
|
81 <FontString inherits="GameFontNormalLarge" text="Key Binding Setup" justifyH="CENTER">
|
flickerstreak@2
|
82 <Size>
|
flickerstreak@2
|
83 <AbsDimension x="200" y="30"/>
|
flickerstreak@2
|
84 </Size>
|
flickerstreak@2
|
85 <Anchors>
|
flickerstreak@2
|
86 <Anchor point="TOP">
|
flickerstreak@2
|
87 <Offset>
|
flickerstreak@2
|
88 <AbsDimension x="0" y="-10"/>
|
flickerstreak@2
|
89 </Offset>
|
flickerstreak@2
|
90 </Anchor>
|
flickerstreak@2
|
91 </Anchors>
|
flickerstreak@2
|
92 </FontString>
|
flickerstreak@2
|
93 <FontString inherits="GameFontNormal" text="Press a key to ready it for assignment, then click a button to assign the key.|nRight-click a button to clear its binding." justifyH="CENTER">
|
flickerstreak@2
|
94 <Size>
|
flickerstreak@2
|
95 <AbsDimension x="240" y="70"/>
|
flickerstreak@2
|
96 </Size>
|
flickerstreak@2
|
97 <Anchors>
|
flickerstreak@2
|
98 <Anchor point="TOP">
|
flickerstreak@2
|
99 <Offset>
|
flickerstreak@2
|
100 <AbsDimension x="0" y="-55"/>
|
flickerstreak@2
|
101 </Offset>
|
flickerstreak@2
|
102 </Anchor>
|
flickerstreak@2
|
103 </Anchors>
|
flickerstreak@2
|
104 <Color r="1.0" g="1.0" b="1.0"/>
|
flickerstreak@2
|
105 </FontString>
|
flickerstreak@2
|
106 <FontString inherits="GameFontNormal" text="Selected Key:" justifyH="RIGHT">
|
flickerstreak@2
|
107 <Size>
|
flickerstreak@2
|
108 <AbsDimension x="175" y="25"/>
|
flickerstreak@2
|
109 </Size>
|
flickerstreak@2
|
110 <Anchors>
|
flickerstreak@2
|
111 <Anchor point="RIGHT" relativePoint="TOP">
|
flickerstreak@2
|
112 <Offset>
|
flickerstreak@2
|
113 <AbsDimension x="-25" y="-160"/>
|
flickerstreak@2
|
114 </Offset>
|
flickerstreak@2
|
115 </Anchor>
|
flickerstreak@2
|
116 </Anchors>
|
flickerstreak@2
|
117 </FontString>
|
flickerstreak@2
|
118 <FontString inherits="GameFontNormal" text="Current Binding:" justifyH="RIGHT">
|
flickerstreak@2
|
119 <Size>
|
flickerstreak@2
|
120 <AbsDimension x="175" y="25"/>
|
flickerstreak@2
|
121 </Size>
|
flickerstreak@2
|
122 <Anchors>
|
flickerstreak@2
|
123 <Anchor point="RIGHT" relativePoint="TOP">
|
flickerstreak@2
|
124 <Offset>
|
flickerstreak@2
|
125 <AbsDimension x="-25" y="-205"/>
|
flickerstreak@2
|
126 </Offset>
|
flickerstreak@2
|
127 </Anchor>
|
flickerstreak@2
|
128 </Anchors>
|
flickerstreak@2
|
129 </FontString>
|
flickerstreak@2
|
130 <FontString name="$parentCurrentActionText" inherits="GameFontNormal" text="(none)" justifyH="CENTER">
|
flickerstreak@2
|
131 <Size>
|
flickerstreak@2
|
132 <AbsDimension x="140" y="50"/>
|
flickerstreak@2
|
133 </Size>
|
flickerstreak@2
|
134 <Anchors>
|
flickerstreak@2
|
135 <Anchor point="CENTER" relativePoint="TOP">
|
flickerstreak@2
|
136 <Offset>
|
flickerstreak@2
|
137 <AbsDimension x="75" y="-205"/>
|
flickerstreak@2
|
138 </Offset>
|
flickerstreak@2
|
139 </Anchor>
|
flickerstreak@2
|
140 </Anchors>
|
flickerstreak@2
|
141 <Color r="0" g="1" b="0" a="1"/>
|
flickerstreak@2
|
142 </FontString>
|
flickerstreak@2
|
143 <FontString name="$parentStatusMsg" inherits="GameFontNormal" text="" justifyH="CENTER">
|
flickerstreak@2
|
144 <Size>
|
flickerstreak@2
|
145 <AbsDimension x="200" y="50"/>
|
flickerstreak@2
|
146 </Size>
|
flickerstreak@2
|
147 <Anchors>
|
flickerstreak@2
|
148 <Anchor point="TOP">
|
flickerstreak@2
|
149 <Offset>
|
flickerstreak@2
|
150 <AbsDimension x="0" y="-230"/>
|
flickerstreak@2
|
151 </Offset>
|
flickerstreak@2
|
152 </Anchor>
|
flickerstreak@2
|
153 </Anchors>
|
flickerstreak@2
|
154 <Color r="0.1" g="1.0" b="0.1"/>
|
flickerstreak@2
|
155 </FontString>
|
flickerstreak@2
|
156 </Layer>
|
flickerstreak@2
|
157 </Layers>
|
flickerstreak@2
|
158 <Frames>
|
flickerstreak@2
|
159 <Button name="$parentSelectedKey" inherits="UIPanelButtonTemplate2" text="(none)">
|
flickerstreak@2
|
160 <Size>
|
flickerstreak@2
|
161 <AbsDimension x="140" y="28"/>
|
flickerstreak@2
|
162 </Size>
|
flickerstreak@2
|
163 <Anchors>
|
flickerstreak@2
|
164 <Anchor point="CENTER" relativePoint="TOP">
|
flickerstreak@2
|
165 <Offset>
|
flickerstreak@2
|
166 <AbsDimension x="75" y="-160"/>
|
flickerstreak@2
|
167 </Offset>
|
flickerstreak@2
|
168 </Anchor>
|
flickerstreak@2
|
169 </Anchors>
|
flickerstreak@2
|
170 </Button>
|
flickerstreak@2
|
171 <Button inherits="GameMenuButtonTemplate" text="Done">
|
flickerstreak@2
|
172 <Size>
|
flickerstreak@2
|
173 <AbsDimension x="112" y="28"/>
|
flickerstreak@2
|
174 </Size>
|
flickerstreak@2
|
175 <Anchors>
|
flickerstreak@2
|
176 <Anchor point="BOTTOM">
|
flickerstreak@2
|
177 <Offset>
|
flickerstreak@2
|
178 <AbsDimension x="0" y="10"/>
|
flickerstreak@2
|
179 </Offset>
|
flickerstreak@2
|
180 </Anchor>
|
flickerstreak@2
|
181 </Anchors>
|
flickerstreak@2
|
182 <Scripts>
|
flickerstreak@2
|
183 <OnClick>
|
flickerstreak@2
|
184 this:GetParent():GetParent():Hide()
|
flickerstreak@2
|
185 </OnClick>
|
flickerstreak@2
|
186 </Scripts>
|
flickerstreak@2
|
187 </Button>
|
flickerstreak@2
|
188 </Frames>
|
flickerstreak@2
|
189 <Scripts>
|
flickerstreak@2
|
190 <!-- the dialog frame needs to handle clicks (close button, drag title) so we have to
|
flickerstreak@2
|
191 re-implement the behavior of capturing alternate mouse buttons -->
|
flickerstreak@2
|
192 <OnLoad>
|
flickerstreak@2
|
193 this.selectedKey = getglobal(this:GetName().."SelectedKeyText")
|
flickerstreak@2
|
194 this.currentAction = getglobal(this:GetName().."CurrentActionText")
|
flickerstreak@2
|
195 this:RegisterForClicks("MiddleButtonUp","Button4Up","Button5Up")
|
flickerstreak@2
|
196 </OnLoad>
|
flickerstreak@2
|
197 <OnClick>
|
flickerstreak@2
|
198 local k, a = ReBinder:HandleKeyPressed(arg1)
|
flickerstreak@2
|
199 if k then
|
flickerstreak@2
|
200 this.selectedKey:SetText(k)
|
flickerstreak@2
|
201 this.currentAction:SetText(a or "(none)")
|
flickerstreak@2
|
202 end
|
flickerstreak@2
|
203 </OnClick>
|
flickerstreak@2
|
204 </Scripts>
|
flickerstreak@2
|
205 </Button>
|
flickerstreak@2
|
206 </Frames>
|
flickerstreak@2
|
207 <Scripts>
|
flickerstreak@2
|
208 <OnLoad>
|
flickerstreak@2
|
209 this.selectedKey = getglobal(this:GetName().."DialogSelectedKeyText")
|
flickerstreak@2
|
210 this.currentAction = getglobal(this:GetName().."DialogCurrentActionText")
|
flickerstreak@2
|
211 this.statusMsg = getglobal(this:GetName().."DialogStatusMsg")
|
flickerstreak@2
|
212 tinsert(UISpecialFrames,this:GetName())
|
flickerstreak@2
|
213 this:RegisterForClicks("MiddleButtonUp","Button4Up","Button5Up")
|
flickerstreak@2
|
214 </OnLoad>
|
flickerstreak@2
|
215 <OnShow>
|
flickerstreak@2
|
216 this.selectedKey:SetText("(none)")
|
flickerstreak@2
|
217 this.currentAction:SetText("(none)")
|
flickerstreak@2
|
218 this.statusMsg:SetText("")
|
flickerstreak@2
|
219 ReBinder:ShowClickBindingButtons()
|
flickerstreak@2
|
220 </OnShow>
|
flickerstreak@2
|
221 <OnHide>
|
flickerstreak@2
|
222 ReBinder:HideClickBindingButtons()
|
flickerstreak@2
|
223 ReBinder:ClearSelectedKey()
|
flickerstreak@2
|
224 </OnHide>
|
flickerstreak@2
|
225 <OnKeyDown>
|
flickerstreak@2
|
226 local k, a = ReBinder:HandleKeyPressed(arg1)
|
flickerstreak@2
|
227 if k then
|
flickerstreak@2
|
228 this.selectedKey:SetText(k)
|
flickerstreak@2
|
229 this.currentAction:SetText(a or "(none)")
|
flickerstreak@2
|
230 end
|
flickerstreak@2
|
231 </OnKeyDown>
|
flickerstreak@2
|
232 <OnClick>
|
flickerstreak@2
|
233 local k, a = ReBinder:HandleKeyPressed(arg1)
|
flickerstreak@2
|
234 if k then
|
flickerstreak@2
|
235 this.selectedKey:SetText(k)
|
flickerstreak@2
|
236 this.currentAction:SetText(a or "(none)")
|
flickerstreak@2
|
237 end
|
flickerstreak@2
|
238 </OnClick>
|
flickerstreak@2
|
239 </Scripts>
|
flickerstreak@2
|
240 </Button>
|
flickerstreak@2
|
241
|
flickerstreak@2
|
242 </Ui>
|