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