-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptions.lua
More file actions
1818 lines (1792 loc) · 68.7 KB
/
Copy pathOptions.lua
File metadata and controls
1818 lines (1792 loc) · 68.7 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 = ...
setfenv(1, _G.SlackHacks)
dbDefaults = {
global = {
configVersion = CONFIG_VERSION,
logs = {
debug = {},
error = {},
isDebugging = false,
errorLoggingEnabled = false,
logPurgeEnabled = true,
logPurgeHours = 48,
},
},
char = {
cache = {
lastKnownGildedStashesRemaining = nil
}
},
profile = {
inventory = {
autoSellGreyItems = false,
autoRepair = false,
autoRepairMode = "personal",
hideBagsFrame = false
},
listviewBag = {
enabled = false,
listViewActive = false,
columnOrder = { "quantity", "name", "ilvl", "armorType", "armorSlot", "bind" },
protectedItems = {},
trashItems = {},
autoSellMarkedItems = false,
point = nil
},
controls = {
maximumCameraZoom = false,
enableDynamicCamera = false
},
mouseRing = {
enabled = false,
showOutOfCombat = false,
scale = 50,
opacity = 100,
color = { r = 1, g = 1, b = 1 }
},
combat = {
raiseCastingNameplates = false,
paladin = {
trackHolyShockCharges = false,
holyShockChargesPosition = "below"
}
},
movableWindows = {
enabled = false,
moveToasts = false, -- adds Blizzard's toast popups (loot, mounts, achievements, etc.) as a draggable box in the real Edit Mode
modifierKey = "NONE", -- "NONE" | "SHIFT" | "CTRL" | "ALT" -- held to drag a registered frame
enableScaling = false, -- scaleModifierKey + mouse wheel over a title bar resizes a registered frame
scaleModifierKey = "NONE", -- "NONE" | "SHIFT" | "CTRL" | "ALT" -- held to scale a registered frame
savePositionStrategy = "permanent", -- "off" | "session" | "permanent"
saveScaleStrategy = "permanent", -- "session" | "permanent"
points = {},
scales = {}
},
minimap = {
enabled = false,
shape = "circle",
showIconsOnHover = false,
showAddonIconsOnHover = false,
hideDiel = false,
showAllMinimapTracking = false,
alpha = 100,
fadeEnabled = false,
combatAlpha = 100,
movingAlpha = 100,
showZoneText = true,
showClock = true,
showTracking = true,
showCalendar = true,
showInstanceDifficulty = true,
showGarrison = true,
showAddonCompartment = true,
addonsInCompartment = false
},
buffs = {
enabled = false,
point = "TOP",
relativePoint = "TOP",
x = 0,
y = -130,
iconSize = 150,
iconGap = 6,
showGlow = true,
showIfExpiring = true,
durationPosition = "below",
lastUsedItems = {},
contentTypes = {
mythicDungeons = true,
nonLfrRaids = true
},
categories = {
wellFed = true,
flask = true,
oil = true,
rune = false
}
},
selfVendor = {
enabled = false,
source = "murlok",
modes = {
[Enum.SelfVendorMode.CONSUMABLES_MISSING] = { enabled = false, triggerEmote = "SALUTE" },
[Enum.SelfVendorMode.CONSUMABLES_ALL] = { enabled = false, triggerEmote = "GLARE" },
[Enum.SelfVendorMode.CONSUMABLES_PERSISTENT] = { enabled = false, triggerEmote = "GAZE" },
[Enum.SelfVendorMode.OIL] = { enabled = false, triggerEmote = "FLIRT" },
[Enum.SelfVendorMode.AUGMENT_RUNES] = { enabled = false, triggerEmote = "FLEX", runeQuantity = 5 },
[Enum.SelfVendorMode.AUGMENTS] = { enabled = false, triggerEmote = "VICTORY" },
[Enum.SelfVendorMode.VANTUS_RUNE] = { enabled = false, triggerEmote = "STARE" },
}
},
weeklies = {
enabled = false,
trackDelves = true
},
infoDisplay = {
enabled = false,
charSheet = {
itemLevel = true,
upgradeTrack = true,
maxUpgradeStar = false,
slotWatermark = true,
secondaryStats = true,
tertiaryStats = false,
itemStats = true,
highWatermarkColoring = true,
enchants = true,
gemSockets = true,
}
},
mounts = {
["ground"] = nil,
["ground-showoff"] = nil,
["skyriding"] = nil,
["skyriding-showoff"] = nil,
["steadyflight"] = nil,
["steadyflight-showoff"] = nil,
["water"] = nil,
["water-showoff"] = nil,
["ground-passenger"] = nil,
["ground-passenger-showoff"] = nil,
["skyriding-passenger"] = nil,
["skyriding-passenger-showoff"] = nil,
["steadyflight-passenger"] = nil,
["steadyflight-passenger-showoff"] = nil,
}
}
}
-- Documentation for AceConfig "Options" tables: https://www.wowace.com/projects/ace3/pages/ace-config-3-0-options-tables
WIP_MODULES = {
{
key = "buffs",
name = "Consumable Buff Reminders",
disable = function()
if Self.db and Self.db.profile and Self.db.profile.buffs then
Self.db.profile.buffs.enabled = false
end
if Self.Buffs and Self.Buffs.Refresh then
Self.Buffs:Refresh()
end
end
},
{
key = "combat",
name = "Combat",
disable = function()
if Self.db and Self.db.profile and Self.db.profile.combat then
Self.db.profile.combat.raiseCastingNameplates = false
if Self.db.profile.combat.paladin then
Self.db.profile.combat.paladin.trackHolyShockCharges = false
end
end
resetNameplateCastLift()
if Self.ChargeTracking and Self.ChargeTracking.Refresh then
Self.ChargeTracking:Refresh()
end
end
},
{
-- Nested under the "Inventory" group instead of a top-level options.args entry.
key = { "inventory", "listviewBag" },
name = "Listview Bag",
disable = function()
if Self.db and Self.db.profile and Self.db.profile.listviewBag then
Self.db.profile.listviewBag.enabled = false
end
if Self.ListviewBag then
Self.ListviewBag:Disable()
end
end
}
}
RETAIL_MODULES = {
{ key = "buffs", name = "Consumable Buff Reminders" },
{ key = { "combat", "paladin" }, name = "Paladin" },
{ key = "vendor", name = "Self Vendor" },
{ key = "weeklies", name = "Weeklies" },
}
-- mod.key is a plain string for a top-level options.args entry, or a table of keys to walk through
-- nested .args groups (e.g. {"inventory", "listviewBag"} ).
local function resolveOptionGroup(key)
if type(key) == "string" then
return options and options.args and options.args[key]
end
local group = options and options.args and options.args[key[1]]
for i = 2, #key do
group = group and group.args and group.args[key[i]]
end
return group
end
local function applyWIPOptionsDecoration()
for _, mod in ipairs(WIP_MODULES) do
local group = resolveOptionGroup(mod.key)
if group then
if not group.name:find("%(WIP%)") then
group.name = "(WIP) " .. group.name
end
local originalDesc = group.desc or ""
if not originalDesc:find("%[Work in Progress%]") then
group.desc = "|cffff8000[Work in Progress]|r " .. originalDesc
end
group.icon = 134070
if group.args then
-- In AceConfigDialog, negative orders sort AFTER positive orders (designed for bottom/footer buttons).
-- To put something at the very top, order must be >= 0 and smaller than any positive order.
-- Shift all existing non-negative args up by 1, and set wipWarning order = 0.
for key, arg in pairs(group.args) do
if key ~= "wipWarning" and type(arg) == "table" and type(arg.order) == "number" and arg.order >= 0 then
arg.order = arg.order + 1
end
end
group.args.wipWarning = {
name = "|cffff8000Warning:|r This module is a work in progress and currently experimental. Use |cffffffff/slack wipoff|r to disable all WIP modules.",
type = "description",
order = 0
}
end
end
end
end
local function hideNonRetailOptions()
for _, mod in ipairs(RETAIL_MODULES) do
local group = resolveOptionGroup(mod.key)
if group then
group.hidden = function() return not isRetail() end
end
end
end
function openOptions()
-- If Blizzard SettingsPanel is already open, toggle it closed:
if SettingsPanel and SettingsPanel:IsShown() then
HideUIPanel(SettingsPanel)
return
end
local categoryID = Self.configCategoryID or (Self.configDialog and Self.configDialog.name)
if Settings and Settings.OpenToCategory and categoryID and not InCombatLockdown() then
Settings.OpenToCategory(categoryID)
return
end
if InterfaceOptionsFrame_OpenToCategory and Self.configDialog and not InCombatLockdown() then
if InterfaceOptionsFrame and InterfaceOptionsFrame:IsShown() then
InterfaceOptionsFrame:Hide()
return
end
InterfaceOptionsFrame_OpenToCategory(Self.configDialog)
return
end
local acd = LibStub("AceConfigDialog-3.0")
if acd.OpenFrames and acd.OpenFrames["SlackHacks"] and acd.OpenFrames["SlackHacks"]:IsShown() then
acd:Close("SlackHacks")
else
acd:Open("SlackHacks")
end
end
toggleOptions = openOptions
local function getWIPModuleNames()
local names = {}
for _, mod in ipairs(WIP_MODULES) do
table.insert(names, mod.name)
end
return table.concat(names, ", ")
end
local function printSlashHelp()
print(grey(icon(16)) .. " " .. color("FFD100")("SlackHacks Slash Commands:") .. "")
print(" " .. color("FFFFFF")("/slack") .. " - Open the SlackHacks config window")
print(" " .. color("FFFFFF")("/slack help") .. " - Show this list of slash commands")
print(" " .. color("FFFFFF")("/slack debug") .. " - Toggle debug mode on/off")
print(" " .. color("FFFFFF")("/slack bugs") .. " - View and report error logs")
print(" " .. color("FFFFFF")("/slack reset") .. " - Reset profile and addon state to defaults")
print(" " .. color("FFFFFF")("/slack wipoff") .. " - Disable work-in-progress modules (" .. getWIPModuleNames() .. ")")
end
function disableWIPModules()
if not Self.db or not Self.db.profile then return end
for _, mod in ipairs(WIP_MODULES) do
if mod.disable then
-- pcall'd so one module erroring out can't abort the loop and leave the remaining WIP
-- modules (and the options UI refresh below) never touched.
local ok, err = pcall(mod.disable)
if not ok then
geterrorhandler()(("SlackHacks: error disabling WIP module '%s': %s"):format(mod.name, tostring(err)))
end
end
end
local acr = LibStub("AceConfigRegistry-3.0", true)
if acr then
acr:NotifyChange("SlackHacks")
end
print("SlackHacks: disabled all WIP modules (" .. getWIPModuleNames() .. ").")
end
function handleSlashCommand(input)
local command = strlower(strtrim(input or ""))
if command == "" then
openOptions()
elseif command == "help" then
printSlashHelp()
elseif command == "debug" then
toggleDebugging()
elseif command == "bugs" then
Self.Debug:ReportErrors()
elseif command == "reset" then
promptResetProfile()
elseif command == "wipoff" then
disableWIPModules()
elseif command == "induce-error" then
Self.Debug:InduceError()
else
print("SlackHacks: unknown command '" .. command .. "'. Type " .. color("FFFFFF")("/slack help") .. " for available commands.")
end
end
local selfVendorEmoteValues, selfVendorEmoteSorting = {}, {}
for token, emote in pairs(SELF_VENDOR_TRIGGER_EMOTES) do
selfVendorEmoteValues[token] = emote.slashCommands
table.insert(selfVendorEmoteSorting, token)
end
table.sort(selfVendorEmoteSorting, function(left, right)
return selfVendorEmoteValues[left] < selfVendorEmoteValues[right]
end)
local selfVendorModeSorting = {
Enum.SelfVendorMode.CONSUMABLES_MISSING,
Enum.SelfVendorMode.CONSUMABLES_ALL,
Enum.SelfVendorMode.CONSUMABLES_PERSISTENT,
Enum.SelfVendorMode.OIL,
Enum.SelfVendorMode.AUGMENT_RUNES,
Enum.SelfVendorMode.VANTUS_RUNE,
Enum.SelfVendorMode.AUGMENTS,
}
local function listviewVendorItemValues()
local values = {}
for key, item in pairs(db.profile.listviewBag.trashItems or {}) do
if type(item) == "table" then
local suffix = "Quality " .. tostring(item.quality or 0) .. ", iLvl " .. tostring(item.itemLevel or 0)
if item.upgradeTrack and item.upgradeTrack ~= "" then
suffix = suffix .. ", " .. item.upgradeTrack
end
values[key] = (item.name or "Unknown item") .. " (" .. suffix .. ")"
else
values[key] = tostring(key)
end
end
return values
end
local function selfVendorModeOptions()
local args = {}
args.enabled = {
name = "Enable Self Vendor",
desc = "Enable or disable all Self Vendor emote and slash-command triggers.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.selfVendor.enabled end,
set = function(_, value) Self.SelfVendor:SetEnabled(value) end,
order = 0,
}
for order, mode in ipairs(selfVendorModeSorting) do
local configuredMode = mode
local details = SELF_VENDOR_MODES[mode]
args[details.key] = {
type = "group",
name = details.name,
inline = true,
order = order,
args = {
description = {
type = "description",
name = details.description,
width = "full",
order = 1,
},
enabled = {
name = "Enable",
type = "toggle",
width = 1.1,
get = function() return db.profile.selfVendor.modes[configuredMode].enabled end,
set = function(_, value) Self.SelfVendor:SetModeEnabled(configuredMode, value) end,
order = 2,
},
triggerEmote = {
name = "Trigger Emote",
type = "select",
width = 1.9,
values = selfVendorEmoteValues,
sorting = selfVendorEmoteSorting,
get = function() return db.profile.selfVendor.modes[configuredMode].triggerEmote end,
set = function(_, value) Self.SelfVendor:SetModeTriggerEmote(configuredMode, value) end,
order = 3,
},
},
}
if mode == Enum.SelfVendorMode.AUGMENT_RUNES then
args[details.key].args.runeQuantity = {
name = "Rune Stack Size",
type = "input",
width = 0.7,
get = function() return tostring(db.profile.selfVendor.modes[configuredMode].runeQuantity) end,
set = function(_, value) Self.SelfVendor:SetRuneQuantity(value) end,
validate = function(_, value) return tonumber(value) and tonumber(value) >= 1 and tonumber(value) <= 100 end,
order = 4,
}
end
end
return args
end
options = {
type = "group",
icon = SLACKHACKS_ICON,
args = {
enable = {
name = "Enable Addon",
desc = "Fully enables/disables the entire addon",
type = "toggle",
width = "full",
get = function() return Self:IsEnabled() end,
set = function() if Self:IsEnabled() then Self:Disable() else Self:Enable() end end,
order = 0 -- first
},
inventory = {
type = "group",
name = "Inventory",
desc = "Small quality-of-life features.",
order = 5,
args = {
autoSellGreyItems = {
name = "Auto Sell Grey Items",
desc = "Automatically sell grey-quality items when visiting a merchant.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.inventory.autoSellGreyItems end,
set = function(_, value) db.profile.inventory.autoSellGreyItems = value end,
order = 3
},
autoRepairGroup = {
type = "group",
name = "Auto Repair",
desc = "Automatically repair all items when visiting a merchant.",
inline = true,
order = 4,
args = {
autoRepair = {
name = "Enable Auto Repair",
desc = "Automatically repair all items when visiting a merchant.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.inventory.autoRepair end,
set = function(_, value) db.profile.inventory.autoRepair = value end,
order = 1
},
autoRepairMode = {
name = "Funds",
desc = "Choose which funds to use for automatic repairs.",
type = "select",
width = "full",
values = {
personal = "Personal Funds",
guild = "Guild Funds",
guildRaid = "Guild Funds (Only in Raids)"
},
sorting = { "personal", "guild", "guildRaid" },
get = function() return db.profile.inventory.autoRepairMode end,
set = function(_, value) db.profile.inventory.autoRepairMode = value end,
disabled = function() return not db.profile.inventory.autoRepair end,
order = 2
},
autoRepairModeDescription = {
type = "description",
name = "Choose which funds to use for automatic repairs.",
width = "full",
order = 3
}
},
},
hideBagsFrame = {
name = "Hide Bags Frame",
desc = "Hides the Blizzard Backpack and Bag icons/frame. " ..
"(Useful if you only use keyboard shortcuts to open your bags.)",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.inventory.hideBagsFrame end,
set = function(_, value)
db.profile.inventory.hideBagsFrame = value
applyHideBagsFrame()
end,
order = 4.5
},
listviewBag = {
type = "group",
name = "Listview Bag",
desc = "A sortable list-view alternative to the default grid bag window.",
order = 5,
args = {
enabled = {
name = "Enable",
desc = "Adds a toggle button to the bag window's title bar that switches between the default " ..
"grid view and a sortable list view of your inventory.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.listviewBag.enabled end,
set = function(_, value)
db.profile.listviewBag.enabled = value
if value then
-- Otherwise there'd be no way to reach the in-window toggle button the first time,
-- since it lives inside a window that only shows once list view is already active.
db.profile.listviewBag.listViewActive = true
Self.ListviewBag:Enable()
else
Self.ListviewBag:Disable()
end
end,
order = 1
},
autoSellMarkedItems = {
name = "Auto-Sell Items Marked for Vendoring",
desc = "Sell marked items automatically when opening a merchant. Otherwise, they sell when you " ..
"confirm Blizzard's Sell All Junk action.",
type = "toggle",
get = function() return db.profile.listviewBag.autoSellMarkedItems end,
set = function(_, value) db.profile.listviewBag.autoSellMarkedItems = value end,
width = "full",
order = 2
},
autoVendorItems = {
name = "Auto-Vendor Items",
desc = "Uncheck an item to remove it from the auto-vendor list.",
type = "multiselect",
values = listviewVendorItemValues,
get = function(_, key) return db.profile.listviewBag.trashItems[key] ~= nil end,
set = function(_, key, value)
if not value then
db.profile.listviewBag.trashItems[key] = nil
if Self.ListviewBag then
Self.ListviewBag:Refresh()
end
end
end,
width = "full",
order = 3
}
}
}
}
},
controls = {
type = "group",
name = "Controls",
desc = "Camera behavior and keybinding options.",
order = 5.2,
args = {
openKeybindings = {
name = "Open Keybindings",
desc = "Open the Blizzard Key Bindings menu, expanded to the SlackHacks section.",
descStyle = "inline",
type = "execute",
func = function() openKeybindings() end,
order = 0
},
maximumCameraZoom = {
name = "Maximum Camera Zoom",
desc = "Allow the camera to zoom out to its maximum distance.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.controls.maximumCameraZoom end,
set = function(_, value)
db.profile.controls.maximumCameraZoom = value
Self.Controls:ApplyAll()
end,
order = 1
},
enableDynamicCamera = {
name = "Enable Dynamic Camera (Basic Mode)",
desc = "Causes the camera to shift in view for more visibility. Try it out!",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.controls.enableDynamicCamera end,
set = function(_, value)
db.profile.controls.enableDynamicCamera = value
Self.Controls:ApplyAll()
end,
order = 2
}
}
},
mouseRing = {
type = "group",
name = "Mouse Ring",
desc = "Shows a ring around your mouse cursor.",
order = 6.5,
args = {
enabled = {
name = "Enable",
desc = "Show a ring around your mouse cursor.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.mouseRing.enabled end,
set = function(_, value) Self.MouseRing:SetEnabled(value) end,
order = 0
},
showOutOfCombat = {
name = "Show Out of Combat",
desc = "Also show the ring while out of combat. When disabled, the ring only appears while you're " ..
"in combat.",
type = "toggle",
descStyle = "inline",
width = "full",
disabled = function() return not db.profile.mouseRing.enabled end,
get = function() return db.profile.mouseRing.showOutOfCombat end,
set = function(_, value)
db.profile.mouseRing.showOutOfCombat = value
Self.MouseRing:Refresh()
end,
order = 1
},
scale = {
name = "Scale",
desc = "Size of the ring as a percentage of its default size.",
type = "range",
min = 25,
max = 100,
step = 5,
disabled = function() return not db.profile.mouseRing.enabled end,
get = function() return db.profile.mouseRing.scale end,
set = function(_, value)
db.profile.mouseRing.scale = value
Self.MouseRing:Refresh()
end,
order = 2
},
opacity = {
name = "Opacity",
desc = "Opacity of the ring.",
type = "range",
min = 0,
max = 100,
step = 1,
disabled = function() return not db.profile.mouseRing.enabled end,
get = function() return db.profile.mouseRing.opacity end,
set = function(_, value)
db.profile.mouseRing.opacity = value
Self.MouseRing:Refresh()
end,
order = 3
},
color = {
name = "Color",
desc = "Color of the ring.",
type = "color",
hasAlpha = false,
disabled = function() return not db.profile.mouseRing.enabled end,
get = function()
local color = db.profile.mouseRing.color
return color.r, color.g, color.b
end,
set = function(_, r, g, b)
db.profile.mouseRing.color.r = r
db.profile.mouseRing.color.g = g
db.profile.mouseRing.color.b = b
Self.MouseRing:Refresh()
end,
order = 4
}
}
},
debug = {
type = "group",
name = "Debug",
desc = "Debugging, error logging, and reporting options.",
order = 2,
args = {
errorReportingGroup = {
type = "group",
name = "Error Logging and Reporting",
desc = "Captures and reports errors that occur within SlackHacks.",
inline = true,
order = 1,
args = {
logErrors = {
name = "Log Errors",
desc = "Captures errors that occur specifically within SlackHacks (not other addons), with timestamps, " ..
"character names, and de-duplicated by message. Works independently of Debug Mode. " ..
"BugSack and BugGrabber continue capturing all errors normally.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.global.logs and db.global.logs.errorLoggingEnabled end,
set = function(_, value)
Self.Debug:SetErrorLoggingEnabled(value)
end,
order = 1
},
showReportErrorLog = {
name = "Report Errors",
desc = "Opens a window displaying all errors formatted in GitHub-compatible Markdown, provides a " ..
"direct issue link, and attempts to report pending logs directly to Slack.",
type = "execute",
func = function() Self.Debug:ReportErrors() end,
order = 2
},
clearErrorLog = {
name = "Clear Error Log",
desc = "Clear all SlackHacks error logs stored in SlackHacksDB.",
type = "execute",
func = function()
clearErrorLogs()
print("SlackHacks: error logs cleared")
end,
confirm = true,
order = 3
}
}
},
debugModeGroup = {
type = "group",
name = "Debug Mode",
desc = "Debug logging and verbose output options.",
inline = true,
order = 2,
args = {
debugLogging = {
name = "Debug Logging",
desc = "Prints debug information to the chat window and logs to DB for later analysis.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.global.logs and db.global.logs.isDebugging end,
set = function()
toggleDebugging()
end,
order = 1
},
clearDebugLogs = {
name = "Clear Debug Logs",
desc = "Clear all debug logs stored in SlackHacksDB.",
type = "execute",
func = function()
clearDebugLogs()
print("SlackHacks: debug logs cleared")
end,
confirm = true,
order = 2
}
}
},
logPurgeGroup = {
type = "group",
name = "Log Purging",
desc = "Automatically remove old debug logs and error logs so SlackHacksDB doesn't grow unbounded.",
inline = true,
order = 3,
args = {
logPurgeEnabled = {
name = "Automatically Purge Old Logs",
desc = "Once per login, remove logged entries older than the configured number of hours.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.global.logs and db.global.logs.logPurgeEnabled end,
set = function(_, value)
if not db.global.logs then db.global.logs = { debug = {}, error = {} } end
db.global.logs.logPurgeEnabled = value
end,
order = 1
},
logPurgeHours = {
name = "Keep Logs For (Hours)",
desc = "Number of hours to keep a log entry before it is eligible for automatic purging.",
type = "input",
width = "full",
get = function() return tostring(db.global.logs and db.global.logs.logPurgeHours or 48) end,
set = function(_, value)
if not db.global.logs then db.global.logs = { debug = {}, error = {} } end
db.global.logs.logPurgeHours = tonumber(value)
end,
validate = function(_, value)
local hours = tonumber(value)
return hours and hours >= LOG_PURGE_MIN_HOURS and hours <= LOG_PURGE_MAX_HOURS
end,
disabled = function() return not (db.global.logs and db.global.logs.logPurgeEnabled) end,
order = 2
},
purgeNow = {
name = "Purge Old Logs Now",
desc = "Immediately remove logged entries older than the configured number of hours.",
type = "execute",
func = function()
purgeOldLogs()
print("SlackHacks: old logs purged")
end,
order = 3
}
}
}
}
},
combat = {
type = "group",
name = "Combat",
desc = "Combat-related features.",
order = 98,
args = {
raiseCastingNameplates = {
name = "Raise Casting Nameplates",
desc = "Raise enemy nameplates while they are casting.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.combat.raiseCastingNameplates end,
set = function(_, value)
db.profile.combat.raiseCastingNameplates = value
updateNameplateCastEventRegistration()
resetNameplateCastLift()
end,
order = 1
},
paladin = {
type = "group",
name = "Paladin",
desc = "Combat features specific to Paladins.",
order = 2,
args = {
trackHolyShockCharges = {
name = "Track Holy Shock Charges",
desc = "Show two circular charge trackers next to the Holy Power bar for Holy Shock.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.combat.paladin.trackHolyShockCharges end,
set = function(_, value)
db.profile.combat.paladin.trackHolyShockCharges = value
Self.ChargeTracking:Refresh()
end,
order = 1
},
holyShockChargesPosition = {
name = "Position",
desc = "Where to anchor the Holy Shock charge trackers relative to the Holy Power bar.",
type = "select",
width = "full",
values = {
above = "Above Holy Power Bar",
below = "Below Holy Power Bar"
},
sorting = { "above", "below" },
get = function() return db.profile.combat.paladin.holyShockChargesPosition end,
set = function(_, value)
db.profile.combat.paladin.holyShockChargesPosition = value
Self.ChargeTracking:Refresh()
end,
disabled = function() return not db.profile.combat.paladin.trackHolyShockCharges end,
order = 2
}
}
}
}
},
minimap = {
type = "group",
name = "Minimap",
desc = "Minimap shape, opacity, and button visibility.",
order = 7.5,
args = {
enabled = {
name = "Enable",
desc = "Enable minimap enhancements. When disabled, the minimap looks and behaves exactly like " ..
"stock Blizzard UI.",
type = "toggle",
descStyle = "inline",
width = "full",
get = function() return db.profile.minimap.enabled end,
set = function(_, value)
db.profile.minimap.enabled = value
if value then
Self.Minimap:Enable()
else
Self.Minimap:Disable()
end
Self.Minimap:Refresh()
end,
order = 0
},
openEditMode = {
name = "Open Visual Settings via Edit Mode",
desc = "Open Blizzard's Edit Mode and select the Minimap to configure its visual settings and " ..
"position/size.",
type = "execute",
func = function()
if InCombatLockdown() then return end
if SettingsPanel and SettingsPanel:IsShown() then
HideUIPanel(SettingsPanel)
end
if EditModeManagerFrame then
ShowUIPanel(EditModeManagerFrame)
end
end,
disabled = function() return not db.profile.minimap.enabled end,
order = 0.1
},
showAllMinimapTracking = {
name = "Show All Tracking Options",
desc = "Show all minimap tracking options,\nincluding the option to turn off target tracking.",
type = "toggle",
descStyle = "inline",
width = "full",
disabled = function() return not db.profile.minimap.enabled end,
get = function() return db.profile.minimap.showAllMinimapTracking end,
set = function(_, value)
db.profile.minimap.showAllMinimapTracking = value
Self.Minimap:Refresh()
end,
order = 0.2
},
showAddonIconsOnHover = {
name = "Show Addon Icons on Hover Only",
desc = "Only show addon minimap icons and the Addon Compartment when hovering over the minimap.",
type = "toggle",
descStyle = "inline",
width = "full",
disabled = function() return not db.profile.minimap.enabled end,
get = function() return db.profile.minimap.showAddonIconsOnHover end,
set = function(_, value)
db.profile.minimap.showAddonIconsOnHover = value
Self.Minimap:Refresh()
end,
order = 1
},
addonsInCompartment = {
name = "Move Addon Icons to Addon Compartment",
desc = "Move third-party addon icons into the Addon Compartment menu instead of showing them on " ..
"the minimap.",
type = "toggle",
descStyle = "inline",
width = "full",
disabled = function() return not db.profile.minimap.enabled end,
get = function() return db.profile.minimap.addonsInCompartment end,
set = function(_, value)
db.profile.minimap.addonsInCompartment = value
Self.Minimap:Refresh()
end,
order = 2
},
hideDiel = {
name = "Hide Day/Night Icon",
desc = [[Hide the big useless day/night (diel) icon (Classic/Forever).]],