-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNugPlateAuras.lua
682 lines (574 loc) · 21.1 KB
/
NugPlateAuras.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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
local addonName, ns = ...
local NugPlateAuras = CreateFrame("Frame", "NugPlateAuras", UIParent)
NugPlateAuras:SetScript("OnEvent", function(self, event, ...)
return self[event](self, event, ...)
end)
local isClassic = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
local isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
local db
local LibAuraTypes
local LibSpellLocks
local LibCustomGlow
local LibClassicDurations
local Masque = LibStub("Masque", true)
local MasqueGroup
NugPlateAuras:RegisterEvent("ADDON_LOADED")
local GetAuraDataByIndex = C_UnitAuras.GetAuraDataByIndex
local UnpackAuraData = AuraUtil.UnpackAuraData
local DeprecatedUnitAura = function(unitToken, index, filter)
local auraData = GetAuraDataByIndex(unitToken, index, filter);
if not auraData then
return nil;
end
return UnpackAuraData(auraData);
end
local UnitAura = DeprecatedUnitAura
local activePlateUnits = {}
local PlateGUIDtoUnit = {}
local BUFF_PRIORITY_THRESHOLD
local DEBUFF_PRIORITY_THRESHOLD
local defaults = {
profile = {
enableMasque = false,
enableBuffGains = true,
splitAuras = true,
staticSize = false,
buffs = {
attachPoint = "RIGHT",
auraGrowth = "RIGHT",
maxAuras = 3,
priorityThreshold = 50,
auraSize = 21,
auraGap = 2,
npOffsetX = 5,
npOffsetY = 0,
},
debuffs = {
attachPoint = "TOP",
auraGrowth = "RIGHT",
maxAuras = 3,
priorityThreshold = 50,
priorityThresholdPVE = 50,
auraSize = 25,
auraGap = 2,
npOffsetX = 0,
npOffsetY = 10,
},
buffGains = {
auraSize = 25,
npOffsetX = 0,
npOffsetY = -25,
},
}
}
function NugPlateAuras.ADDON_LOADED(self,event,arg1)
if arg1 == addonName then
NugPlateAurasDB = NugPlateAurasDB or {}
self:DoMigrations(NugPlateAurasDB)
self.db = LibStub("AceDB-3.0"):New("NugPlateAurasDB", defaults, "Default") -- Create a DB using defaults and using a shared default profile
db = self.db
self.db.RegisterCallback(self, "OnProfileChanged", "Reconfigure")
self.db.RegisterCallback(self, "OnProfileCopied", "Reconfigure")
self.db.RegisterCallback(self, "OnProfileReset", "Reconfigure")
LibAuraTypes = LibStub("LibAuraTypes")
LibSpellLocks = LibStub("LibSpellLocks")
LibCustomGlow = LibStub("LibCustomGlow-1.0")
if isClassic then
LibClassicDurations = LibStub("LibClassicDurations")
LibClassicDurations:Register(addonName)
UnitAura = LibClassicDurations.UnitAuraWithBuffs
LibClassicDurations.RegisterCallback(self, "UNIT_BUFF", function(event, unit)
self:UNIT_AURA(event, unit)
end)
end
if db.profile.enableBuffGains then
if isClassic then
LibClassicDurations.RegisterCallback(self, "UNIT_BUFF_GAINED", function(event, unit, spellID)
self:UNIT_AURA_GAINED(event, unit, spellID, "BUFF")
end)
else
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end
end
-- PRIORITY_THRESHOLD = LibAuraTypes.GetDebuffTypePriority("SILENCE")
LibSpellLocks.RegisterCallback(self, "UPDATE_INTERRUPT", function(event, guid)
local unit = PlateGUIDtoUnit[guid]
if unit then
self:UNIT_AURA(event, unit)
end
end)
if Masque and db.profile.enableMasque then
ns.MasqueGroup = Masque:Group(addonName, "NugPlateAuras")
end
self:UpdateThreshold()
self:RegisterEvent("NAME_PLATE_CREATED")
self:RegisterEvent("NAME_PLATE_UNIT_ADDED")
self:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
self:RegisterEvent("PLAYER_ENTERING_WORLD") -- check instance info
self:RegisterEvent("UNIT_AURA")
SLASH_NUGPLATEAURAS1 = "/nugplateauras"
SLASH_NUGPLATEAURAS2 = "/npa"
SlashCmdList["NUGPLATEAURAS"] = self.SlashCmd
NugPlateAuras:HookOptionsFrame()
end
end
function NugPlateAuras:Reconfigure()
NugPlateAuras:ForEachNameplate(NugPlateAuras.ReconfigureHeaders)
end
function NugPlateAuras.NAME_PLATE_CREATED(self, event, np)
if not np.NugPlateHeaders then
np.NugPlateHeaders = {
buffs = self:CreateHeader(np, "buffs"),
debuffs = self:CreateHeader(np, "debuffs"),
}
local headers = np.NugPlateHeaders
if db.profile.enableBuffGains then
np.NugPlateHeaders["buffGains"] = NugPlateAuras:CreateFloatingIconPool(np)
-- np.NugPlateHeaders["buffGains"].auras = {}
end
end
end
function NugPlateAuras.NAME_PLATE_UNIT_ADDED(self, event, unit)
if UnitIsUnit(unit, "player") or UnitReaction(unit, "player") >= 5 then return end
local np = C_NamePlate.GetNamePlateForUnit(unit)
activePlateUnits[unit] = true
PlateGUIDtoUnit[UnitGUID(unit)] = unit
self:UNIT_AURA(event, unit)
-- if not np.NugPlateHeaders then
-- self:CreateHeader(np)
-- end
end
function NugPlateAuras.NAME_PLATE_UNIT_REMOVED(self, event, unit)
local np = C_NamePlate.GetNamePlateForUnit(unit)
activePlateUnits[unit] = nil
PlateGUIDtoUnit[UnitGUID(unit)] = nil
if np.NugPlateHeaders then
for headerType, hdr in pairs(np.NugPlateHeaders) do
if hdr.auras then
for _, aura in ipairs(hdr.auras) do
aura:Hide()
end
end
end
end
end
local PlateHeader = {}
function PlateHeader.RepositionAuraFrames(hdr)
local dbh = db.profile[hdr.headerType]
local size = dbh.auraSize
local numAuras = #hdr.auras
local _, orientation = ns.Reverse(dbh.auraGrowth)
local p1 = ns.Reverse(dbh.auraGrowth)
local vJustPoint = dbh.attachPoint == "TOP" and "BOTTOM" or "TOP"
local p2 = orientation == "VERTICAL" and "LEFT" or vJustPoint
local p = orientation == "VERTICAL" and p1..p2 or p2..p1
local mp = ns.Reverse(p, orientation)
local xgap = orientation == "HORIZONTAL" and dbh.auraGap or 0
xgap = dbh.auraGrowth == "RIGHT" and xgap or -xgap
local ygap = orientation == "VERTICAL" and dbh.auraGap or 0
ygap = dbh.auraGrowth == "TOP" and ygap or -ygap
for i=1, numAuras do
local btn = hdr.auras[i]
btn:ClearAllPoints()
btn:SetSize(size, size)
if i > 1 then
local prev = hdr.auras[i-1]
btn:SetPoint(p, prev, mp, xgap, ygap)
else
btn:SetPoint(p, hdr, p, 0, 0)
end
end
end
function PlateHeader.AddAura(hdr, auraFrame)
table.insert(hdr.auras, auraFrame)
hdr:RepositionAuraFrames()
end
function PlateHeader.Reconfigure(hdr, unit)
local headerType = hdr.headerType
local dbh = db.profile[headerType]
local curMax = dbh.maxAuras
local numAuras = #hdr.auras
if numAuras > curMax then
for i=curMax, #hdr.auras do
hdr.auras[i]:Hide()
end
end
hdr:ClearAllPoints()
hdr:SetPoint(ns.Reverse(dbh.attachPoint), hdr:GetParent(), dbh.attachPoint, dbh.npOffsetX, dbh.npOffsetY)
hdr:RepositionAuraFrames()
NugPlateAuras:UNIT_AURA(nil, unit)
end
function NugPlateAuras:CreateHeader(parent, headerType)
local htu = string.upper(headerType)
local hdr = CreateFrame("Frame", "$parentNPAHeader"..htu, parent)
Mixin(hdr, PlateHeader)
local dbh = db.profile[headerType]
hdr.headerType = headerType
-- local t = hdr:CreateTexture("ARTWORK")
-- t:SetTexture("Interface\\BUTTONS\\WHITE8X8")
-- t:SetAllPoints(hdr)
hdr:SetSize(10,10)
if dbh.attachPoint == "TOP" then
-- hdr:SetPoint("BOTTOM", parent, "TOP", dbh.npOffsetX, dbh.npOffsetY)
hdr:SetPoint(ns.Reverse(dbh.attachPoint), parent, dbh.attachPoint, dbh.npOffsetX, dbh.npOffsetY)
else
hdr:SetPoint(ns.Reverse(dbh.attachPoint), parent, dbh.attachPoint, dbh.npOffsetX, dbh.npOffsetY)
end
hdr.auras = { }
return hdr
end
if C_Spell.GetSpellInfo then
local C_Spell_GetSpellInfo = C_Spell.GetSpellInfo
ns.GetSpellInfo = function(spellId)
local info = C_Spell_GetSpellInfo(spellId)
if info then
return info.name, nil, info.iconID
end
end
ns.GetSpellTexture = C_Spell.GetSpellTexture
else
ns.GetSpellInfo = _G.GetSpellInfo
ns.GetSpellTexture = _G.GetSpellTexture
end
local GetSpellInfo = ns.GetSpellInfo
local function MakeFakeAuraFromID(spellID, filter)
local now = GetTime()
local name, rank, icon, castTime, minRange, maxRange, spellId = GetSpellInfo(spellID)
local duration = nil
local expirationTime = nil
local count = 1
if math.random(4) == 1 then
count = math.random(5)
end
return { name, icon, count, nil, duration, expirationTime, nil, nil, nil, spellID }
end
local FakeAuras
local FakeAuraSlots = {
HARMFUL = {},
HELPFUL = {},
}
local function GenFakeSlots()
if not FakeAuras then
FakeAuras = {
HELPFUL = {
MakeFakeAuraFromID(122470, "HELPFUL"), -- karma
MakeFakeAuraFromID(122278, "HELPFUL"), -- Dampen Harm
MakeFakeAuraFromID(871, "HELPFUL"), -- Shield Wall
MakeFakeAuraFromID(1715, "HELPFUL"), -- Hamstring
MakeFakeAuraFromID(47536, "HELPFUL"), -- Rapture
MakeFakeAuraFromID(194249, "HELPFUL"), -- Voidform
MakeFakeAuraFromID(1044, "HELPFUL"), -- Freedom
MakeFakeAuraFromID(8178, "HELPFUL"), -- Grounding
MakeFakeAuraFromID(5277, "HELPFUL"), -- Evasion
},
HARMFUL = {
MakeFakeAuraFromID(119381, "HARMFUL"), -- Leg sweep
MakeFakeAuraFromID(853, "HARMFUL"), -- Hammer of Justice
MakeFakeAuraFromID(115078, "HARMFUL"), -- Paralysis
MakeFakeAuraFromID(118, "HARMFUL"), -- Polymorph
MakeFakeAuraFromID(23920, "HARMFUL"), -- Spell Reflection
MakeFakeAuraFromID(5246, "HARMFUL"), -- Intimidating Shout
MakeFakeAuraFromID(15487, "HARMFUL"), -- Silence
MakeFakeAuraFromID(64695, "HARMFUL"), -- Earthgrab Totem
}
}
end
local uniqueTable = {}
local filters = { "HELPFUL", "HARMFUL" }
for _, filter in ipairs(filters) do
local stock = FakeAuras[filter]
local auras = FakeAuraSlots[filter]
local num = math.random(3)
table.wipe(auras)
for i=1,num do
local index
local data
repeat
index = math.random(#stock)
data = stock[index]
until not uniqueTable[index]
local now = GetTime()
local duration = math.random(8)+8
data[5] = duration
data[6] = now+duration
uniqueTable[index] = true
table.insert(auras, data)
end
end
end
local function TestUnitAura(unit, index, filter)
local slot = FakeAuraSlots[filter][index]
FAKESLOTS = FakeAuraSlots
if slot then return unpack(slot) end
end
local sortfunc = function(a,b) return a[3] > b[3] end
local ordered = {
buffs = {},
debuffs = {},
}
local orderedAuras = ordered.debuffs
local orderedBuffs = ordered.buffs
local headersMerged = { "debuffs" }
local headersSplit = { "buffs", "debuffs" }
function NugPlateAuras:UNIT_AURA(event, unit)
if activePlateUnits[unit] then
local np = C_NamePlate.GetNamePlateForUnit(unit)
local hdrTable = np.NugPlateHeaders
table.wipe(orderedBuffs)
table.wipe(orderedAuras)
for i=1, 100 do
local name, icon, count, debuffType, duration, expirationTime, caster, _,_, spellID, canApplyAura, isBossAura = UnitAura(unit, i, "HARMFUL")
if not name then break end
local prio, spellType = LibAuraTypes.GetAuraInfo(spellID, "ENEMY")
if prio and prio > DEBUFF_PRIORITY_THRESHOLD then
table.insert(orderedAuras, { "HARMFUL", i, prio})
end
end
for i=1, 100 do
local name, icon, count, debuffType, duration, expirationTime, caster, _,_, spellID, canApplyAura, isBossAura = UnitAura(unit, i, "HELPFUL")
if not name then break end
local prio, spellType = LibAuraTypes.GetAuraInfo(spellID, "ENEMY")
if prio and prio > BUFF_PRIORITY_THRESHOLD then
table.insert(orderedBuffs, { "HELPFUL", i, prio})
end
end
if UnitIsPlayer(unit) then
local isLocked = LibSpellLocks:GetSpellLockInfo(unit)
if isLocked then
table.insert(orderedAuras, { "LibSpellLocks", -1, LibAuraTypes.GetAuraTypePriority("SILENCE", "ENEMY") })
end
end
local headers
if not db.profile.splitAuras then
tAppendAll(orderedAuras, orderedBuffs)
headers = headersMerged
else
headers = headersSplit
table.sort(orderedBuffs, sortfunc)
end
table.sort(orderedAuras, sortfunc)
local enforced_priority
if db.profile.staticSize then
enforced_priority = 70
end
for _, headerType in ipairs(headers) do
local hdr = hdrTable[headerType]
local shown = 0
local headerLength = 0
local dbh = db.profile[headerType]
local AURA_MAX_DISPLAY = dbh.maxAuras
local auras = hdr.auras
for i=1,100 do
if shown == AURA_MAX_DISPLAY then break end
local auraTable = ordered[headerType][i]
if not auraTable then
for j=i,AURA_MAX_DISPLAY do
if auras[j] then auras[j]:Hide()
else break end
end
break
end
local filter, index, priority = unpack(auraTable)
local name, icon, count, debuffType, duration, expirationTime, _, _,_, spellID
if index == -1 then
spellID, name, icon, duration, expirationTime = LibSpellLocks:GetSpellLockInfo(unit)
count = 0
else
name, icon, count, debuffType, duration, expirationTime, _, _,_, spellID = UnitAura(unit, index, filter)
end
local btn = auras[i]
if not btn then
if dbh.enableMasque then
btn = self:CreateMirrorButton(hdr, dbh, i)
else
btn = self:CreateSimpleButton(hdr, dbh, i)
end
hdr:AddAura(btn)
end
btn.icon:SetTexture(icon)
btn.cooldown:SetCooldown(expirationTime-duration, duration)
btn.stacktext:SetText(count > 1 and count or nil)
priority = enforced_priority or priority
local scale = 0.8 + 1.2*priority/100
btn:SetScale(scale)
if priority >= 90 then
-- LibCustomGlow.AutoCastGlow_Start(btn,{1,1,1,1}, 12, 0.3, 0.7, 0, 0, nil, nil )
local thickness = 2
local freq = 0.3
local length = 1
LibCustomGlow.PixelGlow_Start(btn,{1,1,1,1}, 12, freq, length, thickness, 0, 0, nil, nil )
else
-- LibCustomGlow.AutoCastGlow_Stop(btn)
LibCustomGlow.PixelGlow_Stop(btn)
end
btn:Show()
headerLength = headerLength + (dbh.auraSize*scale)
if shown > 0 then
headerLength = headerLength + dbh.auraGap
end
shown = shown + 1
end
if shown > 0 then
local _, orientation = ns.Reverse(dbh.auraGrowth)
if orientation == "HORIZONTAL" then
hdr:SetWidth(headerLength)
hdr:SetHeight(10)
else
hdr:SetHeight(headerLength)
hdr:SetWidth(10)
end
-- hdr:Show()
else
hdr:SetWidth(10)
hdr:SetHeight(10)
-- hdr:Hide()
end
end
end
end
function NugPlateAuras:ForEachNameplate(func)
for unit in pairs(activePlateUnits) do
local np = C_NamePlate.GetNamePlateForUnit(unit)
if np then
func(unit, np)
end
end
end
function NugPlateAuras.ReconfigureHeaders(unit, np)
local headers = np.NugPlateHeaders
for headerType, hdr in pairs(headers) do
hdr:Reconfigure(unit)
end
if not NugPlateAuras.db.profile.splitAuras then
headers.buffs:Hide()
else
headers.buffs:Show()
end
end
function NugPlateAuras:UpdateThreshold()
local _, instanceType = GetInstanceInfo()
local isPVPInstance = instanceType == "pvp" or instanceType == "arena"
local isPVEInstance = instanceType == "party" or instanceType == "raid"
local isWarModeOn
if instanceType == "none" then
if isRetail then
isWarModeOn = C_PvP.IsWarModeActive()
else
isWarModeOn = true -- always on in classic
end
end
local isPVP = isPVPInstance or isWarModeOn
local db_buffs = db.profile["buffs"]
local db_debuffs = db.profile["debuffs"]
BUFF_PRIORITY_THRESHOLD = db_buffs.priorityThreshold
DEBUFF_PRIORITY_THRESHOLD = isPVP and db_debuffs.priorityThreshold or db_debuffs.priorityThresholdPVE
end
function NugPlateAuras:PLAYER_ENTERING_WORLD()
self:UpdateThreshold()
end
function NugPlateAuras.UpdateAuras(unit, np)
NugPlateAuras:UNIT_AURA(nil, unit)
end
-- Only for Retail
function NugPlateAuras:COMBAT_LOG_EVENT_UNFILTERED(event)
local timestamp, eventType, hideCaster,
srcGUID, srcName, srcFlags, srcFlags2,
dstGUID, dstName, dstFlags, dstFlags2,
spellID, spellName, spellSchool, auraType = CombatLogGetCurrentEventInfo()
local PlateUnit = PlateGUIDtoUnit[dstGUID]
if PlateUnit then
if eventType == "SPELL_AURA_APPLIED" or eventType == "SPELL_AURA_REFRESH" then
if auraType == "BUFF" then
self:UNIT_AURA_GAINED(event, PlateUnit, spellID, auraType)
end
end
end
end
local sampleBuffsIDs = { 17, 122470, 336126, 336135, 122278, 871, 1715, 47536, 194249, 1044, 8178, 5277, }
function NugPlateAuras:TestFloatingIcons()
local unit
for i=1,20 do
unit = "nameplate"..i
if UnitExists(unit) and UnitReaction(unit, "player") < 5 then break end
end
self:UNIT_AURA_GAINED(nil, unit, sampleBuffsIDs[math.random(#sampleBuffsIDs)], "BUFF")
end
function NugPlateAuras:TestAuras()
local unit
for i=1,20 do
unit = "nameplate"..i
if UnitExists(unit) and UnitReaction(unit, "player") < 5 then break end
end
UnitAura = TestUnitAura
GenFakeSlots()
self:UNIT_AURA(nil, unit)
UnitAura = _G.UnitAura
end
function NugPlateAuras:UNIT_AURA_GAINED(event, unit, spellID, auraType)
if activePlateUnits[unit] then
local np = C_NamePlate.GetNamePlateForUnit(unit)
local headers = np.NugPlateHeaders
local f, isNew = headers.buffGains.pool:Acquire()
if spellID == 336126 or spellID == 336135 then -- medallion and adaptation
f:SetScale(2)
else
f:SetScale(1)
end
local name, _, texture = GetSpellInfo(spellID)
f.icon:SetTexture(texture)
f:Show()
f.ag:Play()
end
end
function NugPlateAuras:SpawnIconLine(unit)
self:CreateLastSpellIconLine()
self:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", unit)
return self
end
local helpMessage = {
"|cff00ff00/npa gui|r",
}
local function InterfaceOptionsFrame_OpenToCategory(categoryIDOrFrame)
if type(categoryIDOrFrame) == "table" then
local categoryID = categoryIDOrFrame.name;
return Settings.OpenToCategory(categoryID);
else
return Settings.OpenToCategory(categoryIDOrFrame);
end
end
NugPlateAuras.Commands = {
["gui"] = function(v)
if not NugPlateAuras.optionsPanel then
NugPlateAuras.optionsPanel = NugPlateAuras:CreateGUI()
end
InterfaceOptionsFrame_OpenToCategory("NugPlateAuras")
InterfaceOptionsFrame_OpenToCategory("NugPlateAuras")
end,
}
function NugPlateAuras.SlashCmd(msg)
local k,v = string.match(msg, "([%w%+%-%=]+) ?(.*)")
if not k or k == "help" then
print("Usage:")
for k,v in ipairs(helpMessage) do
print(" - ",v)
end
end
if NugPlateAuras.Commands[k] then
NugPlateAuras.Commands[k](v)
end
end
function NugPlateAuras:HookOptionsFrame()
CreateFrame('Frame', nil, SettingsPanel or InterfaceOptionsFrame):SetScript('OnShow', function(frame)
frame:SetScript('OnShow', nil)
if not self.optionsPanel then
self.optionsPanel = self:CreateGUI()
end
end)
end
ns.L = setmetatable({}, {
__index = function(t, k)
-- print(string.format('L["%s"] = ""',k:gsub("\n","\\n")));
return k
end,
__call = function(t,k) return t[k] end,
})