Repository navigation
Expand file tree
/
Copy pathArcUI_Options.lua
More file actions
1620 lines (1504 loc) · 63.1 KB
/
Copy pathArcUI_Options.lua
File metadata and controls
1620 lines (1504 loc) · 63.1 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
-- ===================================================================
-- ArcUI_Options.lua
-- Main Options registration for Arc UI
-- v3.4.2: Fixed OpenOptions nil error and added AceDB error handling
-- ===================================================================
local ADDON, ns = ...
ns.Options = ns.Options or {}
local AceConfig = LibStub("AceConfig-3.0")
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
local AceDB = LibStub("AceDB-3.0")
local LSM = LibStub("LibSharedMedia-3.0", true)
local function GetGlobalFontValues()
local fonts = { ["Friz Quadrata TT"] = "Friz Quadrata TT" }
if LSM then
for _, name in pairs(LSM:List("font")) do
fonts[name] = name
end
end
return fonts
end
local function GetGlobalStatusBarTextureValues()
local textures = { ["Blizzard"] = "Blizzard", ["Smooth"] = "Smooth" }
if LSM then
for _, name in pairs(LSM:List("statusbar")) do
textures[name] = name
end
end
return textures
end
-- Profile browser collapsed state (defaults closed)
local profileBrowserCollapsed = true
-- ===================================================================
-- RELIABLE PANEL OPEN/CLOSE DETECTION
-- Hook AceConfigDialog:Open and :Close directly - much more reliable
-- than trying to hook frame OnShow/OnHide
-- ===================================================================
if not AceConfigDialog._arcUIHooked then
AceConfigDialog._arcUIHooked = true
-- Hook Close
hooksecurefunc(AceConfigDialog, "Close", function(self, appName)
if appName == "ArcUI" then
ns._arcUIOptionsOpen = false
-- Re-evaluate aura textures (hide previews, disable movers)
if ns.Textures and ns.Textures.OnOptionsClosed then
ns.Textures.OnOptionsClosed()
end
-- Make cooldown bars click-through again
if ns.CooldownBars and ns.CooldownBars.RefreshMouseInteractivity then
ns.CooldownBars.RefreshMouseInteractivity()
end
-- Fire registered panel callbacks (ArcAurasCooldown, SpellUsability, etc.)
if ns.CDMShared and ns.CDMShared.FirePanelCallbacks then
ns.CDMShared.FirePanelCallbacks(false)
end
if ns.CDMGroups and ns.CDMGroups.DynamicLayout and ns.CDMGroups.DynamicLayout.OnOptionsPanelClosed then
ns.CDMGroups.DynamicLayout.OnOptionsPanelClosed()
end
-- IMMEDIATE: All panel-close logic (reflow, click-through, visuals)
if ns.CDMGroups and ns.CDMGroups.OnArcUIPanelChanged then
ns.CDMGroups.OnArcUIPanelChanged(false)
end
end
end)
-- Hook Open (backup - we also call directly in OpenOptions)
hooksecurefunc(AceConfigDialog, "Open", function(self, appName)
if appName == "ArcUI" then
local wasOpen = ns._arcUIOptionsOpen
ns._arcUIOptionsOpen = true
-- Only fire layout/restore callbacks on actual open (closed → open).
-- NotifyChange causes AceConfig to call Open again while already open,
-- which would re-run Layout+RestoreIconsToSavedPositions on every UI rebuild.
if not wasOpen then
-- Fire registered panel callbacks (ArcAurasCooldown, SpellUsability, etc.)
if ns.CDMShared and ns.CDMShared.FirePanelCallbacks then
ns.CDMShared.FirePanelCallbacks(true)
end
if ns.CDMGroups and ns.CDMGroups.DynamicLayout and ns.CDMGroups.DynamicLayout.OnOptionsPanelOpened then
ns.CDMGroups.DynamicLayout.OnOptionsPanelOpened()
end
-- IMMEDIATE: All panel-open logic (borders, scan, drag, visuals)
if ns.CDMGroups and ns.CDMGroups.OnArcUIPanelChanged then
ns.CDMGroups.OnArcUIPanelChanged(true)
end
end
end
end)
end
-- ===================================================================
-- ADDON INFO
-- ===================================================================
-- Get version from TOC file (auto-updates when TOC changes)
local function GetAddonVersion()
if C_AddOns and C_AddOns.GetAddOnMetadata then
return C_AddOns.GetAddOnMetadata(ADDON, "Version") or "Unknown"
elseif GetAddOnMetadata then
return GetAddOnMetadata(ADDON, "Version") or "Unknown"
end
return "Unknown"
end
ns.AddonInfo = {
Version = GetAddonVersion(),
Discord = "https://discord.gg/yMZmnFjUTd",
Author = "Arc",
}
-- ===================================================================
-- DISCORD LINK BUTTON (must be defined before OpenOptions)
-- ===================================================================
local function CreateDiscordLink(parentFrame)
if parentFrame._arcUIDiscordLink then return end
local container = CreateFrame("Frame", nil, parentFrame)
container:SetSize(200, 20)
container:SetPoint("TOPRIGHT", parentFrame, "TOPRIGHT", -10, -8)
local label = container:CreateFontString(nil, "OVERLAY", "GameFontNormal")
label:SetPoint("RIGHT", container, "RIGHT", 0, 0)
label:SetText("|cff5865F2Discord:|r |cff7289DA" .. ns.AddonInfo.Discord .. "|r")
local link = CreateFrame("EditBox", nil, container)
link:SetSize(200, 20)
link:SetPoint("RIGHT", container, "RIGHT", 0, 0)
link:SetFontObject(GameFontNormal)
link:SetAutoFocus(false)
link:EnableMouse(true)
link:SetText(ns.AddonInfo.Discord)
link:SetCursorPosition(0)
link:Hide()
container:EnableMouse(true)
container:SetScript("OnEnter", function(self)
label:SetText("|cff5865F2Discord:|r |cffffffffClick to copy|r")
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM")
GameTooltip:AddLine("Click to copy Discord link", 1, 1, 1)
GameTooltip:Show()
end)
container:SetScript("OnLeave", function(self)
label:SetText("|cff5865F2Discord:|r |cff7289DA" .. ns.AddonInfo.Discord .. "|r")
GameTooltip:Hide()
end)
container:SetScript("OnMouseDown", function(self)
link:Show()
link:SetFocus()
link:HighlightText()
label:Hide()
end)
link:SetScript("OnEditFocusLost", function(self)
self:Hide()
label:Show()
end)
link:SetScript("OnEscapePressed", function(self)
self:ClearFocus()
end)
link:SetScript("OnEnterPressed", function(self)
self:ClearFocus()
end)
parentFrame._arcUIDiscordLink = container
end
-- ===================================================================
-- EARLY OPENOPTIONS DEFINITION (before PLAYER_LOGIN)
-- This ensures /arcui always has a function to call, even if DB fails
-- ===================================================================
local optionsRegistered = false
ns.API = ns.API or {}
-- Define OpenOptions early - will be replaced with full version after registration
ns.API.OpenOptions = function()
if not optionsRegistered then
print("|cff00ccffArc UI|r Options not ready yet. Try again in a moment.")
print("|cff00ccffArc UI|r If this persists, type: /arcui reset-db")
return
end
if InCombatLockdown() then
ns._arcPendingOptionsOpen = true
print("|cff00ccffArc UI|r Options will open when combat ends.")
return
end
ns._arcPendingOptionsOpen = nil
ns._arcUIOptionsOpen = true -- Flag for Resources module to detect options are open
-- Restore saved position/size into AceConfig's own status table BEFORE Open
-- AceConfig reads status.top/left/width/height inside Open via SetStatusTable
do
local globalDB = ns.API.GetGlobalDB and ns.API.GetGlobalDB()
local pos = globalDB and globalDB.optionsPanelPos
local size = globalDB and globalDB.optionsPanelSize
if pos or size then
local status = AceConfigDialog:GetStatusTable("ArcUI")
if status then
if pos then status.top = pos.top; status.left = pos.left end
if size then status.width = size.width; status.height = size.height end
-- Clamp to screen so saved positions from different resolutions don't go offscreen
local sw, sh = GetScreenWidth(), GetScreenHeight()
local w = status.width or 900
local h = status.height or 700
if status.top then status.top = math.max(h, math.min(status.top, sh)) end
if status.left then status.left = math.max(0, math.min(status.left, sw - w)) end
-- Also clamp size to screen
if w > sw then status.width = sw end
if h > sh - 50 then status.height = sh - 50 end
end
end
end
AceConfigDialog:Open("ArcUI")
-- CDM_Shared's ACD:Open posthook sets ns.optionsPanelOpen and fires all callbacks
-- First time these options are opened on a build that HAS a tour, ask once
-- whether they want it. Deferred a frame so it lands over a drawn panel; the
-- answer (either way) is remembered per patch, so it never asks twice.
if ns.Tour and ns.Tour.OfferIfNew then
C_Timer.After(0.35, function() ns.Tour.OfferIfNew() end)
end
-- Refresh resource bars immediately so they show despite talent/spec/combat conditions
if ns.Resources and ns.Resources.RefreshAllBars then
ns.Resources.RefreshAllBars()
end
-- Refresh aura textures so they preview (and become draggable) while open
if ns.Textures and ns.Textures.RefreshAll then
ns.Textures.RefreshAll()
end
-- Cooldown bars become draggable while open; click-through when closed
if ns.CooldownBars and ns.CooldownBars.RefreshMouseInteractivity then
ns.CooldownBars.RefreshMouseInteractivity()
end
-- Show "Hidden by Bar" overlays on CDM icons that are being hidden
C_Timer.After(0.1, function()
if ns.API.ShowHiddenByBarOverlays then
ns.API.ShowHiddenByBarOverlays()
end
end)
C_Timer.After(0.05, function()
local widget = AceConfigDialog.OpenFrames["ArcUI"]
if widget and widget.frame then
local actualFrame = widget.frame
local globalDB = ns.API.GetGlobalDB and ns.API.GetGlobalDB()
local alpha = globalDB and globalDB.menuBackgroundAlpha or 1.0
-- Create solid background
if not actualFrame._arcUISolidBgFrame then
actualFrame._arcUISolidBgFrame = CreateFrame("Frame", nil, actualFrame)
actualFrame._arcUISolidBgFrame:SetPoint("TOPLEFT", actualFrame, "TOPLEFT", 8, -8)
actualFrame._arcUISolidBgFrame:SetPoint("BOTTOMRIGHT", actualFrame, "BOTTOMRIGHT", -8, 8)
actualFrame._arcUISolidBgFrame:SetFrameLevel(math.max(1, actualFrame:GetFrameLevel() - 1))
actualFrame._arcUISolidBgFrame.tex = actualFrame._arcUISolidBgFrame:CreateTexture(nil, "BACKGROUND")
actualFrame._arcUISolidBgFrame.tex:SetAllPoints()
actualFrame._arcUISolidBgFrame.tex:SetColorTexture(0.02, 0.02, 0.02, 1)
end
actualFrame._arcUISolidBgFrame:SetAlpha(alpha)
actualFrame._arcUISolidBgFrame:Show()
-- Position/size restored via AceConfig status table before Open — nothing to do here
-- Stretch the drag area across the full top of the frame.
-- AceGUIContainer-Frame: titletext is a child of the title Frame (the drag handle).
-- widget.titletext is exposed, so :GetParent() gives us the title frame directly.
-- We clear its points and anchor it across the full frame top so the whole
-- header bar is draggable, not just the narrow title texture.
if not actualFrame._arcUITitleStretched then
actualFrame._arcUITitleStretched = true
local widget = AceConfigDialog.OpenFrames["ArcUI"]
if widget and widget.titletext then
local titleFrame = widget.titletext:GetParent()
if titleFrame and titleFrame ~= actualFrame then
titleFrame:ClearAllPoints()
titleFrame:SetPoint("TOPLEFT", actualFrame, "TOPLEFT", 0, 0)
titleFrame:SetPoint("TOPRIGHT", actualFrame, "TOPRIGHT", 0, 0)
titleFrame:SetHeight(28)
end
end
end
-- Create Discord link at top right (or show existing one)
CreateDiscordLink(actualFrame)
if actualFrame._arcUIDiscordLink then
actualFrame._arcUIDiscordLink:Show()
end
-- Hook OnHide for cleanup (visual elements, drag mode, etc)
-- NOTE: OnOptionsPanelClosed is called via AceConfigDialog:Close hook, not here
if not actualFrame._arcUIOnHideHooked then
actualFrame._arcUIOnHideHooked = true
local originalOnHide = actualFrame:GetScript("OnHide")
actualFrame:SetScript("OnHide", function(self, ...)
if originalOnHide then originalOnHide(self, ...) end
-- Clear options open flag (backup - Close hook also does this)
ns._arcUIOptionsOpen = false
-- Backup: re-evaluate textures + cooldown bar click-through
if ns.Textures and ns.Textures.OnOptionsClosed then
ns.Textures.OnOptionsClosed()
end
if ns.CooldownBars and ns.CooldownBars.RefreshMouseInteractivity then
ns.CooldownBars.RefreshMouseInteractivity()
end
-- Fire registered panel callbacks (backup path)
if ns.CDMShared and ns.CDMShared.FirePanelCallbacks then
ns.CDMShared.FirePanelCallbacks(false)
end
-- BACKUP: Run panel-close logic if Close hook didn't fire
-- (e.g. Escape key, other addons closing the frame)
if ns.CDMGroups and ns.CDMGroups.OnArcUIPanelChanged then
ns.CDMGroups.OnArcUIPanelChanged(false)
end
-- Hide "Hidden by Bar" overlays
if ns.API.HideHiddenByBarOverlays then
ns.API.HideHiddenByBarOverlays()
end
-- Save panel position and size via AceConfig status table (kept up to date by AceGUI on drag/resize)
do
local globalDB = ns.API.GetGlobalDB and ns.API.GetGlobalDB()
if globalDB then
local status = AceConfigDialog:GetStatusTable("ArcUI")
if status then
globalDB.optionsPanelPos = { top = status.top, left = status.left }
globalDB.optionsPanelSize = { width = status.width, height = status.height }
end
end
end
-- CRITICAL: Hide Discord link when panel closes
-- AceConfigDialog reuses frame objects, so our Discord link would
-- appear on other addons' config panels if we don't hide it
if self._arcUIDiscordLink then
self._arcUIDiscordLink:Hide()
end
if self._arcUISolidBgFrame then
self._arcUISolidBgFrame:Hide()
end
if ns.Display and ns.Display.HideDeleteButtons then
ns.Display.HideDeleteButtons()
end
if ns.Resources and ns.Resources.HideDeleteButtons then
ns.Resources.HideDeleteButtons()
end
if ns.CDMEnhance and ns.CDMEnhance.SetUnlocked then
ns.CDMEnhance.SetUnlocked(false)
end
if ns.CDMGroups and ns.CDMGroups.SetDragMode then
ns.CDMGroups.SetDragMode(false)
end
C_Timer.After(0.1, function()
if ns.API.ValidateAllBarTracking then
ns.API.ValidateAllBarTracking()
end
-- Refresh resource bars to re-apply visibility rules now that options panel is closed
-- (bars with unmet talent conditions or wrong spec should now be hidden again)
if ns.Resources and ns.Resources.RefreshAllBars then
ns.Resources.RefreshAllBars()
end
end)
end)
end
end
if ns.API.ValidateAllBarTracking then
ns.API.ValidateAllBarTracking()
end
end)
end
-- ===================================================================
-- MODULE MASTER SWITCHES (Settings > Modules)
-- Peripheral modules can be turned off entirely: runtime gated AND their
-- options tab hidden until re-enabled here. Account-wide. ONE flag per
-- module, never two: Kick Assist and Loot Planner route to the master
-- flags those modules already own; Castbar and Pings use
-- ns.db.global.moduleToggles (nil = enabled, so current installs keep
-- everything on).
-- ===================================================================
function ns.API.IsModuleEnabled(key)
if key == "kickassist" then
local g = ns.db and ns.db.global and ns.db.global.setMyKick
return not g or g.enabled ~= false
end
if key == "lootplanner" then
-- export absent = the standalone owns it (module file early-returns);
-- the tab then shows the dormant notice, so treat as enabled
if ns.BonusRollIsEnabled then return ns.BonusRollIsEnabled() and true or false end
return true
end
local t = ns.db and ns.db.global and ns.db.global.moduleToggles
return not t or t[key] ~= false
end
function ns.API.SetModuleEnabled(key, v)
v = v and true or false
if key == "kickassist" then
if ns.SetMyKick and ns.SetMyKick.SetEnabled then ns.SetMyKick.SetEnabled(v) end
return
end
if key == "lootplanner" then
if ns.BonusRollSetEnabled then ns.BonusRollSetEnabled(v) end
return
end
if ns.db and ns.db.global then
ns.db.global.moduleToggles = ns.db.global.moduleToggles or {}
ns.db.global.moduleToggles[key] = v
end
-- live apply: modules re-evaluate their own gates
if key == "castbar" then
if ns.Castbar and ns.Castbar.ApplyAppearance then ns.Castbar.ApplyAppearance() end
if ns.FocusCastbar and ns.FocusCastbar.ApplyAppearance then ns.FocusCastbar.ApplyAppearance() end
if ns.TargetCastbar and ns.TargetCastbar.ApplyAppearance then ns.TargetCastbar.ApplyAppearance() end
elseif key == "pings" then
if ns.PingsOnModuleToggled then ns.PingsOnModuleToggled(v) end
end
end
-- ===================================================================
-- MAIN OPTIONS TABLE
-- ===================================================================
local function GetOptionsTable()
local optionsTable = {
type = "group",
name = "Arc UI",
childGroups = "tab",
args = {
icons = {
type = "group",
name = "Icons",
order = 1,
childGroups = "tab",
args = {
groups = (function()
local tbl = ns.GetCDMGroupsOptionsTable and ns.GetCDMGroupsOptionsTable() or {
type = "group",
name = "Groups",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Groups"
tbl.order = 1
return tbl
end)(),
cdmIcons = (function()
local tbl = ns.GetCDMIconsOptionsTable and ns.GetCDMIconsOptionsTable() or {
type = "group",
name = "Icon Catalog",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Icon Catalog"
tbl.order = 2
return tbl
end)(),
defaults = {
type = "group",
name = "Globals",
order = 5,
childGroups = "tab",
args = {
auraDefaults = (function()
local tbl = ns.GetCDMGlobalAuraDefaultsOptionsTable and ns.GetCDMGlobalAuraDefaultsOptionsTable() or {
type = "group",
name = "Aura Globals",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Aura Globals"
tbl.order = 1
return tbl
end)(),
cooldownDefaults = (function()
local tbl = ns.GetCDMGlobalCooldownDefaultsOptionsTable and ns.GetCDMGlobalCooldownDefaultsOptionsTable() or {
type = "group",
name = "Cooldown Globals",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Cooldown Globals"
tbl.order = 2
return tbl
end)(),
},
},
-- Extras tab (Keybind Display, Assisted Combat Highlight, Button Press Highlight)
extras = (function()
local tbl = ns.GetCDMUtilitiesOptionsTable and ns.GetCDMUtilitiesOptionsTable() or {
type = "group",
name = "Extras",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Extras"
tbl.order = 6
return tbl
end)(),
-- (Arc Icons + Custom Icons tabs RETIRED 2026-08-09: the Icon
-- Catalog absorbed everything — Add popup, filters, Load
-- Conditions, Arc Icon Settings, mounted timer editor, auto-track
-- config, bulk management. The FILES stay loaded: the catalog
-- consumes ns.GetCustomIconsOptionsTable for the editor mount and
-- the ns.ArcAurasOptions exports/popup.)
-- Profiles tab: Arc Manager profile selector + Profile Browser combined
profiles = (function()
local profileMgr = ns.GetCDMProfileManagerOnlyOptionsTable and ns.GetCDMProfileManagerOnlyOptionsTable() or { args = {} }
local profileBrowser = ns.GetCDMProfileBrowserOptionsTable and ns.GetCDMProfileBrowserOptionsTable() or { args = {} }
-- Merge browser args under a collapsible header, re-keyed to avoid conflicts
local mergedArgs = {}
for k, v in pairs(profileMgr.args or {}) do
mergedArgs[k] = v
end
-- Browser section header with collapsible toggle
mergedArgs["browserSectionHeader"] = {
type = "toggle",
name = "|cffffd100Profile Browser|r",
desc = "Browse, rename, or delete profiles across all characters and specs",
dialogControl = "CollapsibleHeader",
order = 50,
width = "full",
get = function() return not profileBrowserCollapsed end,
set = function(_, v) profileBrowserCollapsed = not v end,
}
mergedArgs["browserSectionDesc"] = {
type = "description",
name = "|cffaaaaaaBrowse, rename, or delete profiles across all characters and specs on this account.|r",
order = 51,
fontSize = "small",
hidden = function() return profileBrowserCollapsed end,
}
-- Inline the browser args at order 52+ sorted by original order
local browserOrder = 52
local sortedBrowser = {}
for k, v in pairs(profileBrowser.args or {}) do
table.insert(sortedBrowser, { key = k, val = v, ord = v.order or 999 })
end
table.sort(sortedBrowser, function(a, b) return a.ord < b.ord end)
for _, item in ipairs(sortedBrowser) do
local entry = {}
for ek, ev in pairs(item.val) do entry[ek] = ev end
entry.order = browserOrder
browserOrder = browserOrder + 1
local origHidden = entry.hidden
entry.hidden = function()
if profileBrowserCollapsed then return true end
if origHidden then return origHidden() end
return false
end
mergedArgs["browser_" .. item.key] = entry
end
return {
type = "group",
name = "Profiles",
order = 7,
args = mergedArgs,
}
end)(),
sharing = (function()
if ns.CDMSharedProfiles and ns.CDMSharedProfiles.GetOptionsTable then
local tbl = ns.CDMSharedProfiles.GetOptionsTable()
tbl.name = "Account Sharing"
tbl.order = 8
return tbl
end
return {
type = "group",
name = "Account Sharing",
order = 8,
args = { loading = { type = "description", name = "Loading...", order = 1 } },
}
end)(),
},
},
-- ═══════════════════════════════════════════════════════════════
-- AURAS: buff/debuff tracking. One catalog (Bars) where you pick an
-- aura and create a bar or a texture, plus the shared Appearance.
-- ═══════════════════════════════════════════════════════════════
auras = {
type = "group",
name = "Buffs/Debuffs",
order = 2,
childGroups = "tab",
args = {
auraBars = (function()
local tbl = ns.TrackingOptions and ns.TrackingOptions.GetBuffDebuffSetupTable() or {
type = "group",
name = "Catalog",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Catalog"
tbl.order = 1
return tbl
end)(),
textures = (function()
local tbl = ns.GetTexturesOptionsTable and ns.GetTexturesOptionsTable() or {
type = "group",
name = "Textures",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Textures"
tbl.order = 2
return tbl
end)(),
appearance = (function()
local tbl = ns.AppearanceOptions and ns.AppearanceOptions.GetOptionsTable() or {
type = "group",
name = "Appearance",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Appearance"
tbl.order = 3
return tbl
end)(),
},
},
-- ═══════════════════════════════════════════════════════════════
-- COOLDOWNS: spell cooldown / charge / custom-timer bars + castbar.
-- ═══════════════════════════════════════════════════════════════
cooldowns = {
type = "group",
name = "Cooldowns",
order = 3,
childGroups = "tab",
args = {
cooldownBars = (function()
local tbl = ns.CooldownBarOptions and ns.CooldownBarOptions.GetOptionsTable() or {
type = "group",
name = "Cooldown Bars",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Cooldown Bars"
tbl.order = 1
return tbl
end)(),
timerBars = (function()
local tbl = ns.TimerBarOptions and ns.TimerBarOptions.GetOptionsTable() or {
type = "group",
name = "Custom Bars",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Custom Bars"
tbl.order = 2
return tbl
end)(),
cooldownReminder = (function()
local tbl = ns.GetCooldownReminderOptionsTable and ns.GetCooldownReminderOptionsTable() or {
type = "group",
name = "Cooldown Reminder",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Cooldown Reminder"
tbl.order = 3
return tbl
end)(),
appearance = (function()
local tbl = ns.AppearanceOptions and ns.AppearanceOptions.GetOptionsTable() or {
type = "group",
name = "Appearance",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Appearance"
tbl.order = 4
return tbl
end)(),
},
},
resources = {
type = "group",
name = "Resources",
order = 4,
childGroups = "tab",
args = {
setup = (function()
local tbl = ns.TrackingOptions and ns.TrackingOptions.GetResourceSetupTable() or {
type = "group",
name = "Setup",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Setup"
tbl.order = 1
return tbl
end)(),
appearance = (function()
local tbl = ns.AppearanceOptions and ns.AppearanceOptions.GetOptionsTable() or {
type = "group",
name = "Appearance",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Appearance"
tbl.order = 2
return tbl
end)(),
},
},
-- ═══════════════════════════════════════════════════════════════
-- IMPORT / EXPORT
-- Tabs: CDM Export | Display Export | Master Export | Import (unified)
-- ═══════════════════════════════════════════════════════════════
importExport = {
type = "group",
name = "Import/Export",
order = 7,
childGroups = "tab",
args = {
cdmExport = (function()
local tbl = ns.GetCDMExportOnlyOptionsTable and ns.GetCDMExportOnlyOptionsTable() or {
type = "group",
name = "Icon Manager Export",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Icon Manager Export"
tbl.order = 1
return tbl
end)(),
barsExport = (function()
local tbl = ns.GetBarsExportOnlyOptionsTable and ns.GetBarsExportOnlyOptionsTable() or {
type = "group",
name = "Display Export",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
-- "Display Export": bars AND textures (and the castbar) ride one string
tbl.name = "Display Export"
tbl.order = 2
return tbl
end)(),
masterExport = (function()
local tbl = ns.GetCDMMasterExportOptionsTable and ns.GetCDMMasterExportOptionsTable() or {
type = "group",
name = "Master Export",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Master Export"
tbl.order = 3
return tbl
end)(),
crExport = (function()
local tbl = ns.GetCRExportOnlyOptionsTable and ns.GetCRExportOnlyOptionsTable() or {
type = "group",
name = "Cooldown Reminder Export",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Cooldown Reminder Export"
tbl.order = 3.5
return tbl
end)(),
castbarExport = (function()
local tbl = ns.GetCastbarExportOnlyOptionsTable and ns.GetCastbarExportOnlyOptionsTable() or {
type = "group",
name = "Castbar Export",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Castbar Export"
tbl.order = 3.7
return tbl
end)(),
unifiedImport = (function()
local tbl = ns.GetUnifiedImportExportOptionsTable and ns.GetUnifiedImportExportOptionsTable() or {
type = "group",
name = "Import",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Import"
tbl.order = 4
return tbl
end)(),
},
},
migration = (function()
local tbl = ns.GetMigrationOptionsTable and ns.GetMigrationOptionsTable() or {
type = "group",
name = "Migration",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Migration"
tbl.order = 8
return tbl
end)(),
castbar = {
type = "group",
name = "Castbar",
order = 5,
childGroups = "tab",
hidden = function() return not ns.API.IsModuleEnabled("castbar") end,
args = {
playerCastbar = (function()
local tbl = ns.CastbarOptions and ns.CastbarOptions.GetOptionsTable() or {
type = "group",
name = "Player Castbar",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Player Castbar"
tbl.order = 1
return tbl
end)(),
focusCastbar = (function()
local tbl = ns.FocusCastbarOptions and ns.FocusCastbarOptions.GetOptionsTable() or {
type = "group",
name = "Focus Castbar",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Focus Castbar"
tbl.order = 2
return tbl
end)(),
targetCastbar = (function()
local tbl = ns.TargetCastbarOptions and ns.TargetCastbarOptions.GetOptionsTable() or {
type = "group",
name = "Target Castbar",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Target Castbar"
tbl.order = 3
return tbl
end)(),
},
},
setMyKick = (function()
local tbl = ns.GetSetMyKickOptionsTable and ns.GetSetMyKickOptionsTable() or {
type = "group",
name = "Kick Assist",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Kick Assist"
tbl.order = 6
tbl.hidden = function() return not ns.API.IsModuleEnabled("kickassist") end
return tbl
end)(),
pings = (function()
local tbl = ns.GetPingsOptionsTable and ns.GetPingsOptionsTable() or {
type = "group",
name = "Pings",
args = { loading = { type = "description", name = "Loading...", order = 1 } }
}
tbl.name = "Pings"
tbl.order = 6.5
tbl.hidden = function() return not ns.API.IsModuleEnabled("pings") end
return tbl
end)(),
bonusroll = (function()
-- the module early-returns when the standalone Arc Loot Planner
-- addon (or its old Arc Bonus Roll name) is installed, so a missing
-- table here means "standalone owns it"
local tbl = ns.GetBonusRollOptionsTable and ns.GetBonusRollOptionsTable() or {
type = "group",
name = "Loot Planner",
args = { standalone = { type = "description", order = 1, fontSize = "medium",
name = "The standalone Arc Loot Planner addon is installed and active - it owns this feature, and ArcUI's built-in copy is dormant. Configure it with /alp." } }
}
tbl.name = "Loot Planner"
tbl.order = 6.6
tbl.hidden = function() return not ns.API.IsModuleEnabled("lootplanner") end
return tbl
end)(),
settings = {
type = "group",
name = "Settings",
order = 9,
args = {
modulesHeader = {
type = "header",
name = "Modules",
order = 0.1,
},
modulesDesc = {
type = "description",
order = 0.2,
name = "Master switches for ArcUI's side modules. Turning one OFF disables the whole module and hides its tab until you re-enable it here.",
},
moduleCastbar = {
type = "toggle", order = 0.3, width = 0.9,
name = "Castbar",
desc = "The player, focus, and target castbars. OFF hides all three bars, releases the Blizzard castbar, and hides the Castbar tab.",
get = function() return ns.API.IsModuleEnabled("castbar") end,
set = function(_, v) ns.API.SetModuleEnabled("castbar", v) end,
},
moduleKickAssist = {
type = "toggle", order = 0.4, width = 0.9,
name = "Kick Assist",
desc = "The interrupt-marker helper. Same switch as the one on its own tab and in its popup window.",
get = function() return ns.API.IsModuleEnabled("kickassist") end,
set = function(_, v) ns.API.SetModuleEnabled("kickassist", v) end,
},
modulePings = {
type = "toggle", order = 0.5, width = 0.9,
name = "Pings",
desc = "The ping feed window and ping keybinds. OFF stops the feed, disables every ping keybind entry, and hides the Pings tab.",
get = function() return ns.API.IsModuleEnabled("pings") end,
set = function(_, v) ns.API.SetModuleEnabled("pings", v) end,
},
moduleLootPlanner = {
type = "toggle", order = 0.6, width = 0.9,
name = "Loot Planner",
desc = "The bonus roll planner. Same switch as the one on its own tab. When the standalone Arc Loot Planner addon is installed it owns the feature and this toggle does nothing.",
get = function() return ns.API.IsModuleEnabled("lootplanner") end,
set = function(_, v) ns.API.SetModuleEnabled("lootplanner", v) end,
},
menuHeader = {
type = "header",
name = "Background",
order = 1
},
menuBackgroundAlpha = {
type = "range",
name = "Menu Background Solidity",
desc = "Control how solid/opaque the options panel background is (0 = see-through, 1 = fully solid dark background)",
order = 2,
min = 0,
max = 1,
step = 0.05,
isPercent = true,
width = 1.5,
get = function()
local globalDB = ns.API.GetGlobalDB and ns.API.GetGlobalDB()
return globalDB and globalDB.menuBackgroundAlpha or 1.0
end,
set = function(_, val)
local globalDB = ns.API.GetGlobalDB and ns.API.GetGlobalDB()
if globalDB then
globalDB.menuBackgroundAlpha = val
local widget = AceConfigDialog.OpenFrames["ArcUI"]
if widget and widget.frame and widget.frame._arcUISolidBgFrame then
widget.frame._arcUISolidBgFrame:SetAlpha(val)
end
end
end,
},
fontTextureHeader = {
type = "header",
name = "Global Font & Texture",
order = 3,
},
fontTextureDesc = {
type = "description",
name = "|cffaaaaaaPick a font and statusbar texture once, then push them onto everything: every aura, resource, cooldown, and timer bar, both castbars, and every CDM icon group's cooldown/stack text, custom labels, and keybind text -- no need to set it in each group individually. This updates everything in place; anything can still be customized afterward.|r",
order = 4,
fontSize = "medium",
},
globalFont = {
type = "select",
dialogControl = "LSM30_Font",
name = "Font",
order = 5,
width = 1.2,
values = GetGlobalFontValues,
get = function()
local g = ns.API.GetGlobalDB and ns.API.GetGlobalDB()
return g and g.globalFont or "Friz Quadrata TT"
end,
set = function(_, val)
local g = ns.API.GetGlobalDB and ns.API.GetGlobalDB()
if g then g.globalFont = val end
end,
},