-
Notifications
You must be signed in to change notification settings - Fork 0
/
OmniBar.xml
250 lines (242 loc) · 7.88 KB
/
OmniBar.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<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">
<Font name="OmniBarFont" font="Fonts\FRIZQT__.TTF" inherits="GameFontHighlightSmallOutline" virtual="true">
<FontHeight>
<AbsValue val="8"/>
</FontHeight>
</Font>
<Frame name="OmniBarTemplate" virtual="true" parent="UIParent" frameStrata="MEDIUM" movable="true" clampedToScreen="true" dontSavePosition="true">
<Size>
<AbsDimension x="1" y="1"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Frames>
<Frame name="$parentAnchor" parentKey="anchor" enableMouse="true" clampedToScreen="true">
<Size>
<AbsDimension x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBG" setAllPoints="true" parentKey="background">
<Color r="0" g="0" b="0" a="0.3"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GameFontNormal" parentKey="text" text="OmniBar">
<Color r="1" g="1" b="0" a="1"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnMouseDown>
local bar = self:GetParent()
OmniBar_Center(bar)
bar:StartMoving()
</OnMouseDown>
<OnMouseUp>
local bar = self:GetParent()
bar:StopMovingOrSizing()
OmniBar_SavePosition(bar)
LibStub("AceConfigRegistry-3.0"):NotifyChange("OmniBar")
</OnMouseUp>
</Scripts>
</Frame>
<Frame name="$parentIcons" parentKey="container" clampedToScreen="true">
<Size>
<AbsDimension x="1" y="1"/>
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="$parentAnchor"/>
</Anchors>
</Frame>
</Frames>
<Scripts>
<OnLoad>
LibStub("AceEvent-3.0"):Embed(self)
self.SpellCast = OmniBar_SpellCast
self:RegisterMessage("OmniBar_SpellCast", "SpellCast")
self.Refresh = OmniBar_Refresh
self:RegisterMessage("OmniBar_ResetSpellCast", "Refresh")
self.SpecUpdated = OmniBar_SpecUpdated
self:RegisterMessage("OmniBar_SpecUpdated", "SpecUpdated")
</OnLoad>
</Scripts>
</Frame>
<Button name="OmniBarButtonTemplate" inherits="ActionButtonTemplate" hidden="true" virtual="true">
<Size>
<AbsDimension x="36" y="36"/>
</Size>
<Anchors>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Anchors>
<Animations>
<AnimationGroup parentKey="newitemglowAnim" setToFinalAlpha="true">
<Alpha childKey="NewItemTexture" smoothing="NONE" duration="1" order="1" fromAlpha="1" toAlpha="0.4"/>
<Alpha childKey="NewItemTexture" smoothing="NONE" duration="1" order="2" fromAlpha="0.4" toAlpha="1"/>
<Alpha childKey="NewItemTexture" smoothing="NONE" duration="1" order="3" fromAlpha="1" toAlpha="0"/>
<Scripts>
<OnFinished>
local icon = self:GetParent()
local bar = icon:GetParent():GetParent()
OmniBar_UpdateBorder(bar, icon)
</OnFinished>
</Scripts>
</AnimationGroup>
<AnimationGroup parentKey="flashAnim" setToFinalAlpha="true">
<Alpha childKey="flash" smoothing="OUT" duration="1" order="1" fromAlpha="1" toAlpha="0"/>
</AnimationGroup>
</Animations>
<NormalTexture name="$parentNormalTexture" parentKey="NormalTexture">
<Anchors>
<Anchor point="TOPLEFT" x="-15" y="15"/>
<Anchor point="BOTTOMRIGHT" x="15" y="-15"/>
</Anchors>
</NormalTexture>
<HighlightTexture/>
<PushedTexture/>
<Layers>
<Layer level="OVERLAY" textureSubLevel="1">
<FontString name="$parentName" parentKey="Name" inherits="OmniBarFont">
<Size>
<AbsDimension x="36" y="10"/>
</Size>
<FontHeight>
<AbsValue val="6"/>
</FontHeight>
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture parentKey="flash" hidden="false" alpha="0" alphaMode="ADD" atlas="bags-glow-flash" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Texture>
<Texture parentKey="NewItemTexture" alpha="0" alphaMode="ADD" atlas="bags-glow-blue" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Texture>
</Layer>
<Layer level="BACKGROUND" textureSubLevel="-1">
<Texture parentKey="TargetTexture" alpha="0" alphaMode="ADD" atlas="bags-glow-purple" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Texture>
<Texture parentKey="FocusTexture" alpha="0" alphaMode="ADD" atlas="bags-glow-white" useAtlasSize="true">
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK" textureSubLevel="2">
<FontString name="$parentCount" inherits="NumberFontNormal" parentKey="Count" justifyH="RIGHT">
<Anchors>
<Anchor point="BOTTOMRIGHT" x="-2" y="2"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Cooldown name="$parentCooldown" inherits="CooldownFrameTemplate" parentKey="cooldown" reverse="true" drawBling="false" drawEdge="false" hidden="true">
<Size x="36" y="36"/>
<Anchors>
<Anchor point="CENTER" x="0" y="-1"/>
</Anchors>
<SwipeTexture childKey="swipeTexture">
<Color r="1" g="1" b="1" a="0.65"/>
</SwipeTexture>
<Scripts>
<OnLoad>
LibStub("AceTimer-3.0"):Embed(self)
local GetTime = GetTime
self.OmniBar_CooldownFinish = OmniBar_CooldownFinish
local origSetCooldown = self.SetCooldown
self.SetCooldown = function(self, start, duration, charges, maxCharges)
if self.timer then
self:CancelTimer(self.timer)
self.timer = nil
end
self.duration = duration
self.start = start
origSetCooldown(self, start, duration, charges, maxCharges)
if duration > 0 then
local now = GetTime()
local timeLeft = start + duration - now
self.timer = self:ScheduleTimer("OmniBar_CooldownFinish", timeLeft, self)
else
OmniBar_CooldownFinish(self)
end
end
self.GetCooldownTimes = function(self)
if GetTime() >= self.start + self.duration then
return 0, 0
end
return self.start, self.duration
end
</OnLoad>
<OnHide>
</OnHide>
<OnHide function="OmniBar_CooldownFinish"/>
</Scripts>
</Cooldown>
</Frames>
<Scripts>
<OnEnter>
local bar = self:GetParent():GetParent()
if not bar.settings.tooltips or self:GetAlpha() == 0 then return end
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetSpellByID(self.spellID)
</OnEnter>
<OnLeave>
GameTooltip:Hide()
</OnLeave>
<OnShow>
local bar = self:GetParent():GetParent()
table.insert(bar.active, self)
OmniBar_Position(bar)
OmniBar_UpdateAllBorders(bar)
</OnShow>
<OnHide>
local bar = self:GetParent():GetParent()
for i = 1, #bar.active do
if bar.active[i] == self then
table.remove(bar.active, i)
break
end
end
OmniBar_Position(bar)
</OnHide>
<OnMouseDown>
local bar = self:GetParent():GetParent()
if button == "LeftButton" and not bar.settings.locked then
OmniBar_Center(bar)
bar:StartMoving()
end
</OnMouseDown>
<OnMouseUp>
local bar = self:GetParent():GetParent()
if button == "LeftButton" and not bar.settings.locked then
bar:StopMovingOrSizing()
OmniBar_SavePosition(bar)
LibStub("AceConfigRegistry-3.0"):NotifyChange("OmniBar")
end
</OnMouseUp>
</Scripts>
</Button>
</Ui>