forked from fxpw/ElvUI_OptionsUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNameplates.lua
More file actions
4365 lines (4325 loc) · 139 KB
/
Copy pathNameplates.lua
File metadata and controls
4365 lines (4325 loc) · 139 KB
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
local E, _, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local C, L = unpack(select(2, ...))
local NP = E:GetModule("NamePlates")
local ACD = E.Libs.AceConfigDialog
local next, ipairs, pairs, type, tonumber = next, ipairs, pairs, type, tonumber
local tremove, tinsert, tconcat = tremove, tinsert, table.concat
local format, match, gsub, strsplit = string.format, string.match, string.gsub, strsplit
local GetSpellInfo = GetSpellInfo
local positionValues = {
BOTTOMLEFT = "BOTTOMLEFT",
BOTTOMRIGHT = "BOTTOMRIGHT",
LEFT = "LEFT",
RIGHT = "RIGHT",
TOPLEFT = "TOPLEFT",
TOPRIGHT = "TOPRIGHT"
}
local raidTargetIcon = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_%s:0|t %s"
local selectedNameplateFilter
local totemsColor = {
["fire"] = "|cffff8f8f",
["earth"] = "|cffffb31f",
["water"] = "|cff2b76ff",
["air"] = "|cffb8d1ff"
}
local carryFilterFrom, carryFilterTo
local function filterMatch(s,v)
local m1, m2, m3, m4 = "^"..v.."$", "^"..v..",", ","..v.."$", ","..v..","
return (match(s, m1) and m1) or (match(s, m2) and m2) or (match(s, m3) and m3) or (match(s, m4) and v..",")
end
local function filterPriority(auraType, unit, value, remove, movehere)
if not auraType or not value then return end
local filter = E.db.nameplates.units[unit] and E.db.nameplates.units[unit][auraType] and E.db.nameplates.units[unit][auraType].filters and E.db.nameplates.units[unit][auraType].filters.priority
if not filter then return end
local found = filterMatch(filter, E:EscapeString(value))
if found and movehere then
local tbl, sv, sm = {strsplit(",",filter)}
for i in ipairs(tbl) do
if tbl[i] == value then sv = i elseif tbl[i] == movehere then sm = i end
if sv and sm then break end
end
tremove(tbl, sm)
tinsert(tbl, sv, movehere)
E.db.nameplates.units[unit][auraType].filters.priority = tconcat(tbl,",")
elseif found and remove then
E.db.nameplates.units[unit][auraType].filters.priority = gsub(filter, found, "")
elseif not found and not remove then
E.db.nameplates.units[unit][auraType].filters.priority = (filter == "" and value) or (filter..","..value)
end
end
local function UpdateInstanceDifficulty()
if E.global.nameplates.filters[selectedNameplateFilter].triggers.instanceType.party then
E.Options.args.nameplate.args.filters.args.triggers.args.instanceType.args.dungeonDifficulty = {
order = 10,
type = "group",
name = L["DUNGEON_DIFFICULTY"],
desc = L["Check these to only have the filter active in certain difficulties. If none are checked, it is active in all difficulties."],
guiInline = true,
get = function(info) return E.global.nameplates.filters[selectedNameplateFilter].triggers.instanceDifficulty.dungeon[info[#info]] end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.instanceDifficulty.dungeon[info[#info]] = value
UpdateInstanceDifficulty()
NP:ConfigureAll()
end,
args = {
normal = {
order = 1,
type = "toggle",
name = L["PLAYER_DIFFICULTY1"]
},
heroic = {
order = 2,
type = "toggle",
name = L["PLAYER_DIFFICULTY2"]
}
}
}
else
E.Options.args.nameplate.args.filters.args.triggers.args.instanceType.args.dungeonDifficulty = nil
end
if E.global.nameplates.filters[selectedNameplateFilter].triggers.instanceType.raid then
E.Options.args.nameplate.args.filters.args.triggers.args.instanceType.args.raidDifficulty = {
order = 11,
type = "group",
name = L["Raid Difficulty"],
desc = L["Check these to only have the filter active in certain difficulties. If none are checked, it is active in all difficulties."],
guiInline = true,
get = function(info) return E.global.nameplates.filters[selectedNameplateFilter].triggers.instanceDifficulty.raid[info[#info]] end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.instanceDifficulty.raid[info[#info]] = value
UpdateInstanceDifficulty()
NP:ConfigureAll()
end,
args = {
normal = {
order = 1,
type = "toggle",
name = L["PLAYER_DIFFICULTY1"]
},
heroic = {
order = 2,
type = "toggle",
name = L["PLAYER_DIFFICULTY2"]
}
}
}
else
E.Options.args.nameplate.args.filters.args.triggers.args.instanceType.args.raidDifficulty = nil
end
end
local function UpdateStyleLists()
if E.global.nameplates.filters[selectedNameplateFilter] and E.global.nameplates.filters[selectedNameplateFilter].triggers and E.global.nameplates.filters[selectedNameplateFilter].triggers.names then
E.Options.args.nameplate.args.filters.args.triggers.args.names.args.names = {
order = 50,
type = "group",
name = "",
guiInline = true,
args = {}
}
if next(E.global.nameplates.filters[selectedNameplateFilter].triggers.names) then
for name in pairs(E.global.nameplates.filters[selectedNameplateFilter].triggers.names) do
E.Options.args.nameplate.args.filters.args.triggers.args.names.args.names.args[name] = {
order = -1,
type = "toggle",
name = name,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers and E.global.nameplates.filters[selectedNameplateFilter].triggers.names and E.global.nameplates.filters[selectedNameplateFilter].triggers.names[name]
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.names[name] = value
NP:ConfigureAll()
end
}
end
end
end
if E.global.nameplates.filters[selectedNameplateFilter] and E.global.nameplates.filters[selectedNameplateFilter].triggers.casting and E.global.nameplates.filters[selectedNameplateFilter].triggers.casting.spells then
E.Options.args.nameplate.args.filters.args.triggers.args.casting.args.spells = {
order = 50,
type = "group",
name = "",
guiInline = true,
args = {}
}
if next(E.global.nameplates.filters[selectedNameplateFilter].triggers.casting.spells) then
local spell, spellName, notDisabled
for name in pairs(E.global.nameplates.filters[selectedNameplateFilter].triggers.casting.spells) do
spell = name
if tonumber(spell) then
spellName = GetSpellInfo(spell)
notDisabled = (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable)
if spellName then
if notDisabled then
spell = format("|cFFffff00%s|r |cFFffffff(%d)|r", spellName, spell)
else
spell = format("%s (%d)", spellName, spell)
end
end
end
E.Options.args.nameplate.args.filters.args.triggers.args.casting.args.spells.args[name] = {
order = -1,
type = "toggle",
name = spell,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers and E.global.nameplates.filters[selectedNameplateFilter].triggers.casting.spells and E.global.nameplates.filters[selectedNameplateFilter].triggers.casting.spells[name]
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.casting.spells[name] = value
NP:ConfigureAll()
end
}
end
end
end
if E.global.nameplates.filters[selectedNameplateFilter] and E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns and E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns.names then
E.Options.args.nameplate.args.filters.args.triggers.args.cooldowns.args.names = {
order = 50,
type = "group",
name = "",
guiInline = true,
args = {}
}
if next(E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns.names) then
local spell, spellName, notDisabled
for name in pairs(E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns.names) do
spell = name
if tonumber(spell) then
spellName = GetSpellInfo(spell)
notDisabled = (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable)
if spellName then
if notDisabled then
spell = format("|cFFffff00%s|r |cFFffffff(%d)|r", spellName, spell)
else
spell = format("%s (%d)", spellName, spell)
end
end
end
E.Options.args.nameplate.args.filters.args.triggers.args.cooldowns.args.names.args[name] = {
order = -1,
type = "select",
name = spell,
values = {
["DISABLED"] = L["DISABLE"],
["ONCD"] = L["On Cooldown"],
["OFFCD"] = L["Off Cooldown"]
},
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers and E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns.names and E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns.names[name]
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns.names[name] = value
NP:ConfigureAll()
end
}
end
end
end
if E.global.nameplates.filters[selectedNameplateFilter] and E.global.nameplates.filters[selectedNameplateFilter].triggers.buffs and E.global.nameplates.filters[selectedNameplateFilter].triggers.buffs.names then
E.Options.args.nameplate.args.filters.args.triggers.args.buffs.args.names = {
order = 50,
type = "group",
name = "",
guiInline = true,
args = {}
}
if next(E.global.nameplates.filters[selectedNameplateFilter].triggers.buffs.names) then
local spell, spellName, notDisabled
for name in pairs(E.global.nameplates.filters[selectedNameplateFilter].triggers.buffs.names) do
spell = name
if tonumber(spell) then
spellName = GetSpellInfo(spell)
notDisabled = (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable)
if spellName then
if notDisabled then
spell = format("|cFFffff00%s|r |cFFffffff(%d)|r", spellName, spell)
else
spell = format("%s (%d)", spellName, spell)
end
end
end
E.Options.args.nameplate.args.filters.args.triggers.args.buffs.args.names.args[name] = {
order = -1,
type = "toggle",
name = spell,
textWidth = true,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers and E.global.nameplates.filters[selectedNameplateFilter].triggers.buffs.names and E.global.nameplates.filters[selectedNameplateFilter].triggers.buffs.names[name]
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.buffs.names[name] = value
NP:ConfigureAll()
end
}
end
end
end
if E.global.nameplates.filters[selectedNameplateFilter] and E.global.nameplates.filters[selectedNameplateFilter].triggers.debuffs and E.global.nameplates.filters[selectedNameplateFilter].triggers.debuffs.names then
E.Options.args.nameplate.args.filters.args.triggers.args.debuffs.args.names = {
order = 50,
type = "group",
name = "",
guiInline = true,
args = {}
}
if next(E.global.nameplates.filters[selectedNameplateFilter].triggers.debuffs.names) then
local spell, spellName, notDisabled
for name in pairs(E.global.nameplates.filters[selectedNameplateFilter].triggers.debuffs.names) do
spell = name
if tonumber(spell) then
spellName = GetSpellInfo(spell)
notDisabled = (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable)
if spellName then
if notDisabled then
spell = format("|cFFffff00%s|r |cFFffffff(%d)|r", spellName, spell)
else
spell = format("%s (%d)", spellName, spell)
end
end
end
E.Options.args.nameplate.args.filters.args.triggers.args.debuffs.args.names.args[name] = {
textWidth = true,
order = -1,
type = "toggle",
name = spell,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers and E.global.nameplates.filters[selectedNameplateFilter].triggers.debuffs.names and E.global.nameplates.filters[selectedNameplateFilter].triggers.debuffs.names[name]
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.debuffs.names[name] = value
NP:ConfigureAll()
end
}
end
end
end
if E.global.nameplates.filters[selectedNameplateFilter] and E.global.nameplates.filters[selectedNameplateFilter].triggers.totems then
for totemSchool in pairs(G.nameplates.totemTypes) do
local titemSchoolLoc, order
if totemSchool == "fire" then
titemSchoolLoc, order = BINDING_NAME_MULTICASTACTIONBUTTON10, 51
elseif totemSchool == "earth" then
titemSchoolLoc, order = BINDING_NAME_MULTICASTACTIONBUTTON1, 50
elseif totemSchool == "water" then
titemSchoolLoc, order = BINDING_NAME_MULTICASTACTIONBUTTON11, 52
elseif totemSchool == "air" then
titemSchoolLoc, order = BINDING_NAME_MULTICASTACTIONBUTTON12, 53
elseif totemSchool == "other" then
titemSchoolLoc, order = OTHER, 54
end
E.Options.args.nameplate.args.filters.args.triggers.args.totems.args[totemSchool] = {
order = order,
type = "group",
name = (totemsColor[totemSchool] or "")..titemSchoolLoc,
guiInline = true,
disabled = function() return not E.global.nameplates.filters[selectedNameplateFilter].triggers.totems.enable end,
args = {}
}
end
for totem, data in pairs(NP.TriggerConditions.totems) do
E.Options.args.nameplate.args.filters.args.triggers.args.totems.args[data[2]].args[totem] = {
textWidth = true,
order = -1,
type = "toggle",
name = data[1],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers and E.global.nameplates.filters[selectedNameplateFilter].triggers.totems and E.global.nameplates.filters[selectedNameplateFilter].triggers.totems[totem]
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.totems[totem] = value
NP:ConfigureAll()
end
}
end
end
if E.global.nameplates.filters[selectedNameplateFilter] and E.global.nameplates.filters[selectedNameplateFilter].triggers.uniqueUnits then
for unitType in pairs(G.nameplates.uniqueUnitTypes) do
local name, order
if unitType == "pvp" then
name, order = "PvP", 50
elseif unitType == "pve" then
name, order = "PvE", 51
end
E.Options.args.nameplate.args.filters.args.triggers.args.uniqueUnits.args[unitType] = {
order = order,
type = "group",
name = name,
guiInline = true,
disabled = function() return not E.global.nameplates.filters[selectedNameplateFilter].triggers.uniqueUnits.enable end,
args = {}
}
end
for unit, data in pairs(NP.TriggerConditions.uniqueUnits) do
E.Options.args.nameplate.args.filters.args.triggers.args.uniqueUnits.args[data[2]].args[unit] = {
textWidth = true,
order = -1,
type = "toggle",
name = data[1],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers and E.global.nameplates.filters[selectedNameplateFilter].triggers.uniqueUnits and E.global.nameplates.filters[selectedNameplateFilter].triggers.uniqueUnits[unit]
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.uniqueUnits[unit] = value
NP:ConfigureAll()
end
}
end
end
end
local function UpdateFilterGroup()
if not selectedNameplateFilter or not E.global.nameplates.filters[selectedNameplateFilter] then
E.Options.args.nameplate.args.filters.args.header = nil
E.Options.args.nameplate.args.filters.args.actions = nil
E.Options.args.nameplate.args.filters.args.triggers = nil
end
if selectedNameplateFilter and E.global.nameplates.filters[selectedNameplateFilter] then
E.Options.args.nameplate.args.filters.args.header = {
order = 4,
type = "header",
name = selectedNameplateFilter
}
E.Options.args.nameplate.args.filters.args.triggers = {
order = 5,
type = "group",
name = L["Triggers"],
args = {
enable = {
order = 0,
type = "toggle",
name = L["Enable"],
get = function(info)
return (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable)
end,
set = function(info, value)
if not E.db.nameplates then E.db.nameplates = {} end
if not E.db.nameplates.filters then E.db.nameplates.filters = {} end
if not E.db.nameplates.filters[selectedNameplateFilter] then E.db.nameplates.filters[selectedNameplateFilter] = {} end
if not E.db.nameplates.filters[selectedNameplateFilter].triggers then E.db.nameplates.filters[selectedNameplateFilter].triggers = {} end
E.db.nameplates.filters[selectedNameplateFilter].triggers.enable = value
UpdateStyleLists() --we need this to recolor the spellid based on wether or not the filter is disabled
NP:ConfigureAll()
end
},
priority = {
order = 1,
type = "range",
name = L["Filter Priority"],
desc = L["Lower numbers mean a higher priority. Filters are processed in order from 1 to 100."],
min = 1, max = 100, step = 1,
disabled = function() return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable) end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.priority or 1
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.priority = value
NP:ConfigureAll()
end
},
resetFilter = {
order = 2,
type = "execute",
name = L["Clear Filter"],
desc = L["Return filter to its default state."],
func = function()
local filter = {}
if G.nameplates.filters[selectedNameplateFilter] then
filter = E:CopyTable(filter, G.nameplates.filters[selectedNameplateFilter])
end
NP:StyleFilterCopyDefaults(filter)
E.global.nameplates.filters[selectedNameplateFilter] = filter
UpdateStyleLists()
UpdateInstanceDifficulty()
NP:ConfigureAll()
end
},
spacer1 = {
order = 3,
type = "description",
name = ""
},
names = {
order = 4,
type = "group",
name = L["NAME"],
disabled = function() return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable) end,
args = {
addName = {
order = 1,
type = "input",
name = L["Add Name"],
desc = L["Add a Name to the list."],
get = function(info) return "" end,
set = function(info, value)
if match(value, "^[%s%p]-$") then
return
end
E.global.nameplates.filters[selectedNameplateFilter].triggers.names[value] = true
UpdateFilterGroup()
NP:ConfigureAll()
end
},
removeName = {
order = 2,
type = "input",
name = L["Remove Name"],
desc = L["Remove a Name from the list."],
get = function(info) return "" end,
set = function(info, value)
if match(value, "^[%s%p]-$") then
return
end
E.global.nameplates.filters[selectedNameplateFilter].triggers.names[value] = nil
UpdateFilterGroup()
NP:ConfigureAll()
end
}
}
},
targeting = {
order = 5,
type = "group",
name = L["Targeting"],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers[info[#info]]
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers[info[#info]] = value
NP:ConfigureAll()
end,
disabled = function()
return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter]
and E.db.nameplates.filters[selectedNameplateFilter].triggers
and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable)
end,
args = {
isTarget = {
order = 1,
type = "toggle",
name = L["Is Targeted"],
desc = L["If enabled then the filter will only activate when you are targeting the unit."]
},
notTarget = {
order = 2,
type = "toggle",
name = L["Not Targeted"],
desc = L["If enabled then the filter will only activate when you are not targeting the unit."]
},
requireTarget = {
order = 3,
type = "toggle",
name = L["Require Target"],
desc = L["If enabled then the filter will only activate when you have a target."]
},
}
},
casting = {
order = 6,
type = "group",
name = L["Casting"],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.casting[info[#info]]
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.casting[info[#info]] = value
NP:ConfigureAll()
end,
disabled = function()
return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and
E.db.nameplates.filters[selectedNameplateFilter].triggers and
E.db.nameplates.filters[selectedNameplateFilter].triggers.enable)
end,
args = {
types = {
name = "",
type = "group",
guiInline = true,
order = 2,
args = {
isCasting = {
type = "toggle",
order = 1,
name = L["Is Casting Anything"],
desc = L["If enabled then the filter will activate if the unit is casting anything."]
},
notCasting = {
type = "toggle",
order = 2,
name = L["Not Casting Anything"],
desc = L["If enabled then the filter will activate if the unit is not casting anything."]
},
isChanneling = {
type = "toggle",
order = 3,
customWidth = 200,
name = L["Is Channeling Anything"],
desc = L["If enabled then the filter will activate if the unit is channeling anything."]
},
notChanneling = {
type = "toggle",
order = 4,
customWidth = 200,
name = L["Not Channeling Anything"],
desc = L["If enabled then the filter will activate if the unit is not channeling anything."]
},
spacer1 = {
order = 5,
type = "description",
name = " ",
width = "full"
},
interruptible = {
type = "toggle",
order = 6,
name = L["Interruptible"],
desc = L["If enabled then the filter will only activate if the unit is casting interruptible spells."]
},
notInterruptible = {
type = "toggle",
order = 7,
name = L["Non-Interruptable"],
desc = L["If enabled then the filter will only activate if the unit is casting not interruptible spells."]
}
}
},
addSpell = {
order = 9,
name = L["Add Spell ID or Name"],
type = "input",
get = function(info)
return ""
end,
set = function(info, value)
if match(value, "^[%s%p]-$") then return end
E.global.nameplates.filters[selectedNameplateFilter].triggers.casting.spells[value] = true
UpdateFilterGroup()
NP:ConfigureAll()
end
},
removeSpell = {
order = 10,
name = L["Remove Spell ID or Name"],
desc = L["If the aura is listed with a number then you need to use that to remove it from the list."],
type = "input",
get = function(info)
return ""
end,
set = function(info, value)
if match(value, "^[%s%p]-$") then return end
E.global.nameplates.filters[selectedNameplateFilter].triggers.casting.spells[value] = nil
UpdateFilterGroup()
NP:ConfigureAll()
end
},
description1 = {
order = 12,
type = "description",
name = L["You do not need to use 'Is Casting Anything' or 'Is Channeling Anything' for these spells to trigger."]
},
description2 = {
order = 13,
type = "description",
name = L["If this list is empty, and if 'Interruptible' is checked, then the filter will activate on any type of cast that can be interrupted."]
},
notSpell = {
type = "toggle",
order = -2,
name = L["Not Spell"],
desc = L["If enabled then the filter will only activate if the unit is not casting or channeling one of the selected spells."]
}
}
},
combat = {
order = 7,
type = "group",
name = L["Unit Conditions"],
disabled = function() return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable) end,
args = {
inCombat = {
order = 1,
type = "toggle",
name = L["Player in Combat"],
desc = L["If enabled then the filter will only activate when you are in combat."],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.inCombat
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.inCombat = value
NP:ConfigureAll()
end
},
outOfCombat = {
order = 2,
type = "toggle",
name = L["Player Out of Combat"],
desc = L["If enabled then the filter will only activate when you are out of combat."],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.outOfCombat
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.outOfCombat = value
NP:ConfigureAll()
end
},
isResting = {
order = 3,
type = "toggle",
name = L["Player is Resting"],
desc = L["If enabled then the filter will only activate when you are resting at an Inn."],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.isResting
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.isResting = value
NP:ConfigureAll()
end
}
}
},
role = {
order = 8,
type = "group",
name = L["ROLE"],
disabled = function() return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable) end,
args = {
tank = {
order = 1,
type = "toggle",
name = L["TANK"],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.role.tank
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.role.tank = value
NP:ConfigureAll()
end,
},
healer = {
order = 2,
type = "toggle",
name = L["HEALER"],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.role.healer
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.role.healer = value
NP:ConfigureAll()
end
},
damager = {
order = 3,
type = "toggle",
name = L["DAMAGER"],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.role.damager
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.role.damager = value
NP:ConfigureAll()
end
}
}
},
health = {
order = 9,
type = "group",
name = L["Health Threshold"],
disabled = function() return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable) end,
args = {
enable = {
order = 1,
type = "toggle",
name = L["Enable"],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.healthThreshold
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.healthThreshold = value
NP:ConfigureAll()
end
},
usePlayer = {
order = 2,
type = "toggle",
name = L["Player Health"],
desc = L["Enabling this will check your health amount."],
disabled = function() return not E.global.nameplates.filters[selectedNameplateFilter].triggers.healthThreshold end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.healthUsePlayer
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.healthUsePlayer = value
NP:ConfigureAll()
end
},
spacer1 = {
order = 3,
type = "description",
name = " "
},
underHealthThreshold = {
order = 4,
type = "range",
name = L["Under Health Threshold"],
desc = L["If this threshold is used then the health of the unit needs to be lower than this value in order for the filter to activate. Set to 0 to disable."],
min = 0, max = 1, step = 0.01,
isPercent = true,
disabled = function() return not E.global.nameplates.filters[selectedNameplateFilter].triggers.healthThreshold end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.underHealthThreshold or 0
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.underHealthThreshold = value
NP:ConfigureAll()
end
},
overHealthThreshold = {
order = 5,
type = "range",
name = L["Over Health Threshold"],
desc = L["If this threshold is used then the health of the unit needs to be higher than this value in order for the filter to activate. Set to 0 to disable."],
min = 0, max = 1, step = 0.01,
isPercent = true,
disabled = function() return not E.global.nameplates.filters[selectedNameplateFilter].triggers.healthThreshold end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.overHealthThreshold or 0
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.overHealthThreshold = value
NP:ConfigureAll()
end
}
}
},
power = {
order = 10,
type = "group",
name = L["Power Threshold"],
disabled = function() return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable) end,
args = {
powerThreshold = {
order = 1,
type = "toggle",
name = L["Enable"],
desc = L["Enabling this will check your power amount."],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.powerThreshold
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.powerThreshold = value
NP:ConfigureAll()
end
},
spacer1 = {
order = 2,
type = "description",
name = " "
},
underPowerThreshold = {
order = 3,
type = "range",
name = L["Under Power Threshold"],
desc = L["If this threshold is used then the power of the unit needs to be lower than this value in order for the filter to activate. Set to 0 to disable."],
min = 0, max = 1, step = 0.01,
isPercent = true,
disabled = function() return not E.global.nameplates.filters[selectedNameplateFilter].triggers.powerThreshold end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.underPowerThreshold or 0
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.underPowerThreshold = value
NP:ConfigureAll()
end
},
overPowerThreshold = {
order = 4,
type = "range",
name = L["Over Power Threshold"],
desc = L["If this threshold is used then the power of the unit needs to be higher than this value in order for the filter to activate. Set to 0 to disable."],
min = 0, max = 1, step = 0.01,
isPercent = true,
disabled = function() return not E.global.nameplates.filters[selectedNameplateFilter].triggers.powerThreshold end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.overPowerThreshold or 0
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.overPowerThreshold = value
NP:ConfigureAll()
end
}
}
},
levels = {
order = 11,
type = "group",
name = L["LEVEL"],
disabled = function() return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable) end,
args = {
enable = {
order = 1,
type = "toggle",
name = L["Enable"],
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.level
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.level = value
NP:ConfigureAll()
end
},
matchLevel = {
order = 2,
type = "toggle",
name = L["Match Player Level"],
desc = L["If enabled then the filter will only activate if the level of the unit matches your own."],
disabled = function() return not E.global.nameplates.filters[selectedNameplateFilter].triggers.level end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.mylevel
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.mylevel = value
NP:ConfigureAll()
end
},
spacer1 = {
order = 3,
type = "description",
name = L["LEVEL_BOSS"],
},
minLevel = {
order = 4,
type = "range",
name = L["Minimum Level"],
desc = L["If enabled then the filter will only activate if the level of the unit is equal to or higher than this value."],
min = -1, max = MAX_PLAYER_LEVEL+3, step = 1,
disabled = function() return not (E.global.nameplates.filters[selectedNameplateFilter].triggers.level and not E.global.nameplates.filters[selectedNameplateFilter].triggers.mylevel) end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.minlevel or 0
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.minlevel = value
NP:ConfigureAll()
end
},
maxLevel = {
order = 5,
type = "range",
name = L["Maximum Level"],
desc = L["If enabled then the filter will only activate if the level of the unit is equal to or lower than this value."],
min = -1, max = MAX_PLAYER_LEVEL+3, step = 1,
disabled = function() return not (E.global.nameplates.filters[selectedNameplateFilter].triggers.level and not E.global.nameplates.filters[selectedNameplateFilter].triggers.mylevel) end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.maxlevel or 0
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.maxlevel = value
NP:ConfigureAll()
end
},
currentLevel = {
order = 6,
type = "range",
name = L["Current Level"],
desc = L["If enabled then the filter will only activate if the level of the unit matches this value."],
min = -1, max = MAX_PLAYER_LEVEL+3, step = 1,
disabled = function() return not (E.global.nameplates.filters[selectedNameplateFilter].triggers.level and not E.global.nameplates.filters[selectedNameplateFilter].triggers.mylevel) end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.curlevel or 0
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.curlevel = value
NP:ConfigureAll()
end
}
}
},
cooldowns = {
order = 12,
type = "group",
name = L["Cooldowns"],
disabled = function() return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable) end,
args = {
mustHaveAll = {
order = 1,
type = "toggle",
name = L["Require All"],
desc = L["If enabled then it will require all cooldowns to activate the filter. Otherwise it will only require any one of the cooldowns to activate it."],
disabled = function() return not (E.db.nameplates and E.db.nameplates.filters and E.db.nameplates.filters[selectedNameplateFilter] and E.db.nameplates.filters[selectedNameplateFilter].triggers and E.db.nameplates.filters[selectedNameplateFilter].triggers.enable) end,
get = function(info)
return E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns and E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns.mustHaveAll
end,
set = function(info, value)
E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns.mustHaveAll = value
NP:ConfigureAll()
end
},
spacer1 = {
order = 5,
type = "description",
name = " "
},
addCooldown = {
order = 6,
type = "input",
name = L["Add Spell ID or Name"],
get = function(info) return "" end,
set = function(info, value)
if match(value, "^[%s%p]-$") then
return
end
E.global.nameplates.filters[selectedNameplateFilter].triggers.cooldowns.names[value] = "ONCD"
UpdateFilterGroup()
NP:ConfigureAll()
end
},
removeCooldown = {
order = 7,
type = "input",