-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStart.lua
262 lines (220 loc) · 5.55 KB
/
Start.lua
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
251
252
253
254
255
256
257
258
259
260
261
262
--------------- Frames and Funktionallity ---------------
function MPOWA:CreateSave(i)
self.SAVE[i] = {
texture = "Interface\\AddOns\\zzzModifiedPowerAuras\\images\\dummy.tga",
alpha = 1,
size = 0.75,
x = 0,
y = -30,
buffname = "",
isdebuff = false,
timer = false,
inverse = false,
used = false,
test = false,
cooldown = false,
enemytarget = false,
friendlytarget = false,
stacks = ">=0",
targetduration = 0,
alive = 0,
mounted = 0,
incombat = 0,
inparty = 0,
inraid = 0,
inbattleground = 0,
fontalpha = 1,
fontoffsetx = 0,
fontoffsety = 0,
fontsize = 1.5,
hundredth = false,
usefontcolor = false,
fontcolor_r = 1,
fontcolor_g = 1,
fontcolor_b = 1,
usebeginsound = false,
beginsound = 1,
useendsound = false,
endsound = 1,
raidgroupmember = false,
exactname = false,
flashanim = false,
flashanimstart = 5,
unit = "player",
rgmname = "",
icon_r = 1,
icon_b = 1,
icon_g = 1,
secsleft = false,
secsleftdur = 0,
inraidinstance = 0,
hidestacks = false,
secondspecifier = false,
secondspecifiertext = "",
animduration = 0.5,
translateoffsetx = 50,
translateoffsety = 50,
fadealpha = 0.99,
scalefactor = 0.8,
isdynamicgroup = false,
groupnumber = 0,
cpstacks = ">=0",
castbyme = false,
dynamicsorted = false,
dynamiccenter = false,
dynamicorientation = 1,
timerfont = 1,
dynamicspacing = 5,
blendmode = 1,
minutes = false,
timerfontsize = 1,
}
end
function MPOWA:Init()
self.SAVE = table.copy(MPOWA_SAVE or {}, true)
MPowa_Tooltip:SetOwner(UIParent, "ANCHOR_NONE")
SLASH_MPOWA1 = "/mpowa"
SlashCmdList["MPOWA"] = function(msg)
if MPowa_MainFrame:IsVisible() then
MPowa_MainFrame:Hide()
else
self:Show()
end
end
if self.SAVE == nil then
self.SAVE = {}
self:CreateSave(1)
end
if MPOWA_PROFILE == nil then
MPOWA_PROFILE = {}
end
for cat, val in pairs(self.SAVE) do
if val["used"] or (self.SAVE[cat+1] and self.SAVE[cat+1]["used"]) then
if not self.frames[cat] then
self.frames[cat] = {}
end
if not self.auras[val["buffname"]] then
self.auras[val["buffname"]] = {}
end
tinsert(self.auras[val["buffname"]], cat)
if (val["inverse"] or val["cooldown"]) and val["buffname"] ~= "unitpower" then
self.NeedUpdate[cat] = true
end
if val["enemytarget"] or val["friendlytarget"] then
self.SAVE[cat]["unit"] = "target"
else
self.SAVE[cat]["unit"] = nil
end
if val["used"] then
self.NumBuffs = self.NumBuffs + 1
end
if val["rgmname"] then
self.RaidGroupMembers[val["rgmname"]] = true
end
if not val["secsleftdur"] or val["secsleftdur"] == "" then
self.SAVE[cat]["secsleftdur"] = 0
end
if not val["inraidinstance"] then
self.SAVE[cat]["inraidinstance"] = 0
end
if not val["secondspecifiertext"] then
self.SAVE[cat]["secondspecifiertext"] = ""
end
-- Initializing animations
if not val["animduration"] then
self.SAVE[cat]["animduration"] = 0.5
end
if not val["translateoffsetx"] then
self.SAVE[cat]["translateoffsetx"] = 50
end
if not val["translateoffsety"] then
self.SAVE[cat]["translateoffsety"] = 50
end
if not val["fadealpha"] then
self.SAVE[cat]["fadealpha"] = 0.99
end
if not val["scalefactor"] then
self.SAVE[cat]["scalefactor"] = 0.8
end
if not val["dynamicorientation"] then
self.SAVE[cat]["dynamicorientation"] = 1
end
if not val["timerfont"] then
self.SAVE[cat]["timerfont"] = 1
end
if not val["dynamicspacing"] then
self.SAVE[cat]["dynamicspacing"] = 5
end
if not val["blendmode"] then
self.SAVE[cat]["blendmode"] = 1
end
if not val["timerfontsize"] then
self.SAVE[cat]["timerfontsize"] = 1
end
self:CreateIcon(cat, cat)
self:ApplyConfig(cat)
if val["flashanim"] then
self:AddAnimFlash(cat)
end
if val["growout"] then
self:AddAnimGrowOut(cat)
end
if val["growin"] then
self:AddAnimGrowIn(cat)
end
if val["fadeout"] then
self:AddAnimFadeOut(cat)
end
if val["fadein"] then
self:AddAnimFadeIn(cat)
end
if val["escapeanimout"] then
self:AddAnimEscapeOut(cat)
end
if val["escapeanimin"] then
self:AddAnimEscapeIn(cat)
end
if val["shrinkanim"] then
self:AddAnimShrink(cat)
end
if val["sizeanim"] then
self:AddAnimSizeIn(cat)
end
if val["translateanim"] then
self:AddAnimTranslate(cat)
end
if val["rotateanimout"] then
self:AddAnimRotateOut(cat)
end
if val["rotateanimin"] then
self:AddAnimRotateIn(cat)
end
if val["batmananimout"] then
self:AddAnimRotateShrinkFadeOut(cat)
end
if val["batmananimin"] then
self:AddAnimRotateShrinkFadeIn(cat)
end
if not val["cpstacks"] then
self.SAVE[cat]["cpstacks"] = ">=0"
end
self.SAVE[cat]["test"] = false
end
end
self.testAll = false
end
--------------- Post Init --------------------------
MPOWA:RegisterEvent("VARIABLES_LOADED")
MPOWA:RegisterEvent("UNIT_AURA")
MPOWA:RegisterEvent("PLAYER_TARGET_CHANGED")
MPOWA:RegisterEvent("RAID_ROSTER_UPDATE")
MPOWA:RegisterEvent("PARTY_MEMBERS_CHANGED")
MPOWA:RegisterEvent("PLAYER_AURAS_CHANGED")
MPOWA:RegisterEvent("PLAYER_REGEN_DISABLED")
MPOWA:RegisterEvent("PLAYER_REGEN_ENABLED")
MPOWA:RegisterEvent("UNIT_MANA")
MPOWA:RegisterEvent("UNIT_RAGE")
MPOWA:RegisterEvent("UNIT_ENERGY")
MPOWA:RegisterEvent("PLAYER_LOGOUT")
MPOWA:SetScript("OnUpdate", function() MPOWA:OnUpdate(arg1) end)
MPOWA:SetScript("OnEvent", function() MPOWA:OnEvent(event, arg1) end)