-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptions.lua
More file actions
2221 lines (1995 loc) · 71 KB
/
Options.lua
File metadata and controls
2221 lines (1995 loc) · 71 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 addonName, addonTable = ...
local CooldownCursor = addonTable.Frame
local State = addonTable.State
local Internal = addonTable.Internal
local OPTIONS_APP_NAME = addonName
local AceConfig = LibStub and LibStub("AceConfig-3.0", true)
local AceConfigDialog = LibStub and LibStub("AceConfigDialog-3.0", true)
local version = CooldownCursor:GetVersion()
local name = function()
return "CooldownCursor |cff00ff00v" .. version .. "|r"
end
local fontValues = {}
local anchorValues = {}
local frameStrataValues = {}
-- Debounce timer for priority slider rebuild
local priorityRebuildTimer = nil
local fontTypeValues = {
NONE = "None",
OUTLINE = "Outline",
THICKOUTLINE = "Thick Outline",
MONOCHROME = "Monochrome",
MONOCHROMEOUTLINE = "Monochrome Outline",
MONOCHROMETHICKOUTLINE = "Monochrome Thick Outline",
}
local function GetRuleDisplayColor(enabled)
if CooldownCursorDB.spellRules.settings.disableRules then
return "9d9d9d", "(rules disabled)"
end
if enabled == nil then return "ffff00", "" end
if enabled then return "00ff00", "" end
return "ff5555", "(disabled)"
end
-- Helper to get class-specific rules for the current player
local function GetClassRulesForUI()
CooldownCursorDB.spellRules = CooldownCursorDB.spellRules or {}
CooldownCursorDB.spellRules.rules = CooldownCursorDB.spellRules.rules or {}
local class = CooldownCursor:GetPlayerClass()
if not class then return {} end
if not CooldownCursorDB.spellRules.rules[class] then
CooldownCursorDB.spellRules.rules[class] = {}
end
return CooldownCursorDB.spellRules.rules[class]
end
function CooldownCursor:RebuildSpellRuleOptions()
local group = self.options.args.spellRulesGroup
local args = group.args
-- Remove old spell entries only
for k in pairs(args) do
if k:match("^spell_") then
args[k] = nil
end
end
-- Get class-specific rules
local classRules = GetClassRulesForUI()
-- Build sortable list
local sorted = {}
for spellID, rule in pairs(classRules) do
if type(spellID) == "number" and C_SpellBook.IsSpellKnown(spellID) then
local info = C_Spell.GetSpellInfo(spellID)
local name = info and info.name or ("SpellID " .. spellID)
local icon = info and info.originalIconID or nil
table.insert(sorted, {
spellID = spellID,
icon = icon,
name = name,
rule = rule,
})
end
end
-- Sort by priority (higher first), then alphabetically for priority 0
table.sort(sorted, function(a, b)
local aPriority = (a.rule.settings and a.rule.settings.priority) or 0
local bPriority = (b.rule.settings and b.rule.settings.priority) or 0
-- Spells with priority > 0 come before priority 0
if aPriority > 0 and bPriority == 0 then
return true
end
if bPriority > 0 and aPriority == 0 then
return false
end
-- Both have priority: sort by priority descending (higher first)
if aPriority > 0 and bPriority > 0 then
return aPriority > bPriority
end
-- Both priority 0: sort alphabetically
return a.name:lower() < b.name:lower()
end)
-- Build UI groups
local order = 10
for _, entry in ipairs(sorted) do
local spellID = entry.spellID
local rule = entry.rule
local settings = rule.settings or {}
local name = entry.name
local enabled = settings.enabled
local icon = entry.icon
local priority = settings.priority or 0
local color, suffix = GetRuleDisplayColor(enabled)
local priorityText = priority > 0 and ("|cffaaaaaa[%d]|r "):format(priority) or ""
name = ("%s|cff%s%s %s|r"):format(priorityText, color, name, suffix)
args["spell_" .. spellID] = {
type = "group",
name = name,
order = order,
icon = icon,
inline = false,
disabled = function() return CooldownCursorDB.spellRules.settings.disableRules end,
args = {
enabled = {
type = "toggle",
name = "Enabled",
desc = "When enabled, this spell will show cooldowns at your cursor.",
order = 10,
get = function() return settings.enabled ~= false end,
set = function(_, v)
settings.enabled = v
self:UpdateDisplay()
self:RebuildSpellRuleOptions()
self:NotifyOptionsChanged()
end,
},
priority = {
type = "range",
name = "Priority",
desc = "Priority for this spell when using Priority sort order (0-100, higher appears first).",
order = 15,
min = 0,
max = 100,
step = 1,
disabled = function()
return CooldownCursor:GetDBValue("stackDirection") == "SINGLE" or
CooldownCursorDB.spellRules.settings.disableRules or
not settings.enabled
end,
get = function()
return settings.priority or 0
end,
set = function(_, v)
settings.priority = v
self:UpdateDisplay()
-- Debounce the rebuild so slider moves smoothly
if priorityRebuildTimer then
priorityRebuildTimer:Cancel()
end
priorityRebuildTimer = C_Timer.NewTimer(0.3, function()
self:RebuildSpellRuleOptions()
self:NotifyOptionsChanged()
priorityRebuildTimer = nil
end)
end,
},
header = {
type = "header",
name = "Spell icon options",
order = 20,
},
description = {
type = "description",
name = "Update a spell icon settings.",
order = 21,
},
iconSize = {
type = "range",
name = "Icon Size",
order = 22,
min = 16,
max = 128,
step = 1,
disabled = function()
return settings.useGlobalIconSize ~= false or not settings.enabled
end,
get = function()
return settings.iconSize or CooldownCursor:GetDBValue("iconSize")
end,
set = function(_, v)
settings.iconSize = v
settings.useGlobalIconSize = false -- auto-disable inheritance
self:UpdateDisplay()
end,
},
useGlobalIconSize = {
type = "toggle",
name = "Use Global Icon Size",
desc = "Use the global icon size instead of a per-spell value.",
order = 23,
get = function()
return settings.useGlobalIconSize ~= false
end,
set = function(_, v)
settings.useGlobalIconSize = v
if v then
settings.iconSize = nil
end
self:UpdateDisplay()
end,
},
footer = {
type = "header",
name = "",
order = 100,
},
remove = {
type = "execute",
name = "Remove Rule for Spell " .. name,
order = 110,
confirm = true,
func = function()
CooldownCursor:RemoveSpellRule(spellID)
end,
},
},
}
order = order + 1
end
end
local function AnchorValues()
if next(anchorValues) ~= nil then
-- return cached values
return anchorValues
end
for _, a in ipairs(CooldownCursor:GetValidAnchorPositions()) do
anchorValues[a] = a
end
return anchorValues
end
local function FrameStrataValues()
if next(frameStrataValues) ~= nil then
-- return cached values
return frameStrataValues
end
for _, a in ipairs(CooldownCursor:GetValidFrameStratas()) do
frameStrataValues[a] = a
end
return frameStrataValues
end
local function FontValues()
if next(fontValues) ~= nil then
-- return cached values
return fontValues
end
for _, path in ipairs(CooldownCursor:GetAllFonts()) do
fontValues[path] = path
end
return fontValues
end
local function ShowWhenValues()
return {
[0] = "Always",
[1] = "In Combat",
[2] = "Out of Combat",
}
end
local function ShowBehaviorValues()
return {
[0] = "On Cooldown",
[1] = "Off Cooldown (Ready)",
[2] = "Auto-Hide After",
}
end
local function ProcOverlayAtlasValues()
local values = {}
local settings = CooldownCursor:GetProcOverlayAtlasSettings() or {}
values["none"] = "None"
for atlas, data in pairs(settings) do
values[atlas] = (data and data.name) or atlas
end
return values
end
local function ProcOutlineAtlasValues()
local values = {}
local settings = CooldownCursor:GetProcOutlineAtlasSettings() or {}
values["none"] = "None"
for atlas, data in pairs(settings) do
values[atlas] = (data and data.name) or atlas
end
return values
end
-- Helper to set smart defaults when Display Mode changes
local function ApplyDisplayModeDefaults(newMode)
if newMode == "HORIZONTAL" then
-- Default to RIGHT growth with TOPRIGHT anchor
CooldownCursorDB.global.stackGrowth = "RIGHT"
CooldownCursorDB.global.anchor = "TOPRIGHT"
elseif newMode == "VERTICAL" then
-- Default to DOWN growth with BOTTOM anchor
CooldownCursorDB.global.stackGrowth = "DOWN"
CooldownCursorDB.global.anchor = "BOTTOM"
elseif newMode == "RADIUS" then
-- Default to CLOCKWISE growth with CENTER anchor
CooldownCursorDB.global.stackGrowth = "CLOCKWISE"
CooldownCursorDB.global.anchor = "CENTER"
end
-- SINGLE mode: no automatic changes
end
local function HexColorGet(key, fallbackHex)
-- AceConfig color expects r,g,b,a in 0..1
local hex = (CooldownCursor:GetDBValue(key) or fallbackHex or "ffffff"):gsub("#", "")
if #hex ~= 6 then hex = "ffffff" end
local r = tonumber(hex:sub(1, 2), 16) / 255
local g = tonumber(hex:sub(3, 4), 16) / 255
local b = tonumber(hex:sub(5, 6), 16) / 255
return r, g, b, 1
end
local function HexColorSet(key, r, g, b, a)
local function toHex(x)
x = math.floor((x or 1) * 255 + 0.5)
return string.format("%02x", math.max(0, math.min(255, x)))
end
local hex = toHex(r) .. toHex(g) .. toHex(b)
CooldownCursor:SetDBString(key, "#" .. hex)
end
local options = {
type = "group",
name = name,
args = {
-- header = {
-- type = "header",
-- name = "Options",
-- order = 0,
-- },
preview = {
type = "execute",
name = "Toggle Preview",
desc = "Click to see your current settings in action!\n\n" ..
"The preview will loop continuously until you click again to turn it off.",
order = 50,
width = "normal",
func = function() CooldownCursor:Preview() end,
},
previewMouse = {
type = "toggle",
name = "Preview Follows Cursor",
desc = "Make the preview icons follow your mouse cursor.\n\n" ..
"When disabled, icons appear next to the settings panel.",
order = 60,
width = "normal",
get = function() return CooldownCursor:GetPreviewMouseMode() end,
set = function(_, v) CooldownCursor:SetPreviewMouseMode(v) end,
},
-- ========================================
-- QUICK SETTINGS TAB
-- ========================================
quickSettings = {
type = "group",
name = "Quick Settings",
order = 0,
args = {
welcomeHeader = {
type = "header",
name = "Quick Settings",
order = 1,
},
description = {
type = "description",
name = "|cff00ff00Quick access to the most commonly used settings.|r\n" ..
"To start tracking cooldowns, add spells in the |cffffd100Spell Rules|r tab.\n" ..
"Configure options here, then explore other tabs for advanced settings.",
order = 2,
},
spacer0 = {
type = "description",
name = " ",
order = 3,
},
enabled = {
type = "toggle",
name = "Enable Addon",
desc = "Turn CooldownCursor on or off.\n\n" ..
"When disabled, no cooldown icons will appear at your cursor.",
order = 4,
width = "normal",
get = function() return CooldownCursor:GetDBValue("enabled") end,
set = function(_, v)
CooldownCursor:SetDBBoolean("enabled", v)
if not v then
CooldownCursor:HideIconNow()
end
end,
},
showProcs = {
type = "toggle",
name = "Show Procs",
desc = "Enable proc detection for spells that can glow.\n\n" ..
"If disabled, proc visuals are hidden and proc-only icons are hidden.\n\n" ..
"|cffff0000NOTE: Spells must be added to the Spell Rules|r",
order = 4.1,
width = "normal",
get = function() return CooldownCursor:GetDBValue("showProcs") end,
set = function(_, v)
CooldownCursor:SetDBBoolean("showProcs", v)
if not v then
CooldownCursor:ClearProcStates(true)
end
CooldownCursor:UpdateDisplay()
end,
},
showCharges = {
type = "toggle",
name = "Show Charges",
desc = "Display the current charge count on spell icons for spells with multiple charges.",
order = 4.2,
width = "normal",
get = function() return CooldownCursor:GetDBValue("showCharges") end,
set = function(_, v)
CooldownCursor:SetDBBoolean("showCharges", v)
CooldownCursor:UpdateDisplay()
end,
},
enabledWarning = {
type = "description",
name = function()
if CooldownCursor:GetDBValue("enabled") == false then
return "|cffff5555CooldownCursor is currently DISABLED.|r No cooldowns will appear at your cursor."
end
return ""
end,
order = 4.5,
},
spacer1 = {
type = "description",
name = " ",
order = 5,
},
displayMode = {
type = "select",
name = "Display Mode",
desc = "How cooldown icons appear:\n\n" ..
"• SINGLE - Shows only the most recent cooldown (recommended for beginners)\n" ..
"• VERTICAL - Stack multiple cooldowns vertically\n" ..
"• HORIZONTAL - Stack multiple cooldowns horizontally\n" ..
"• RADIUS - Arrange multiple cooldowns in a circle around cursor",
order = 10,
width = "normal",
values = function()
return CooldownCursor:GetValidStackDirections()
end,
get = function()
return CooldownCursor:GetDBValue("stackDirection")
end,
set = function(_, v)
ApplyDisplayModeDefaults(v)
CooldownCursor:SetDBString("stackDirection", v)
end,
},
modeInfo = {
type = "description",
name = function()
local mode = CooldownCursor:GetDBValue("stackDirection")
if mode == "SINGLE" then
return "|cffaaaaaaSINGLE mode: Shows only your most recent cooldown. Perfect for a clean UI!|r"
elseif mode == "VERTICAL" or mode == "HORIZONTAL" then
return "|cffaaaaaaSTACKING mode: Shows multiple cooldowns at once. Configure 'Maximum Icons' in the Layout tab.|r"
elseif mode == "RADIUS" then
return "|cffaaaaaaRADIUS mode: Icons form a circle around your cursor. Adjust distance in the Layout tab.|r"
end
return ""
end,
order = 15,
},
spacer2 = {
type = "description",
name = " ",
order = 18,
},
showWhen = {
type = "select",
name = "Show Icons",
desc = "When should cooldown icons appear?",
order = 20,
width = "normal",
values = ShowWhenValues(),
get = function() return CooldownCursor:GetDBValue("showWhen") end,
set = function(_, v) CooldownCursor:SetDBNumber("showWhen", v) end,
},
showBehavior = {
type = "select",
name = "Show Behavior",
desc = "On Cooldown - Icons appear when a spell goes on cooldown.\n\n" ..
"Off Cooldown - Icons appear when a spell comes off cooldown and is ready to use again.\n\n" ..
"Auto-Hide After - Icons appear when a spell goes on cooldown and automatically disappear after a set time. See 'Auto-Hide After' option.",
order = 25,
width = "normal",
values = ShowBehaviorValues(),
get = function() return CooldownCursor:GetDBValue("showBehavior") end,
set = function(_, v)
CooldownCursor:SetDBNumber("showBehavior", v)
end,
},
hideAfter = {
type = "range",
name = "Auto-Hide After",
desc = "Icons automatically disappear after this many seconds.\n\n" ..
"Tip: Set to 30-60 seconds to track important cooldowns longer.",
order = 30,
width = "normal",
min = 1,
max = 120,
step = 1,
disabled = function()
return CooldownCursor:GetDBValue("showBehavior") ~= 2
end,
get = function() return CooldownCursor:GetDBValue("hideAfter") end,
set = function(_, v) CooldownCursor:SetHideAfter(v) end,
},
hideWhileMounted = {
type = "toggle",
name = "Hide While Mounted",
desc = "Don't show icons while you're on a mount.",
order = 35,
width = "normal",
get = function() return CooldownCursor:GetDBValue("hideWhileMounted") end,
set = function(_, v) CooldownCursor:SetDBBoolean("hideWhileMounted", v) end,
},
spacer3 = {
type = "description",
name = " ",
order = 38,
},
releaseNotes = {
type = "header",
name = "Release Notes",
order = 100,
},
releaseNotesDesc = {
type = "description",
name = function()
-- Build release notes organized by version (newest first)
if not CooldownCursor.releaseNotes then
return "Check back after the next update for release notes."
end
local notes = CooldownCursor.releaseNotes
local lines = {}
-- Iterate through versions (sorted newest first)
for _, version in ipairs(notes.sortedVersions or {}) do
local versionNotes = notes.byVersion[version]
if versionNotes then
local hasContent = (versionNotes.breakingChanges and #versionNotes.breakingChanges > 0)
or (versionNotes.newFeatures and #versionNotes.newFeatures > 0)
or (versionNotes.fixes and #versionNotes.fixes > 0)
if hasContent then
-- Version header
if #lines > 0 then table.insert(lines, "") end
table.insert(lines, "|cff00ff00v" .. version .. "|r")
-- Breaking Changes
if versionNotes.breakingChanges and #versionNotes.breakingChanges > 0 then
table.insert(lines, " |cffFF1E34Breaking Changes:|r")
for _, change in ipairs(versionNotes.breakingChanges) do
table.insert(lines, " • " .. change)
end
end
-- New Features
if versionNotes.newFeatures and #versionNotes.newFeatures > 0 then
table.insert(lines, " |cff345BFFNew Features:|r")
for _, feature in ipairs(versionNotes.newFeatures) do
table.insert(lines, " • " .. feature)
end
end
-- Fixes
if versionNotes.fixes and #versionNotes.fixes > 0 then
table.insert(lines, " |cffFFBB4AFixes:|r")
for _, fix in ipairs(versionNotes.fixes) do
table.insert(lines, " • " .. fix)
end
end
end
end
end
-- If no versions have content
if #lines == 0 then
return "No release notes for this version."
end
return table.concat(lines, "\n")
end,
order = 101,
fontSize = "medium",
},
},
},
-- ========================================
-- APPEARANCE TAB
-- ========================================
appearanceGroup = {
type = "group",
name = "Appearance",
order = 100,
args = {
header = {
type = "header",
name = "Icon Appearance",
order = 1,
},
description = {
type = "description",
name = "Customize how cooldown icons look.",
order = 2,
},
spacer1 = {
type = "description",
name = " ",
order = 5,
},
iconSize = {
type = "range",
name = "Icon Size",
desc = "Size of the cooldown icon in pixels.\n\n" ..
"Recommended: 48-64 for most setups.",
order = 10,
width = "normal",
min = 16,
max = 128,
step = 1,
get = function() return CooldownCursor:GetDBValue("iconSize") end,
set = function(_, v) CooldownCursor:SetDBNumber("iconSize", v) end,
},
scale = {
type = "range",
name = "Scale",
desc = "Overall scale multiplier for icon and text.\n\n" ..
"Use this to make everything bigger or smaller proportionally.",
order = 20,
width = "normal",
min = 0.5,
max = 5,
step = 0.05,
get = function() return CooldownCursor:GetDBValue("scale") end,
set = function(_, v) CooldownCursor:SetDBNumber("scale", v) end,
},
iconAlpha = {
type = "range",
name = "Icon Transparency",
desc = "How see-through the icon is (0 = invisible, 100 = solid).",
order = 30,
width = "normal",
min = 0,
max = 100,
step = 5,
get = function() return CooldownCursor:GetDBValue("iconAlpha") end,
set = function(_, v) CooldownCursor:SetDBNumber("iconAlpha", v) end,
},
frameStrata1 = {
type = "select",
name = "Frame Strata",
desc = "Controls if icons appear above or below other UI elements.\n\n" ..
"HIGH (recommended) - Above most UI\n" ..
"DIALOG - Above everything\n" ..
"MEDIUM - Standard UI level\n\n" ..
"Change this if icons are appearing behind other frames.",
order = 35,
width = "normal",
values = FrameStrataValues,
get = function() return CooldownCursor:GetDBValue("frameStrata") end,
set = function(_, v) CooldownCursor:SetDBString("frameStrata", v) end,
},
spacer2 = {
type = "description",
name = " ",
order = 35,
},
visualHeader = {
type = "header",
name = "Visual Effects",
order = 40,
},
animation = {
type = "toggle",
name = "Pop Animation",
desc = "Icons briefly scale up when they appear.",
order = 54,
width = "normal",
get = function() return CooldownCursor:GetDBValue("animation") end,
set = function(_, v) CooldownCursor:SetDBBoolean("animation", v) end,
},
procOverlayAtlas = {
type = "select",
name = "Proc Overlay Atlas",
desc = "Select the atlas used for the proc overlay glow.\n\nEnable 'Show Procs' in Quick Settings to see proc visuals and options.",
order = 50,
width = "normal",
disabled = function() return CooldownCursor:GetDBValue("showProcs") == false end,
values = ProcOverlayAtlasValues(),
get = function() return CooldownCursor:GetDBValue("procOverlayAtlas") end,
set = function(_, v)
CooldownCursor:SetDBString("procOverlayAtlas", v)
CooldownCursor:UpdateDisplay()
end,
},
procOverlayColor = {
type = "color",
name = "Proc Overlay Color",
desc = "Tint color for the proc overlay glow.",
order = 50.5,
disabled = function() return CooldownCursor:GetDBValue("showProcs") == false end,
get = function() return HexColorGet("procOverlayColor", "FFFFFF") end,
set = function(_, r, g, b, a) HexColorSet("procOverlayColor", r, g, b, a) end,
},
procOutlineAtlas = {
type = "select",
name = "Proc Outline Atlas",
desc = "Select the atlas used for the proc outline border.\n\nEnable 'Show Procs' in Quick Settings to see proc visuals and options.",
order = 51,
width = "normal",
disabled = function() return CooldownCursor:GetDBValue("showProcs") == false end,
values = ProcOutlineAtlasValues(),
get = function() return CooldownCursor:GetDBValue("procOutlineAtlas") end,
set = function(_, v)
CooldownCursor:SetDBString("procOutlineAtlas", v)
CooldownCursor:UpdateDisplay()
end,
},
procOutlineColor = {
type = "color",
name = "Proc Outline Color",
desc = "Tint color for the proc outline border.",
order = 51.5,
disabled = function() return CooldownCursor:GetDBValue("showProcs") == false end,
get = function() return HexColorGet("procOutlineColor", "FFFFFF") end,
set = function(_, r, g, b, a) HexColorSet("procOutlineColor", r, g, b, a) end,
},
fadeOutDuration = {
type = "range",
name = "Fade Out Duration",
desc = "How long icons take to fade out when hiding (in seconds).\n\n" ..
"Set to 0 for instant disappear.",
order = 55,
width = "normal",
min = 0,
max = 3,
step = 0.05,
get = function() return CooldownCursor:GetDBValue("fadeOutDuration") end,
set = function(_, v) CooldownCursor:SetFadeOutDuration(v) end,
},
showCooldownSwipe = {
type = "toggle",
name = "Cooldown Swipe",
desc = "Show the circular 'clock' animation on the icon.",
order = 60,
width = "normal",
get = function() return CooldownCursor:GetDBValue("showCooldownSwipe") end,
set = function(_, v) CooldownCursor:SetDBBoolean("showCooldownSwipe", v) end,
},
iconHide = {
type = "toggle",
name = "Hide Icon Texture",
desc = "Only show the cooldown numbers/text, not the spell icon.\n\n" ..
"Useful for minimalist setups.",
order = 70,
width = "normal",
get = function() return CooldownCursor:GetDBValue("iconHide") end,
set = function(_, v) CooldownCursor:SetDBBoolean("iconHide", v) end,
},
},
},
-- ========================================
-- DISPLAY & PLACEMENT TAB
-- ========================================
positionGroup = {
type = "group",
name = "Display & Placement",
order = 150,
args = {
header = {
type = "header",
name = "Display & Placement",
order = 1,
},
description = {
type = "description",
name = "Configure where cooldown icons appear and how multiple icons are arranged.\n\n" ..
"|cffaaaaaaTip: Screen mode uses a draggable anchor that is only visible in Preview.|r",
order = 2,
},
spacer1 = {
type = "description",
name = " ",
order = 3,
},
placementHeader = {
type = "header",
name = "Placement",
order = 5,
},
positionMode = {
type = "select",
name = "Position Mode",
desc = "Choose how cooldown icons are positioned.\n\n" ..
"Cursor: follow the mouse cursor (default)\n" ..
"Screen: use a draggable anchor frame (shown only in Preview)",
order = 10,
width = "normal",
values = function()
return CooldownCursor:GetValidPositionModes()
end,
get = function()
return CooldownCursor:GetDBValue("positionMode")
end,
set = function(_, v)
CooldownCursor:SetDBString("positionMode", v)
end,
},
resetAnchor = {
type = "execute",
name = "Reset Anchor Position",
desc = "Reset the draggable anchor back to the screen center.",
order = 15,
width = "normal",
hidden = function()
return CooldownCursor:GetDBValue("positionMode") ~= "SCREEN"
end,
disabled = function()
return InCombatLockdown()
end,
func = function()
CooldownCursorDB.global.offsetX = 0
CooldownCursorDB.global.offsetY = 0
if Internal and Internal.ApplyPositionMode then
Internal.ApplyPositionMode()
end
end,
},
anchor = {
type = "select",
name = "Anchor Point",
desc = "Where to position the icon relative to your cursor.\n\n" ..
"TOPLEFT = Icon appears above and left of cursor",
order = 20,
width = "normal",
values = AnchorValues,
disabled = function()
return CooldownCursor:GetDBValue("positionMode") == "SCREEN"
end,
get = function() return CooldownCursor:GetDBValue("anchor") end,
set = function(_, v) CooldownCursor:SetDBString("anchor", v) end,
},
anchorPadding = {
type = "range",
name = "Cursor Distance",
desc = "How far from the cursor the icon appears (in pixels).",
order = 25,
width = "normal",
min = 0,
max = 100,
step = 1,
disabled = function()
return CooldownCursor:GetDBValue("positionMode") == "SCREEN"
end,
get = function() return CooldownCursor:GetDBValue("anchorPadding") end,
set = function(_, v) CooldownCursor:SetDBNumber("anchorPadding", v) end,
},
-- TODO: Working on better offset controls
-- offsetX = {
-- type = "range",
-- name = "Horizontal Offset",
-- desc = "Additional horizontal adjustment (negative = left, positive = right).",
-- order = 50,
-- width = "normal",
-- min = -500, max = 500, step = 1,
-- get = function() return CooldownCursor:GetDBValue("offsetX") end,
-- set = function(_, v) CooldownCursor:SetDBNumber("offsetX", v) end,
-- },
-- offsetY = {
-- type = "range",
-- name = "Vertical Offset",
-- desc = "Additional vertical adjustment (negative = down, positive = up).",
-- order = 60,
-- width = "normal",
-- min = -500, max = 500, step = 1,
-- get = function() return CooldownCursor:GetDBValue("offsetY") end,
-- set = function(_, v) CooldownCursor:SetDBNumber("offsetY", v) end,
-- },
spacer2 = {
type = "description",
name = " ",
order = 30,
},
layoutHeader = {
type = "header",
name = "Layout",
order = 40,
},
layoutDescription = {
type = "description",
name = "|cffaaaaaaTip: These settings only apply when Display Mode is set to VERTICAL, HORIZONTAL, or RADIUS.|r",
order = 41,
},
displayMode = {
type = "select",
name = "Display Mode",
desc = "How cooldown icons appear:\n\n" ..