-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathauras.lua
1109 lines (898 loc) · 42.5 KB
/
auras.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
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---@type detailsframework
local DF = _G ["DetailsFramework"]
if (not DF or not DetailsFrameworkCanLoad) then
return
end
local detailsFramework = DF
local _
local tinsert = table.insert
local GetSpellInfo = GetSpellInfo or function(spellID) if not spellID then return nil end local si = C_Spell.GetSpellInfo(spellID) if si then return si.name, nil, si.iconID, si.castTime, si.minRange, si.maxRange, si.spellID, si.originalIconID end end
local lower = string.lower
local SpellBookItemTypeMap = Enum.SpellBookItemType and {[Enum.SpellBookItemType.Spell] = "SPELL", [Enum.SpellBookItemType.None] = "NONE", [Enum.SpellBookItemType.Flyout] = "FLYOUT", [Enum.SpellBookItemType.FutureSpell] = "FUTURESPELL", [Enum.SpellBookItemType.PetAction] = "PETACTION" } or {}
local GetSpellBookItemInfo = GetSpellBookItemInfo or function(...) local si = C_SpellBook.GetSpellBookItemInfo(...) if si then return SpellBookItemTypeMap[si.itemType] or "NONE", (si.itemType == Enum.SpellBookItemType.Flyout or si.itemType == Enum.SpellBookItemType.PetAction) and si.actionID or si.spellID or si.actionID, si end end
local SPELLBOOK_BANK_PLAYER = Enum.SpellBookSpellBank and Enum.SpellBookSpellBank.Player or "player"
local GetNumSpellTabs = GetNumSpellTabs or C_SpellBook.GetNumSpellBookSkillLines
local GetSpellTabInfo = GetSpellTabInfo or function(tabLine) local skillLine = C_SpellBook.GetSpellBookSkillLineInfo(tabLine) if skillLine then return skillLine.name, skillLine.iconID, skillLine.itemIndexOffset, skillLine.numSpellBookItems, skillLine.isGuild, skillLine.offSpecID end end
local unpack = unpack
local CreateFrame = CreateFrame
local GameTooltip = GameTooltip
local tremove = table.remove
local CONST_MAX_SPELLS = 500000
function DF:GetAuraByName(unit, spellName, isDebuff)
isDebuff = isDebuff and "HARMFUL|PLAYER"
for i = 1, 40 do
local name, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellId, canApplyAura, isBossDebuff, isCastByPlayer, nameplateShowAll = UnitAura(unit, i, isDebuff)
if (not name) then
return
end
if (name == spellName) then
return name, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellId, canApplyAura, isBossDebuff, isCastByPlayer, nameplateShowAll
end
end
end
local defaultTextForAuraFrame = {
AUTOMATIC = "Automatic",
MANUAL = "Manual",
METHOD = "Aura Tracking Method:",
BUFFS_IGNORED = "Buffs Ignored",
DEBUFFS_IGNORED = "Debuffs Ignored",
BUFFS_TRACKED = "Buffs Tracked",
DEBUFFS_TRACKED = "Debuffs Tracked",
AUTOMATIC_DESC = "Auras are being tracked automatically, the addon controls what to show.\nYou may add auras to the blacklist or add extra auras to track.",
MANUAL_DESC = "Auras are being tracked manually, the addon only check for auras you entered below.",
MANUAL_ADD_BLACKLIST_BUFF = "Add Buff to Blacklist",
MANUAL_ADD_BLACKLIST_DEBUFF = "Add Debuff to Blacklist",
MANUAL_ADD_TRACKLIST_BUFF = "Add Buff to Tracklist",
MANUAL_ADD_TRACKLIST_DEBUFF = "Add Debuff to Tracklist",
}
--store spell caches, they load empty and are filled when an addon require a cache with all spells
local spellsHashMap
local spellsIndexTable
local spellsWithSameName
function DF:GetSpellCaches()
return spellsHashMap, spellsIndexTable, spellsWithSameName
end
local lazyLoadAllSpells = function(payload, iterationCount, maxIterations)
local startPoint = payload.nextIndex
--the goal is iterate over 500000 spell ids over 200 frames
local endPoint = startPoint + 2500
payload.nextIndex = endPoint
local i = startPoint + 1
--make upvalues be closer
local toLowerCase = string.lower
local GetSpellInfo = GetSpellInfo
local hashMap = payload.hashMap
local indexTable = payload.indexTable
local allSpellsSameName = payload.allSpellsSameName
while (i < endPoint) do
local spellName = GetSpellInfo(i)
if (spellName) then
spellName = toLowerCase(spellName)
hashMap[spellName] = i --[spellname] = spellId
indexTable[#indexTable+1] = spellName --array with all spellnames
local spellNameTable = allSpellsSameName[spellName]
if (not spellNameTable) then
spellNameTable = {}
allSpellsSameName[spellName] = spellNameTable
end
spellNameTable[#spellNameTable+1] = i
end
i = i + 1
end
end
function DF:UnloadSpellCache()
if (spellsHashMap) then
table.wipe(spellsHashMap)
table.wipe(spellsIndexTable)
table.wipe(spellsWithSameName)
end
end
function DF:LoadSpellCache(hashMap, indexTable, allSpellsSameName)
if (spellsHashMap and next(spellsHashMap)) then
--return the already loaded cache
return spellsHashMap, spellsIndexTable, spellsWithSameName
end
assert(type(hashMap) == "table", "DetailsFramework:LoadSpellCache(): require a table on #1 parameter.")
assert(type(indexTable) == "table", "DetailsFramework:LoadSpellCache(): require a table on #2 parameter.")
assert(type(allSpellsSameName) == "table", "DetailsFramework:LoadSpellCache(): require a table on #3 parameter.")
spellsHashMap = hashMap
spellsIndexTable = indexTable
spellsWithSameName = allSpellsSameName
local iterations = 200
local payload = {
nextIndex = 0,
hashMap = hashMap,
indexTable = indexTable,
allSpellsSameName = allSpellsSameName,
}
detailsFramework.Schedules.LazyExecute(lazyLoadAllSpells, payload, iterations)
return spellsHashMap, spellsIndexTable, spellsWithSameName
end
do
local metaPrototype = {
WidgetType = "aura_tracker",
dversion = DF.dversion,
}
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["aura_tracker"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames["aura_tracker"]]
--check if is older
if ((not oldMetaPrototype.dversion) or(oldMetaPrototype.dversion < DF.dversion) ) then
--the version is older them the currently loading one
--copy the new values into the old metatable
for funcName, _ in pairs(metaPrototype) do
oldMetaPrototype[funcName] = metaPrototype[funcName]
end
end
else
--first time loading the framework
_G[DF.GlobalWidgetControlNames["aura_tracker"]] = metaPrototype
end
end
local AuraTrackerMetaFunctions = _G[DF.GlobalWidgetControlNames["aura_tracker"]]
DF:Mixin(AuraTrackerMetaFunctions, DF.ScriptHookMixin)
--create panels
local onProfileChangedCallback = function(self, newdb)
self.db = newdb
--automatic
self.buff_ignored:SetData(newdb.aura_tracker.buff_banned)
self.debuff_ignored:SetData(newdb.aura_tracker.debuff_banned)
self.buff_tracked:SetData(newdb.aura_tracker.buff_tracked)
self.debuff_tracked:SetData(newdb.aura_tracker.debuff_tracked)
self.buff_ignored:Refresh()
self.debuff_ignored:Refresh()
self.buff_tracked:Refresh()
self.debuff_tracked:Refresh()
--manual
self.buffs_added:SetData(newdb.aura_tracker.buff)
self.debuffs_added:SetData(newdb.aura_tracker.debuff)
self.buffs_added:Refresh()
self.debuffs_added:Refresh()
--method
if (newdb.aura_tracker.track_method == 0x1) then
self.f_auto:Show()
self.f_manual:Hide()
self.AutomaticTrackingCheckbox:SetValue(true)
self.ManualTrackingCheckbox:SetValue(false)
self.desc_label.text = self.LocTexts.AUTOMATIC_DESC
elseif (newdb.aura_tracker.track_method == 0x2) then
self.f_auto:Hide()
self.f_manual:Show()
self.AutomaticTrackingCheckbox:SetValue(false)
self.ManualTrackingCheckbox:SetValue(true)
self.desc_label.text = self.LocTexts.MANUAL_DESC
end
end
local aura_panel_defaultoptions = {
height = 400,
row_height = 18,
width = 230,
button_text_template = "OPTIONS_FONT_TEMPLATE"
}
function DF:CreateAuraConfigPanel(parent, name, db, changeCallback, options, texts)
local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local newAuraPanel = CreateFrame("frame", name, parent, "BackdropTemplate")
newAuraPanel.db = db
newAuraPanel.OnProfileChanged = onProfileChangedCallback
newAuraPanel.LocTexts = texts
options = options or {}
self.table.deploy(options, aura_panel_defaultoptions)
local auraPanel_Auto = CreateFrame("frame", "$parent_Automatic", newAuraPanel, "BackdropTemplate")
local auraPanel_Manual = CreateFrame("frame", "$parent_Manual", newAuraPanel, "BackdropTemplate")
auraPanel_Auto:SetPoint("topleft", newAuraPanel, "topleft", 0, -24)
auraPanel_Manual:SetPoint("topleft", newAuraPanel, "topleft", 0, -24)
auraPanel_Auto:SetSize(600, 600)
auraPanel_Manual:SetSize(600, 600)
newAuraPanel.f_auto = auraPanel_Auto
newAuraPanel.f_manual = auraPanel_Manual
--check if the texts table is valid and also deploy default values into the table in case some value is nil
texts = (type(texts == "table") and texts) or defaultTextForAuraFrame
DF.table.deploy(texts, defaultTextForAuraFrame)
local onSwitchTrackingMethod = function(self)
local method = self.Method
newAuraPanel.db.aura_tracker.track_method = method
if (changeCallback) then
DF:QuickDispatch(changeCallback)
end
if (method == 0x1) then
auraPanel_Auto:Show()
auraPanel_Manual:Hide()
newAuraPanel.AutomaticTrackingCheckbox:SetValue(true)
newAuraPanel.ManualTrackingCheckbox:SetValue(false)
newAuraPanel.desc_label.text = texts.AUTOMATIC_DESC
elseif (method == 0x2) then
auraPanel_Auto:Hide()
auraPanel_Manual:Show()
newAuraPanel.AutomaticTrackingCheckbox:SetValue(false)
newAuraPanel.ManualTrackingCheckbox:SetValue(true)
newAuraPanel.desc_label.text = texts.MANUAL_DESC
end
end
local methodSelectionBackground = CreateFrame("frame", nil, newAuraPanel, "BackdropTemplate")
methodSelectionBackground:SetHeight(82)
methodSelectionBackground:SetPoint("topleft", newAuraPanel, "topleft", 0, 0)
methodSelectionBackground:SetPoint("topright", newAuraPanel, "topright", 0, 0)
DF:ApplyStandardBackdrop(methodSelectionBackground)
local trackingMethodLabel = self:CreateLabel(methodSelectionBackground, texts.METHOD, 12, "orange")
trackingMethodLabel:SetPoint("topleft", methodSelectionBackground, "topleft", 6, -4)
newAuraPanel.desc_label = self:CreateLabel(methodSelectionBackground, "", 10, "silver")
newAuraPanel.desc_label:SetPoint("left", methodSelectionBackground, "left", 130, 0)
newAuraPanel.desc_label:SetJustifyV("top")
local automaticTrackingCheckbox = DF:CreateSwitch(methodSelectionBackground, onSwitchTrackingMethod, newAuraPanel.db.aura_tracker.track_method == 0x1, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, DF:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"))
automaticTrackingCheckbox.Method = 0x1
automaticTrackingCheckbox:SetAsCheckBox()
automaticTrackingCheckbox:SetSize(24, 24)
newAuraPanel.AutomaticTrackingCheckbox = automaticTrackingCheckbox
local automaticTrackingLabel = DF:CreateLabel(methodSelectionBackground, "Automatic")
automaticTrackingLabel:SetPoint("left", automaticTrackingCheckbox, "right", 2, 0)
local manualTrackingCheckbox = DF:CreateSwitch(methodSelectionBackground, onSwitchTrackingMethod, newAuraPanel.db.aura_tracker.track_method == 0x2, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, DF:GetTemplate("switch", "OPTIONS_CHECKBOX_BRIGHT_TEMPLATE"))
manualTrackingCheckbox.Method = 0x2
manualTrackingCheckbox:SetAsCheckBox()
manualTrackingCheckbox:SetSize(24, 24)
newAuraPanel.ManualTrackingCheckbox = manualTrackingCheckbox
local manualTrackingLabel = DF:CreateLabel(methodSelectionBackground, "Manual")
manualTrackingLabel:SetPoint("left", manualTrackingCheckbox, "right", 2, 0)
automaticTrackingCheckbox:SetPoint("topleft", trackingMethodLabel, "bottomleft", 0, -6)
manualTrackingCheckbox:SetPoint("topleft", automaticTrackingCheckbox, "bottomleft", 0, -6)
-------- anchors points
local y = -110
-------- automatic
local setAutoCompleteWordList = function(self, capsule)
if (next(spellsHashMap)) then --this will error if the spell cache isn't loaded with DF:LoadSpellCache(hashMap, indexTable, allSpellsSameName)
auraPanel_Auto.AddBuffBlacklistTextBox.SpellAutoCompleteList = spellsIndexTable
auraPanel_Auto.AddDebuffBlacklistTextBox.SpellAutoCompleteList = spellsIndexTable
auraPanel_Auto.AddBuffTracklistTextBox.SpellAutoCompleteList = spellsIndexTable
auraPanel_Auto.AddDebuffTracklistTextBox.SpellAutoCompleteList = spellsIndexTable
auraPanel_Manual.NewBuffTextBox.SpellAutoCompleteList = spellsIndexTable
auraPanel_Manual.NewDebuffTextBox.SpellAutoCompleteList = spellsIndexTable
auraPanel_Auto.AddBuffBlacklistTextBox:SetAsAutoComplete("SpellAutoCompleteList")
auraPanel_Auto.AddDebuffBlacklistTextBox:SetAsAutoComplete("SpellAutoCompleteList")
auraPanel_Auto.AddBuffTracklistTextBox:SetAsAutoComplete("SpellAutoCompleteList")
auraPanel_Auto.AddDebuffTracklistTextBox:SetAsAutoComplete("SpellAutoCompleteList")
auraPanel_Manual.NewBuffTextBox:SetAsAutoComplete("SpellAutoCompleteList")
auraPanel_Manual.NewDebuffTextBox:SetAsAutoComplete("SpellAutoCompleteList")
auraPanel_Auto.AddBuffBlacklistTextBox.ShouldOptimizeAutoComplete = true
auraPanel_Auto.AddDebuffBlacklistTextBox.ShouldOptimizeAutoComplete = true
auraPanel_Auto.AddBuffTracklistTextBox.ShouldOptimizeAutoComplete = true
auraPanel_Auto.AddDebuffTracklistTextBox.ShouldOptimizeAutoComplete = true
auraPanel_Manual.NewBuffTextBox.ShouldOptimizeAutoComplete = true
auraPanel_Manual.NewDebuffTextBox.ShouldOptimizeAutoComplete = true
end
end
--this set the width of the background box, text entry and button
local textEntryWidth = 120
--create the background
local blacklistAddBackground = CreateFrame("frame", nil, auraPanel_Auto, "BackdropTemplate")
blacklistAddBackground:SetSize(textEntryWidth + 10, 135)
DF:ApplyStandardBackdrop(blacklistAddBackground)
blacklistAddBackground.__background:SetVertexColor(0.47, 0.27, 0.27)
local tracklistAddBackground = CreateFrame("frame", nil, auraPanel_Auto, "BackdropTemplate")
tracklistAddBackground:SetSize(textEntryWidth + 10, 135)
DF:ApplyStandardBackdrop(tracklistAddBackground)
tracklistAddBackground.__background:SetVertexColor(0.27, 0.27, 0.47)
--black list
--create labels
local buffBlacklistLabel = self:CreateLabel(blacklistAddBackground, texts.MANUAL_ADD_BLACKLIST_BUFF, DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
local debuffBlacklistLabel = self:CreateLabel(blacklistAddBackground, texts.MANUAL_ADD_BLACKLIST_DEBUFF, DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
local buffNameBlacklistEntry = self:CreateTextEntry(blacklistAddBackground, function()end, textEntryWidth, 20, "AddBuffBlacklistTextBox", _, _, options_dropdown_template)
buffNameBlacklistEntry:SetHook("OnEditFocusGained", setAutoCompleteWordList)
buffNameBlacklistEntry:SetJustifyH("left")
buffNameBlacklistEntry.tooltip = "Enter the buff name using lower case letters."
auraPanel_Auto.AddBuffBlacklistTextBox = buffNameBlacklistEntry
local debuffNameBlacklistEntry = self:CreateTextEntry(blacklistAddBackground, function()end, textEntryWidth, 20, "AddDebuffBlacklistTextBox", _, _, options_dropdown_template)
debuffNameBlacklistEntry:SetHook("OnEditFocusGained", setAutoCompleteWordList)
debuffNameBlacklistEntry:SetJustifyH("left")
debuffNameBlacklistEntry.tooltip = "Enter the debuff name using lower case letters."
auraPanel_Auto.AddDebuffBlacklistTextBox = debuffNameBlacklistEntry
local getSpellIDFromSpellName = function(spellName)
--check if the user entered a spell ID
local bIsSpellId = tonumber(spellName)
if (bIsSpellId) then
local spellId = tonumber(spellName)
if (spellId and spellId > 1 and spellId < 10000000) then
local isValidSpellID = GetSpellInfo(spellId)
if (isValidSpellID) then
return spellId
else
return
end
end
end
--get the spell ID from the spell name
spellName = lower(spellName)
return spellsHashMap[spellName]
end
local addBuffNameToBacklistButton = self:CreateButton(blacklistAddBackground, function()
local text = buffNameBlacklistEntry.text
buffNameBlacklistEntry:SetText("")
buffNameBlacklistEntry:ClearFocus()
if (text ~= "") then
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = strtrim(spellName)
local spellId = getSpellIDFromSpellName(spellName)
if (spellId) then
newAuraPanel.db.aura_tracker.buff_banned [spellId] = true
else
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found: " .. (spellName or ""))
end
end
else
--get the spellId
local spellId = getSpellIDFromSpellName(text)
if (not spellId) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found!")
return
end
--add the spellName to the blacklist
newAuraPanel.db.aura_tracker.buff_banned [spellId] = true
end
--refresh the buff blacklist frame
newAuraPanel.buff_ignored:Refresh()
DF:QuickDispatch(changeCallback)
end
end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template))
local addBuffIDToBacklistButton = self:CreateButton(blacklistAddBackground, function()
local text = buffNameBlacklistEntry.text
buffNameBlacklistEntry:SetText("")
buffNameBlacklistEntry:ClearFocus()
if (text ~= "") then
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = strtrim(spellName)
if (not tonumber(spellName)) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Invalid Spell-ID: " .. (spellName or ""))
end
local spellId = getSpellIDFromSpellName(spellName)
if (spellId) then
newAuraPanel.db.aura_tracker.buff_banned [spellId] = false
else
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found: " .. (spellName or ""))
end
end
else
if (not tonumber(text)) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Invalid Spell-ID.")
end
--get the spellId
local spellId = getSpellIDFromSpellName(text)
if (not spellId) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found!")
return
end
--add the spellId to the blacklist
newAuraPanel.db.aura_tracker.buff_banned [spellId] = false
end
--refresh the buff blacklist frame
newAuraPanel.buff_ignored:Refresh()
DF:QuickDispatch(changeCallback)
end
end, textEntryWidth/2 -3, 20, "By ID", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template))
local addDebuffNameToBacklistButton = self:CreateButton(blacklistAddBackground, function()
local text = debuffNameBlacklistEntry.text
debuffNameBlacklistEntry:SetText("")
debuffNameBlacklistEntry:ClearFocus()
if (text ~= "") then
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = strtrim(spellName)
local spellId = getSpellIDFromSpellName(spellName)
if (spellId) then
newAuraPanel.db.aura_tracker.debuff_banned [spellId] = true
else
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found: " .. (spellName or ""))
end
end
else
--get the spellId
local spellId = getSpellIDFromSpellName(text)
if (not spellId) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found!")
return
end
--add the spellName to the blacklist
newAuraPanel.db.aura_tracker.debuff_banned [spellId] = true
end
--refresh the buff blacklist frame
newAuraPanel.debuff_ignored:Refresh()
DF:QuickDispatch(changeCallback)
end
end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template))
local addDebuffIDToBacklistButton = self:CreateButton(blacklistAddBackground, function()
local text = debuffNameBlacklistEntry.text
debuffNameBlacklistEntry:SetText("")
debuffNameBlacklistEntry:ClearFocus()
if (text ~= "") then
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = strtrim(spellName)
if (not tonumber(spellName)) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Invalid Spell-ID: " .. (spellName or ""))
end
local spellId = getSpellIDFromSpellName(spellName)
if (spellId) then
newAuraPanel.db.aura_tracker.debuff_banned [spellId] = false
else
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found: " .. (spellName or ""))
end
end
else
if (not tonumber(text)) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Invalid Spell-ID: " .. text)
end
--get the spellId
local spellId = getSpellIDFromSpellName(text)
if (not spellId) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found!")
return
end
--add the spellId to the blacklist
newAuraPanel.db.aura_tracker.debuff_banned [spellId] = false
end
--refresh the buff blacklist frame
newAuraPanel.debuff_ignored:Refresh()
DF:QuickDispatch(changeCallback)
end
end, textEntryWidth/2 -3, 20, "By ID", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template))
--track list
local buffTracklistLabel = self:CreateLabel(tracklistAddBackground, texts.MANUAL_ADD_TRACKLIST_BUFF, DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
local debuffTracklistLabel = self:CreateLabel(tracklistAddBackground, texts.MANUAL_ADD_TRACKLIST_DEBUFF, DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
local buffNameTracklistEntry = self:CreateTextEntry(tracklistAddBackground, function()end, textEntryWidth, 20, "AddBuffTracklistTextBox", _, _, options_dropdown_template)
buffNameTracklistEntry:SetHook("OnEditFocusGained", setAutoCompleteWordList)
buffNameTracklistEntry:SetJustifyH("left")
buffNameTracklistEntry.tooltip = "Enter the buff name using lower case letters."
auraPanel_Auto.AddBuffTracklistTextBox = buffNameTracklistEntry
local debuffNameTracklistEntry = self:CreateTextEntry(tracklistAddBackground, function()end, textEntryWidth, 20, "AddDebuffTracklistTextBox", _, _, options_dropdown_template)
debuffNameTracklistEntry:SetHook("OnEditFocusGained", setAutoCompleteWordList)
debuffNameTracklistEntry:SetJustifyH("left")
debuffNameTracklistEntry.tooltip = "Enter the debuff name using lower case letters."
auraPanel_Auto.AddDebuffTracklistTextBox = debuffNameTracklistEntry
local addDebuffNameToTracklistButton = self:CreateButton(tracklistAddBackground, function()
local text = debuffNameTracklistEntry.text
debuffNameTracklistEntry:SetText("")
debuffNameTracklistEntry:ClearFocus()
if (text ~= "") then
--get the spellId
local spellId = getSpellIDFromSpellName(text)
if (not spellId) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found!")
return
end
--add the spellName to the tracklist
newAuraPanel.db.aura_tracker.debuff_tracked [spellId] = true
--refresh the buff blacklist frame
newAuraPanel.debuff_tracked:Refresh()
DF:QuickDispatch(changeCallback)
end
end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template))
local addDebuffIDToTracklistButton = self:CreateButton(tracklistAddBackground, function()
local text = debuffNameTracklistEntry.text
debuffNameTracklistEntry:SetText("")
debuffNameTracklistEntry:ClearFocus()
if (text ~= "") then
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = strtrim(spellName)
if (not tonumber(spellName)) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Invalid Spell-ID: " .. (spellName or ""))
end
local spellId = getSpellIDFromSpellName(spellName)
if (spellId) then
newAuraPanel.db.aura_tracker.debuff_tracked [spellId] = false
else
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found: " .. (spellName or ""))
end
end
else
if (not tonumber(text)) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Invalid Spell-ID.")
end
--get the spellId
local spellId = getSpellIDFromSpellName(text)
if (not spellId) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found!")
return
end
newAuraPanel.db.aura_tracker.debuff_tracked [spellId] = false
end
--refresh the buff blacklist frame
newAuraPanel.debuff_tracked:Refresh()
DF:QuickDispatch(changeCallback)
end
end, textEntryWidth/2 -3, 20, "By ID", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template))
local addBuffNameToTracklistButton = self:CreateButton(tracklistAddBackground, function()
local text = buffNameTracklistEntry.text
buffNameTracklistEntry:SetText("")
buffNameTracklistEntry:ClearFocus()
if (text ~= "") then
--get the spellId
local spellId = getSpellIDFromSpellName(text)
if (not spellId) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found!")
return
end
--add the spellName to the tracklist
newAuraPanel.db.aura_tracker.buff_tracked [spellId] = true
--refresh the buff tracklist frame
newAuraPanel.buff_tracked:Refresh()
--callback the addon
DF:QuickDispatch(changeCallback)
end
end, textEntryWidth/2 -3, 20, "By Name", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template))
local addBuffIDToTracklistButton = self:CreateButton(tracklistAddBackground, function()
local text = buffNameTracklistEntry.text
buffNameTracklistEntry:SetText("")
buffNameTracklistEntry:ClearFocus()
if (text ~= "") then
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = strtrim(spellName)
if (not tonumber(spellName)) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Invalid Spell-ID: " .. (spellName or ""))
end
local spellId = getSpellIDFromSpellName(spellName)
if (spellId) then
newAuraPanel.db.aura_tracker.buff_tracked [spellId] = false
else
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found: " .. (spellName or ""))
end
end
else
if (not tonumber(text)) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Invalid Spell-ID.")
end
--get the spellId
local spellId = getSpellIDFromSpellName(text)
if (not spellId) then
DetailsFramework.Msg({__name = "DetailsFramework"}, "Spell not found!")
return
end
--add the spellId to the tracklist
newAuraPanel.db.aura_tracker.buff_tracked [spellId] = false
end
--refresh the buff tracklist frame
newAuraPanel.buff_tracked:Refresh()
--callback the addon
DF:QuickDispatch(changeCallback)
end
end, textEntryWidth/2 -3, 20, "By ID", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"), DF:GetTemplate("font", options.button_text_template))
--anchors:
blacklistAddBackground:SetPoint("topleft", auraPanel_Auto, "topleft", 0, y)
tracklistAddBackground:SetPoint("topleft", blacklistAddBackground, "bottomleft", 0, -10)
--debuff blacklist
debuffNameBlacklistEntry:SetPoint("topleft", blacklistAddBackground, "topleft", 5, -20)
debuffBlacklistLabel:SetPoint("bottomleft", debuffNameBlacklistEntry, "topleft", 0, 2)
addDebuffNameToBacklistButton:SetPoint("topleft", debuffNameBlacklistEntry, "bottomleft", 0, -2)
addDebuffIDToBacklistButton:SetPoint("left", addDebuffNameToBacklistButton, "right", 1, 0)
--buff blacklist
buffBlacklistLabel:SetPoint("topleft", addDebuffNameToBacklistButton.widget, "bottomleft", 0, -10)
buffNameBlacklistEntry:SetPoint("topleft", buffBlacklistLabel, "bottomleft", 0, -2)
addBuffNameToBacklistButton:SetPoint("topleft", buffNameBlacklistEntry, "bottomleft", 0, -2)
addBuffIDToBacklistButton:SetPoint("left", addBuffNameToBacklistButton, "right", 1, 0)
--debuff tracklist
debuffNameTracklistEntry:SetPoint("topleft", tracklistAddBackground, "topleft", 5, -20)
debuffTracklistLabel:SetPoint("bottomleft", debuffNameTracklistEntry, "topleft", 0, 2)
addDebuffNameToTracklistButton:SetPoint("topleft", debuffNameTracklistEntry, "bottomleft", 0, -2)
addDebuffIDToTracklistButton:SetPoint("left", addDebuffNameToTracklistButton, "right", 1, 0)
--buff tracklist
buffTracklistLabel:SetPoint("topleft", addDebuffNameToTracklistButton.widget, "bottomleft", 0, -10)
buffNameTracklistEntry:SetPoint("topleft", buffTracklistLabel, "bottomleft", 0, -2)
addBuffNameToTracklistButton:SetPoint("topleft", buffNameTracklistEntry, "bottomleft", 0, -2)
addBuffIDToTracklistButton:SetPoint("left", addBuffNameToTracklistButton, "right", 1, 0)
--options passed to the create aura panel
local width, height, row_height = options.width, options.height, options.row_height
local scrollWidth = 208
local onAuraRemoveCallback = function()
if (changeCallback) then
DF:QuickDispatch(changeCallback)
end
end
options.title_text = texts.DEBUFFS_TRACKED or defaultTextForAuraFrame.DEBUFFS_TRACKED
local debuffTrackedAuraScrollBox = detailsFramework:CreateAuraScrollBox(auraPanel_Auto, "$parentDebuffTracked", newAuraPanel.db.aura_tracker.debuff_tracked, onAuraRemoveCallback, options)
auraPanel_Auto.DebuffTrackerScroll = debuffTrackedAuraScrollBox
options.title_text = texts.BUFFS_IGNORED or defaultTextForAuraFrame.BUFFS_IGNORED
local buffIgnoredAuraScrollBox = detailsFramework:CreateAuraScrollBox(auraPanel_Auto, "$parentBuffIgnored", newAuraPanel.db.aura_tracker.buff_banned, onAuraRemoveCallback, options)
auraPanel_Auto.BuffIgnoredScroll = buffIgnoredAuraScrollBox
options.title_text = texts.DEBUFFS_IGNORED or defaultTextForAuraFrame.DEBUFFS_IGNORED
local debuffIgnoredAuraScrollBox = detailsFramework:CreateAuraScrollBox(auraPanel_Auto, "$parentDebuffIgnored", newAuraPanel.db.aura_tracker.debuff_banned, onAuraRemoveCallback, options)
auraPanel_Auto.DebuffIgnoredScroll = debuffIgnoredAuraScrollBox
options.title_text = texts.BUFFS_TRACKED or defaultTextForAuraFrame.BUFFS_TRACKED
local buffTrackedAuraScrollBox = detailsFramework:CreateAuraScrollBox(auraPanel_Auto, "$parentBuffTracked", newAuraPanel.db.aura_tracker.buff_tracked, onAuraRemoveCallback, options)
auraPanel_Auto.BuffTrackerScroll = buffTrackedAuraScrollBox
local xLocation = 140
scrollWidth = scrollWidth + 20
debuffIgnoredAuraScrollBox:SetPoint("topleft", auraPanel_Auto, "topleft", 0 + xLocation, y)
buffIgnoredAuraScrollBox:SetPoint("topleft", auraPanel_Auto, "topleft", 8 + scrollWidth + xLocation, y)
debuffTrackedAuraScrollBox:SetPoint("topleft", auraPanel_Auto, "topleft", 16 +(scrollWidth * 2) + xLocation, y)
buffTrackedAuraScrollBox:SetPoint("topleft", auraPanel_Auto, "topleft", 24 +(scrollWidth * 3) + xLocation, y)
buffTrackedAuraScrollBox:GetTitleFontString():SetText(newAuraPanel.LocTexts.BUFFS_TRACKED)
debuffTrackedAuraScrollBox:GetTitleFontString():SetText(newAuraPanel.LocTexts.DEBUFFS_TRACKED)
buffIgnoredAuraScrollBox:GetTitleFontString():SetText(newAuraPanel.LocTexts.BUFFS_IGNORED)
debuffIgnoredAuraScrollBox:GetTitleFontString():SetText(newAuraPanel.LocTexts.DEBUFFS_IGNORED)
newAuraPanel.buff_ignored = buffIgnoredAuraScrollBox
newAuraPanel.debuff_ignored = debuffIgnoredAuraScrollBox
newAuraPanel.buff_tracked = buffTrackedAuraScrollBox
newAuraPanel.debuff_tracked = debuffTrackedAuraScrollBox
auraPanel_Auto:SetScript("OnShow", function()
buffTrackedAuraScrollBox:Refresh()
debuffTrackedAuraScrollBox:Refresh()
buffIgnoredAuraScrollBox:Refresh()
debuffIgnoredAuraScrollBox:Refresh()
end)
auraPanel_Auto:SetScript("OnHide", function()
--
end)
--show the frame selecton on the f.db
if (newAuraPanel.db.aura_tracker.track_method == 0x1) then
onSwitchTrackingMethod(automaticTrackingCheckbox)
elseif (newAuraPanel.db.aura_tracker.track_method == 0x2) then
onSwitchTrackingMethod(manualTrackingCheckbox)
end
-------manual
--build the two aura scrolls for buff and debuff
local scroll_width = width
local scroll_height = height
local scroll_lines = 15
local scroll_line_height = 20
local backdrop_color = {.8, .8, .8, 0.2}
local backdrop_color_on_enter = {.8, .8, .8, 0.4}
local line_onenter = function(self)
self:SetBackdropColor(unpack(backdrop_color_on_enter))
local spellid = select(7, GetSpellInfo(self.value))
if (spellid) then
GameTooltip:SetOwner(self, "ANCHOR_CURSOR")
GameTooltip:SetSpellByID(spellid)
GameTooltip:AddLine(" ")
GameTooltip:Show()
end
end
local line_onleave = function(self)
self:SetBackdropColor(unpack(backdrop_color))
GameTooltip:Hide()
end
local onclick_remove_button = function(self)
local spell = self:GetParent().value
local data = self:GetParent():GetParent():GetData()
for i = 1, #data do
if (data[i] == spell) then
tremove(data, i)
break
end
end
self:GetParent():GetParent():Refresh()
end
local scroll_createline = function(self, index)
local line = CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate")
line:SetPoint("topleft", self, "topleft", 1, -((index-1)*(scroll_line_height+1)) - 1)
line:SetSize(scroll_width - 2, scroll_line_height)
line:SetScript("OnEnter", line_onenter)
line:SetScript("OnLeave", line_onleave)
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
line:SetBackdropColor(unpack(backdrop_color))
local icon = line:CreateTexture("$parentIcon", "overlay")
icon:SetSize(scroll_line_height - 2, scroll_line_height - 2)
local name = line:CreateFontString("$parentName", "overlay", "GameFontNormal")
local remove_button = CreateFrame("button", "$parentRemoveButton", line, "UIPanelCloseButton")
remove_button:SetSize(16, 16)
remove_button:SetScript("OnClick", onclick_remove_button)
remove_button:SetPoint("topright", line, "topright")
remove_button:GetNormalTexture():SetDesaturated(true)
icon:SetPoint("left", line, "left", 2, 0)
name:SetPoint("left", icon, "right", 2, 0)
line.icon = icon
line.name = name
line.removebutton = remove_button
return line
end
local scroll_refresh = function(self, data, offset, total_lines)
for i = 1, total_lines do
local index = i + offset
local aura = data [index]
if (aura) then
local line = self:GetLine(i)
local name, _, icon = GetSpellInfo(aura)
line.value = aura
if (name) then
line.name:SetText(name)
line.icon:SetTexture(icon)
line.icon:SetTexCoord(.1, .9, .1, .9)
else
line.name:SetText(aura)
line.icon:SetTexture([[Interface\InventoryItems\WoWUnknownItem01]])
end
end
end
end
local buffs_added = self:CreateScrollBox(auraPanel_Manual, "$parentBuffsAdded", scroll_refresh, newAuraPanel.db.aura_tracker.buff, scroll_width, scroll_height, scroll_lines, scroll_line_height)
buffs_added:SetPoint("topleft", auraPanel_Manual, "topleft", 0, y)
DF:ReskinSlider(buffs_added)
for i = 1, scroll_lines do
buffs_added:CreateLine(scroll_createline)
end
local debuffs_added = self:CreateScrollBox(auraPanel_Manual, "$parentDebuffsAdded", scroll_refresh, newAuraPanel.db.aura_tracker.debuff, scroll_width, scroll_height, scroll_lines, scroll_line_height)
debuffs_added:SetPoint("topleft", auraPanel_Manual, "topleft", width+30, y)
DF:ReskinSlider(debuffs_added)
for i = 1, scroll_lines do
debuffs_added:CreateLine(scroll_createline)
end
newAuraPanel.buffs_added = buffs_added
newAuraPanel.debuffs_added = debuffs_added
local buffs_added_name = DF:CreateLabel(buffs_added, "Buffs", 12, "silver")
buffs_added_name:SetTemplate(DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
buffs_added_name:SetPoint("bottomleft", buffs_added, "topleft", 0, 2)
buffs_added.Title = buffs_added_name
local debuffs_added_name = DF:CreateLabel(debuffs_added, "Debuffs", 12, "silver")
debuffs_added_name:SetTemplate(DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
debuffs_added_name:SetPoint("bottomleft", debuffs_added, "topleft", 0, 2)
debuffs_added.Title = debuffs_added_name
-- build the text entry to type the spellname
local new_buff_string = self:CreateLabel(auraPanel_Manual, "Add Buff")
local new_debuff_string = self:CreateLabel(auraPanel_Manual, "Add Debuff")
local new_buff_entry = self:CreateTextEntry(auraPanel_Manual, function()end, 200, 20, "NewBuffTextBox", _, _, options_dropdown_template)
local new_debuff_entry = self:CreateTextEntry(auraPanel_Manual, function()end, 200, 20, "NewDebuffTextBox", _, _, options_dropdown_template)
new_buff_entry:SetHook("OnEditFocusGained", setAutoCompleteWordList)
new_debuff_entry:SetHook("OnEditFocusGained", setAutoCompleteWordList)
new_buff_entry.tooltip = "Enter the buff name using lower case letters.\n\nYou can add several spells at once using |cFFFFFF00;|r to separate each spell name."
new_debuff_entry.tooltip = "Enter the debuff name using lower case letters.\n\nYou can add several spells at once using |cFFFFFF00;|r to separate each spell name."
new_buff_entry:SetJustifyH("left")
new_debuff_entry:SetJustifyH("left")
local add_buff_button = self:CreateButton(auraPanel_Manual, function()
local text = new_buff_entry.text
new_buff_entry:SetText("")
new_buff_entry:ClearFocus()
if (text ~= "") then
--check for more than one spellname
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = strtrim(spellName)
local spellID = getSpellIDFromSpellName(spellName)
if (spellID) then
tinsert(newAuraPanel.db.aura_tracker.buff, spellID)
--[[
if not tonumber(spellName) then
tinsert(f.db.aura_tracker.buff, spellName)
else
tinsert(f.db.aura_tracker.buff, spellID)
end
]]--
else
print("spellId not found for spell:", spellName)
end
end
else
--get the spellId
local spellID = getSpellIDFromSpellName(text)
if (not spellID) then
print("spellIs for spell ", text, "not found")
return
end
tinsert(newAuraPanel.db.aura_tracker.buff, spellID)
--[[
if not tonumber(text) then
tinsert(f.db.aura_tracker.buff, text)
else
tinsert(f.db.aura_tracker.buff, spellID)
end
]]--
end
buffs_added:Refresh()
end
end, 100, 20, "Add Buff", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
local add_debuff_button = self:CreateButton(auraPanel_Manual, function()
local text = new_debuff_entry.text
new_debuff_entry:SetText("")
new_debuff_entry:ClearFocus()
if (text ~= "") then
--check for more than one spellname
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = strtrim(spellName)
local spellID = getSpellIDFromSpellName(spellName)
if (spellID) then
tinsert(newAuraPanel.db.aura_tracker.debuff, spellID)
--[[
if not tonumber(spellName) then
tinsert(f.db.aura_tracker.debuff, spellName)
else
tinsert(f.db.aura_tracker.debuff, spellID)
end
]]--
else
print("spellId not found for spell:", spellName)
end
end
else
--get the spellId
local spellID = getSpellIDFromSpellName(text)
if (not spellID) then
print("spellIs for spell ", text, "not found")
return
end