-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathOptions.lua
More file actions
7451 lines (6342 loc) · 432 KB
/
Copy pathOptions.lua
File metadata and controls
7451 lines (6342 loc) · 432 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, DF = ...
-- ============================================================
-- GUI PAGE SETUP - Collapsible Category System
-- ============================================================
function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
-- Helper function to create a themed "Copy to Raid/Party" button for a section
local function CreateCopyButton(parent, prefixes, sectionName, pageId)
-- Register section in the sync registry
if pageId then
DF.SectionRegistry[pageId] = prefixes
end
local btn = CreateFrame("Button", nil, parent, "BackdropTemplate")
btn:SetSize(115, 26)
-- Apply element backdrop style
if not btn.SetBackdrop then Mixin(btn, BackdropTemplateMixin) end
btn:SetBackdrop({
bgFile = "Interface\\Buttons\\WHITE8x8",
edgeFile = "Interface\\Buttons\\WHITE8x8",
edgeSize = 1,
})
-- Icon
btn.Icon = btn:CreateTexture(nil, "OVERLAY")
btn.Icon:SetPoint("LEFT", 8, 0)
btn.Icon:SetSize(14, 14)
btn.Icon:SetTexture("Interface\\AddOns\\DandersFrames\\Media\\Icons\\content_copy")
-- Text
btn.Text = btn:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
btn.Text:SetPoint("LEFT", btn.Icon, "RIGHT", 4, 0)
-- Sync toggle button
local linkBtn
if pageId then
linkBtn = CreateFrame("Button", nil, btn, "BackdropTemplate")
linkBtn:SetSize(120, 26)
linkBtn:SetPoint("RIGHT", btn, "LEFT", -4, 0)
if not linkBtn.SetBackdrop then Mixin(linkBtn, BackdropTemplateMixin) end
linkBtn:SetBackdrop({
bgFile = "Interface\\Buttons\\WHITE8x8",
edgeFile = "Interface\\Buttons\\WHITE8x8",
edgeSize = 1,
})
linkBtn.Icon = linkBtn:CreateTexture(nil, "OVERLAY")
linkBtn.Icon:SetPoint("LEFT", 8, 0)
linkBtn.Icon:SetSize(14, 14)
linkBtn.Icon:SetTexture("Interface\\AddOns\\DandersFrames\\Media\\Icons\\refresh")
linkBtn.Text = linkBtn:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
linkBtn.Text:SetPoint("LEFT", linkBtn.Icon, "RIGHT", 4, 0)
end
-- Update appearance based on current mode
local function UpdateAppearance()
local mode = GUI.SelectedMode or "party"
local themeColor = GUI.GetThemeColor()
if mode == "party" then
btn.Text:SetText("Copy to Raid")
else
btn.Text:SetText("Copy to Party")
end
-- Normal state colors
btn:SetBackdropColor(0.18, 0.18, 0.18, 1)
btn:SetBackdropBorderColor(themeColor.r, themeColor.g, themeColor.b, 0.5)
btn.Text:SetTextColor(0.6, 0.6, 0.6)
btn.Icon:SetVertexColor(0.6, 0.6, 0.6)
-- Update sync button appearance
if linkBtn then
local dest = mode == "party" and "Raid" or "Party"
local isLinked = DF.db and DF.db.linkedSections and DF.db.linkedSections[pageId]
if isLinked then
linkBtn.Text:SetText("Synced with " .. dest)
linkBtn:SetBackdropColor(themeColor.r * 0.2, themeColor.g * 0.2, themeColor.b * 0.2, 1)
linkBtn:SetBackdropBorderColor(themeColor.r, themeColor.g, themeColor.b, 1)
linkBtn.Text:SetTextColor(themeColor.r, themeColor.g, themeColor.b)
linkBtn.Icon:SetVertexColor(themeColor.r, themeColor.g, themeColor.b)
else
linkBtn.Text:SetText("Sync with " .. dest)
linkBtn:SetBackdropColor(0.18, 0.18, 0.18, 1)
linkBtn:SetBackdropBorderColor(themeColor.r, themeColor.g, themeColor.b, 0.5)
linkBtn.Text:SetTextColor(0.6, 0.6, 0.6)
linkBtn.Icon:SetVertexColor(0.6, 0.6, 0.6)
end
end
end
-- Store for refresh
btn.UpdateModeText = UpdateAppearance
btn.rightAlign = true -- Flag for layout system
-- Hover effects
btn:SetScript("OnEnter", function(self)
local themeColor = GUI.GetThemeColor()
self:SetBackdropColor(themeColor.r * 0.3, themeColor.g * 0.3, themeColor.b * 0.3, 1)
self:SetBackdropBorderColor(themeColor.r, themeColor.g, themeColor.b, 1)
self.Text:SetTextColor(themeColor.r, themeColor.g, themeColor.b)
self.Icon:SetVertexColor(themeColor.r, themeColor.g, themeColor.b)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
local mode = GUI.SelectedMode or "party"
local src = mode == "party" and "Party" or "Raid"
local dest = mode == "party" and "Raid" or "Party"
GameTooltip:SetText("Copy " .. sectionName .. " Settings")
GameTooltip:AddLine("Copies these settings from " .. src .. " to " .. dest .. ".", 1, 1, 1, true)
GameTooltip:Show()
end)
btn:SetScript("OnLeave", function(self)
UpdateAppearance()
GameTooltip:Hide()
end)
btn:SetScript("OnClick", function()
local mode = GUI.SelectedMode or "party"
local dest = mode == "party" and "Raid" or "Party"
-- Show confirmation
StaticPopupDialogs["DANDERSFRAMES_COPY_SECTION"] = {
text = "Copy " .. sectionName .. " settings to " .. dest .. "?",
button1 = "Copy",
button2 = "Cancel",
OnAccept = function()
DF:CopySectionSettings(prefixes, mode)
if GUI.RefreshCurrentPage then GUI:RefreshCurrentPage() end
end,
timeout = 0,
whileDead = true,
hideOnEscape = true,
}
StaticPopup_Show("DANDERSFRAMES_COPY_SECTION")
end)
-- Sync button event handlers
if linkBtn then
linkBtn:SetScript("OnEnter", function(self)
local themeColor = GUI.GetThemeColor()
local isLinked = DF.db and DF.db.linkedSections and DF.db.linkedSections[pageId]
self:SetBackdropColor(themeColor.r * 0.3, themeColor.g * 0.3, themeColor.b * 0.3, 1)
self:SetBackdropBorderColor(themeColor.r, themeColor.g, themeColor.b, 1)
self.Text:SetTextColor(themeColor.r, themeColor.g, themeColor.b)
self.Icon:SetVertexColor(themeColor.r, themeColor.g, themeColor.b)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
if isLinked then
GameTooltip:SetText("Synced: " .. sectionName)
GameTooltip:AddLine("Party & Raid " .. sectionName .. " settings are synced.\nClick to stop syncing.", 1, 1, 1, true)
else
GameTooltip:SetText("Sync: " .. sectionName)
GameTooltip:AddLine("Click to sync Party & Raid " .. sectionName .. " settings.\nChanges in one mode will automatically apply to the other.", 1, 1, 1, true)
end
GameTooltip:Show()
end)
linkBtn:SetScript("OnLeave", function()
UpdateAppearance()
GameTooltip:Hide()
end)
linkBtn:SetScript("OnClick", function()
if not DF.db then return end
if not DF.db.linkedSections then DF.db.linkedSections = {} end
if DF.db.linkedSections[pageId] then
DF.db.linkedSections[pageId] = nil
UpdateAppearance()
else
local mode = GUI.SelectedMode or "party"
local dest = mode == "party" and "Raid" or "Party"
StaticPopupDialogs["DANDERSFRAMES_LINK_SECTION"] = {
text = "Sync " .. sectionName .. " settings?\n\nThis will copy current " .. sectionName .. " settings to " .. dest .. " and keep them in sync.",
button1 = "Sync",
button2 = "Cancel",
OnAccept = function()
DF.db.linkedSections[pageId] = true
DF:CopySectionSettings(prefixes, mode)
if GUI.RefreshCurrentPage then GUI:RefreshCurrentPage() end
end,
timeout = 0,
whileDead = true,
hideOnEscape = true,
}
StaticPopup_Show("DANDERSFRAMES_LINK_SECTION")
end
end)
end
-- Initial update
UpdateAppearance()
-- Register for theme updates
if not parent.ThemeListeners then parent.ThemeListeners = {} end
table.insert(parent.ThemeListeners, {UpdateTheme = UpdateAppearance})
return btn
end
-- Expose for use by sub-pages (e.g. Aura Designer)
GUI.CreateCopyButton = CreateCopyButton
-- Define category order (updated structure)
GUI.CategoryOrder = {"general", "clickcast", "display", "bars", "text", "auras", "indicators", "profiles", "debug"}
-- ========================================
-- CATEGORY: General
-- ========================================
CreateCategory("general", "General")
-- ========================================
-- CATEGORY: Display (new top-level category)
-- ========================================
CreateCategory("display", "Display")
-- Display > Visibility
local pageVisibility = CreateSubTab("display", "display_visibility", "Visibility")
BuildPage(pageVisibility, function(self, db, Add, AddSpace, AddSyncPoint)
-- ===== FRAME DISPLAY GROUP (Column 1) =====
local frameDisplayGroup = GUI:CreateSettingsGroup(self.child, 280)
frameDisplayGroup:AddWidget(GUI:CreateHeader(self.child, "Frame Display"), 40)
local soloMode = frameDisplayGroup:AddWidget(GUI:CreateCheckbox(self.child, "Solo Mode", db, "soloMode", function()
DF:UpdateAllFrames()
DF:UpdateDefaultPlayerFrame()
end), 30)
soloMode.hideOn = function() return GUI.SelectedMode == "raid" end
frameDisplayGroup:AddWidget(GUI:CreateCheckbox(self.child, "Show Minimap Button", db, "showMinimapButton", function()
DF:UpdateMinimapButton()
end), 30)
local restedIndicator = frameDisplayGroup:AddWidget(GUI:CreateCheckbox(self.child, "Rested Indicator", db, "restedIndicator", function()
DF:UpdateRestedIndicator()
end), 30)
restedIndicator.hideOn = function() return GUI.SelectedMode == "raid" end
restedIndicator.disableOn = function(d) return not d.soloMode end
restedIndicator.tooltip = "Show rested indicators when in a rested area (inn, city)."
local restedIcon = frameDisplayGroup:AddWidget(GUI:CreateCheckbox(self.child, " Show ZZZ Icon", db, "restedIndicatorIcon", function()
DF:UpdateRestedIndicator()
end), 30)
restedIcon.hideOn = function() return GUI.SelectedMode == "raid" end
restedIcon.disableOn = function(d) return not d.soloMode or not d.restedIndicator end
restedIcon.tooltip = "Show the animated ZZZ icon on the player frame."
local restedGlow = frameDisplayGroup:AddWidget(GUI:CreateCheckbox(self.child, " Show Frame Glow", db, "restedIndicatorGlow", function()
DF:UpdateRestedIndicator()
end), 30)
restedGlow.hideOn = function() return GUI.SelectedMode == "raid" end
restedGlow.disableOn = function(d) return not d.soloMode or not d.restedIndicator end
restedGlow.tooltip = "Show a pulsing yellow glow around the frame."
local soloNote = frameDisplayGroup:AddWidget(GUI:CreateLabel(self.child, "Solo Mode: Show your player frame when not in a group.", 250), 30)
soloNote.hideOn = function() return GUI.SelectedMode == "raid" end
local hidePlayer = frameDisplayGroup:AddWidget(GUI:CreateCheckbox(self.child, "Hide Self from Party Frames", db, "hidePlayerFrame", function()
-- Update the secure header's showPlayer attribute
if not InCombatLockdown() and DF.partyHeader then
DF.partyHeader:SetAttribute("showPlayer", not db.hidePlayerFrame)
end
-- Reapply header settings to reposition frames
if DF.ApplyHeaderSettings then
DF:ApplyHeaderSettings()
end
DF:UpdateAllFrames()
end), 30)
hidePlayer.hideOn = function() return GUI.SelectedMode == "raid" end
hidePlayer.tooltip = "Removes your player frame from the DandersFrames party display."
Add(frameDisplayGroup, nil, 1)
-- ===== BLIZZARD FRAMES GROUP (Column 2) =====
local blizzardGroup = GUI:CreateSettingsGroup(self.child, 280)
blizzardGroup:AddWidget(GUI:CreateHeader(self.child, "Blizzard Frames"), 40)
local hideDefaultPlayer = blizzardGroup:AddWidget(GUI:CreateCheckbox(self.child, "Hide Blizzard Player Frame", db, "hideDefaultPlayerFrame", function()
DF:UpdateDefaultPlayerFrame()
end), 30)
hideDefaultPlayer.tooltip = "Hides the default Blizzard player portrait and health bar."
local hidePartyCheck = blizzardGroup:AddWidget(GUI:CreateCheckbox(self.child, "Hide Blizzard Party Frames", db, "hideBlizzardPartyFrames", function()
DF:UpdateBlizzardFrameVisibility()
end), 30)
hidePartyCheck.hideOn = function() return GUI.SelectedMode == "raid" end
local hideRaidCheck = blizzardGroup:AddWidget(GUI:CreateCheckbox(self.child, "Hide Blizzard Raid Frames", db, "hideBlizzardRaidFrames", function()
DF:UpdateBlizzardFrameVisibility()
end), 30)
hideRaidCheck.hideOn = function() return GUI.SelectedMode == "party" end
blizzardGroup:AddWidget(GUI:CreateLabel(self.child, "Hides Blizzard frames but keeps them active for aura filtering.", 250), 40)
local sideMenuCheck = blizzardGroup:AddWidget(GUI:CreateCheckbox(self.child, "Show Party/Raid Side Menu", db, "showBlizzardSideMenu", function()
DF:UpdateBlizzardFrameVisibility()
end), 30)
sideMenuCheck.hideOn = function(d)
if GUI.SelectedMode == "raid" then
return not d.hideBlizzardRaidFrames
else
return not d.hideBlizzardPartyFrames
end
end
local sideMenuLabel = blizzardGroup:AddWidget(GUI:CreateLabel(self.child, "Shows the ping wheel & party management menu.", 250), 30)
sideMenuLabel.hideOn = function(d)
if GUI.SelectedMode == "raid" then
return not d.hideBlizzardRaidFrames
else
return not d.hideBlizzardPartyFrames
end
end
Add(blizzardGroup, nil, 2)
end)
-- Display > Tooltips (moved from General)
local pageTooltips = CreateSubTab("display", "display_tooltips", "Tooltips")
BuildPage(pageTooltips, function(self, db, Add, AddSpace, AddSyncPoint)
-- Copy button at top right (positioned automatically via rightAlign)
Add(CreateCopyButton(self.child, {"tooltip"}, "Tooltips", "display_tooltips"), 25, 2)
-- Anchor position values (shared)
local anchorPositionValues = {
TOPLEFT = "Top Left",
TOP = "Top",
TOPRIGHT = "Top Right",
LEFT = "Left",
CENTER = "Center",
RIGHT = "Right",
BOTTOMLEFT = "Bottom Left",
BOTTOM = "Bottom",
BOTTOMRIGHT = "Bottom Right",
}
-- ===== ROW 1: Frame Tooltips + Buff Tooltips =====
-- Frame Tooltips (Column 1)
local frameTooltipGroup = GUI:CreateSettingsGroup(self.child, 280)
frameTooltipGroup:AddWidget(GUI:CreateHeader(self.child, "Frame Tooltips"), 40)
frameTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Frame Tooltips", db, "tooltipFrameEnabled", nil), 30)
frameTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Disable in Combat", db, "tooltipFrameDisableInCombat", function() end), 30)
local frameAnchorValues = {
DEFAULT = "Game Default",
CURSOR = "Cursor",
FRAME = "Unit Frame",
}
frameTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor To", frameAnchorValues, db, "tooltipFrameAnchor", function() GUI:RefreshCurrentPage() end), 55)
local frameAnchorPos = frameTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor Position", anchorPositionValues, db, "tooltipFrameAnchorPos", function() end), 55)
frameAnchorPos.disableOn = function(d) return d.tooltipFrameAnchor == "DEFAULT" end
local frameOffsetX = frameTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "X Offset", -100, 100, 1, db, "tooltipFrameX", function() end), 55)
frameOffsetX.disableOn = function(d) return d.tooltipFrameAnchor ~= "FRAME" end
local frameOffsetY = frameTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "Y Offset", -100, 100, 1, db, "tooltipFrameY", function() end), 55)
frameOffsetY.disableOn = function(d) return d.tooltipFrameAnchor ~= "FRAME" end
Add(frameTooltipGroup, nil, 1)
-- Buff Tooltips (Column 2)
local buffTooltipGroup = GUI:CreateSettingsGroup(self.child, 280)
buffTooltipGroup:AddWidget(GUI:CreateHeader(self.child, "Buff Tooltips"), 40)
buffTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Buff Tooltips", db, "tooltipBuffEnabled", nil), 30)
buffTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Disable in Combat", db, "tooltipBuffDisableInCombat", function() end), 30)
local buffAnchorValues = {
DEFAULT = "Game Default",
CURSOR = "Cursor",
FRAME = "Buff Icon",
}
buffTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor To", buffAnchorValues, db, "tooltipBuffAnchor", function() GUI:RefreshCurrentPage() end), 55)
local buffAnchorPos = buffTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor Position", anchorPositionValues, db, "tooltipBuffAnchorPos", function() end), 55)
buffAnchorPos.disableOn = function(d) return d.tooltipBuffAnchor == "DEFAULT" end
local buffOffsetX = buffTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "X Offset", -100, 100, 1, db, "tooltipBuffX", function() end), 55)
buffOffsetX.disableOn = function(d) return d.tooltipBuffAnchor ~= "FRAME" end
local buffOffsetY = buffTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "Y Offset", -100, 100, 1, db, "tooltipBuffY", function() end), 55)
buffOffsetY.disableOn = function(d) return d.tooltipBuffAnchor ~= "FRAME" end
Add(buffTooltipGroup, nil, 2)
-- Sync point: align row 2 to start at the same level
AddSyncPoint()
-- ===== ROW 2: Debuff Tooltips + Defensive Icon Tooltips =====
-- Debuff Tooltips (Column 1)
local debuffTooltipGroup = GUI:CreateSettingsGroup(self.child, 280)
debuffTooltipGroup:AddWidget(GUI:CreateHeader(self.child, "Debuff Tooltips"), 40)
debuffTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Debuff Tooltips", db, "tooltipDebuffEnabled", nil), 30)
debuffTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Disable in Combat", db, "tooltipDebuffDisableInCombat", function() end), 30)
local debuffAnchorValues = {
DEFAULT = "Game Default",
CURSOR = "Cursor",
FRAME = "Debuff Icon",
}
debuffTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor To", debuffAnchorValues, db, "tooltipDebuffAnchor", function() GUI:RefreshCurrentPage() end), 55)
local debuffAnchorPos = debuffTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor Position", anchorPositionValues, db, "tooltipDebuffAnchorPos", function() end), 55)
debuffAnchorPos.disableOn = function(d) return d.tooltipDebuffAnchor == "DEFAULT" end
local debuffOffsetX = debuffTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "X Offset", -100, 100, 1, db, "tooltipDebuffX", function() end), 55)
debuffOffsetX.disableOn = function(d) return d.tooltipDebuffAnchor ~= "FRAME" end
local debuffOffsetY = debuffTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "Y Offset", -100, 100, 1, db, "tooltipDebuffY", function() end), 55)
debuffOffsetY.disableOn = function(d) return d.tooltipDebuffAnchor ~= "FRAME" end
Add(debuffTooltipGroup, nil, 1)
-- Defensive Icon Tooltips (Column 2)
local defTooltipGroup = GUI:CreateSettingsGroup(self.child, 280)
defTooltipGroup:AddWidget(GUI:CreateHeader(self.child, "Defensive Icon Tooltips"), 40)
defTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Defensive Icon Tooltips", db, "tooltipDefensiveEnabled", nil), 30)
defTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Disable in Combat", db, "tooltipDefensiveDisableInCombat", function() end), 30)
local defAnchorValues = {
DEFAULT = "Game Default",
CURSOR = "Cursor",
FRAME = "Defensive Icon",
}
defTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor To", defAnchorValues, db, "tooltipDefensiveAnchor", function() GUI:RefreshCurrentPage() end), 55)
local defAnchorPos = defTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor Position", anchorPositionValues, db, "tooltipDefensiveAnchorPos", function() end), 55)
defAnchorPos.disableOn = function(d) return d.tooltipDefensiveAnchor == "DEFAULT" end
local defOffsetX = defTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "X Offset", -100, 100, 1, db, "tooltipDefensiveX", function() end), 55)
defOffsetX.disableOn = function(d) return d.tooltipDefensiveAnchor ~= "FRAME" end
local defOffsetY = defTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "Y Offset", -100, 100, 1, db, "tooltipDefensiveY", function() end), 55)
defOffsetY.disableOn = function(d) return d.tooltipDefensiveAnchor ~= "FRAME" end
Add(defTooltipGroup, nil, 2)
-- Sync point: align row 3
AddSyncPoint()
-- ===== ROW 3: Binding Tooltips =====
-- Binding Tooltips (Column 1)
local bindTooltipGroup = GUI:CreateSettingsGroup(self.child, 280)
bindTooltipGroup:AddWidget(GUI:CreateHeader(self.child, "Binding Tooltips"), 40)
bindTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Binding Tooltips", db, "tooltipBindingEnabled", nil), 30)
bindTooltipGroup:AddWidget(GUI:CreateCheckbox(self.child, "Disable in Combat", db, "tooltipBindingDisableInCombat", function() end), 30)
local bindAnchorValues = {
DEFAULT = "Game Default",
CURSOR = "Cursor",
FRAME = "Unit Frame",
}
bindTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor To", bindAnchorValues, db, "tooltipBindingAnchor", function() GUI:RefreshCurrentPage() end), 55)
local bindAnchorPos = bindTooltipGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor Position", anchorPositionValues, db, "tooltipBindingAnchorPos", function() end), 55)
bindAnchorPos.disableOn = function(d) return d.tooltipBindingAnchor == "DEFAULT" end
local bindOffsetX = bindTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "X Offset", -100, 100, 1, db, "tooltipBindingX", function() end), 55)
bindOffsetX.disableOn = function(d) return d.tooltipBindingAnchor ~= "FRAME" end
local bindOffsetY = bindTooltipGroup:AddWidget(GUI:CreateSlider(self.child, "Y Offset", -100, 100, 1, db, "tooltipBindingY", function() end), 55)
bindOffsetY.disableOn = function(d) return d.tooltipBindingAnchor ~= "FRAME" end
Add(bindTooltipGroup, nil, 1)
-- Sync point before See Also
AddSyncPoint()
AddSpace(20, "both")
-- See Also links
Add(GUI:CreateSeeAlso(self.child, {
{pageId = "auras_buffs", label = "Buffs"},
{pageId = "auras_debuffs", label = "Debuffs"},
{pageId = "auras_bossdebuffs", label = "Boss Debuffs"},
{pageId = "auras_defensiveicon", label = "Defensive Icon"},
}), 30, "both")
end)
-- Display > Fading (moved from Indicators > Out of Range + Dead/Offline fading)
local pageFading = CreateSubTab("display", "display_fading", "Fading")
BuildPage(pageFading, function(self, db, Add, AddSpace, AddSyncPoint)
-- Copy button at top right
Add(CreateCopyButton(self.child, {"rangeFade", "oor", "dead", "offline", "healthFade", "hf"}, "Fading", "display_fading"), 25, 2)
-- Sync point: ensures both columns start below the copy button
AddSpace(10, "both")
-- Helper to check if element options should be hidden
local function HideOOROptions(d)
return not d.oorEnabled
end
-- Helper to check if frame-level alpha should be hidden (when element-specific is enabled)
local function HideFrameLevelAlpha(d)
return d.oorEnabled
end
-- ===== OUT OF RANGE GROUP (Column 1) =====
local oorGroup = GUI:CreateSettingsGroup(self.child, 280)
oorGroup:AddWidget(GUI:CreateHeader(self.child, "Out of Range"), 40)
-- Build dropdown options dynamically
local function GetRangeSpellDropdownOptions()
local options = {}
if DF.GetRangeSpellOptions then
local spellOptions = DF:GetRangeSpellOptions()
for _, opt in ipairs(spellOptions) do
options[opt.value] = opt.label
end
else
options[0] = "Auto (Spec Default)"
end
return options
end
-- Ensure db value is not nil (default to 0 = Auto)
if db.rangeCheckSpellID == nil then
db.rangeCheckSpellID = 0
end
-- Helper to refresh info label
local function RefreshRangeInfoLabel()
if self.rangeSpellInfoLabel and self.rangeSpellInfoLabel.SetText and DF.GetCurrentRangeSpellInfo then
local info = DF:GetCurrentRangeSpellInfo()
self.rangeSpellInfoLabel:SetText("|cFFAAAAAA" .. "Active: " .. (info.spellName or "None") .. " (" .. (info.range or "?") .. ")|r")
end
end
-- Set value callback - called AFTER dropdown has already set db.rangeCheckSpellID
local function SetRangeSpellValue()
local value = db.rangeCheckSpellID or 0
if DF.SetRangeCheckSpell then
DF:SetRangeCheckSpell(value)
end
RefreshRangeInfoLabel()
if self.rangeSpellInput and self.rangeSpellInput.EditBox then
self.rangeSpellInput.EditBox:SetText("")
end
end
-- Range Check Spell row
local rangeSpellDropdown = oorGroup:AddWidget(GUI:CreateDropdown(self.child, "Range Check Spell", GetRangeSpellDropdownOptions(), db, "rangeCheckSpellID", SetRangeSpellValue), 55)
rangeSpellDropdown.tooltip = "Select which spell to use for range checking. Auto will use your spec's default healing/friendly spell."
-- Custom Spell ID Input
local customSpellInput = oorGroup:AddWidget(GUI:CreateInput(self.child, "Custom Spell ID", 120), 55)
customSpellInput.tooltip = "Enter any spell ID for range checking. Press Enter to apply. Leave empty to use dropdown selection."
self.rangeSpellInput = customSpellInput
-- Set initial value if it's a custom spell not in dropdown
if db.rangeCheckSpellID and db.rangeCheckSpellID > 0 then
local isInDropdown = false
if DF.GetRangeSpellOptions then
for _, opt in ipairs(DF:GetRangeSpellOptions()) do
if opt.value == db.rangeCheckSpellID then
isInDropdown = true
break
end
end
end
if not isInDropdown then
customSpellInput.EditBox:SetText(tostring(db.rangeCheckSpellID))
end
end
customSpellInput.EditBox:SetNumeric(true)
customSpellInput.EditBox:SetMaxLetters(8)
local function ApplyCustomSpellID()
local text = customSpellInput.EditBox:GetText()
local spellID = tonumber(text)
if not text or text == "" then
return
end
if spellID and spellID > 0 then
local spellName = C_Spell.GetSpellName(spellID)
if spellName then
db.rangeCheckSpellID = spellID
if DF.SetRangeCheckSpell then
DF:SetRangeCheckSpell(spellID)
end
RefreshRangeInfoLabel()
print("|cFF00FF00[DFRange]|r Custom spell set: " .. spellName .. " (ID: " .. spellID .. ")")
else
print("|cFFFF0000[DFRange]|r Invalid spell ID: " .. spellID)
customSpellInput.EditBox:SetText("")
end
end
end
customSpellInput.EditBox:SetScript("OnEnterPressed", function(self)
ApplyCustomSpellID()
self:ClearFocus()
end)
customSpellInput.EditBox:SetScript("OnEditFocusLost", function(self)
ApplyCustomSpellID()
end)
-- Info label showing current active spell
local rangeInfoText = "Loading..."
if DF.GetCurrentRangeSpellInfo then
local rangeInfo = DF:GetCurrentRangeSpellInfo()
rangeInfoText = (rangeInfo.spellName or "None") .. " (" .. (rangeInfo.range or "?") .. ")"
end
local infoLabel = oorGroup:AddWidget(GUI:CreateLabel(self.child, "|cFFAAAAAA" .. "Active: " .. rangeInfoText .. "|r", 250), 25)
self.rangeSpellInfoLabel = infoLabel
-- Range update interval
if db.rangeUpdateInterval == nil then
db.rangeUpdateInterval = 0.5
end
local intervalSlider = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Range Check Interval", 0.1, 1.0, 0.05, db, "rangeUpdateInterval", nil, function()
if DF.SetRangeUpdateInterval then
DF:SetRangeUpdateInterval(db.rangeUpdateInterval)
end
end, true), 55)
intervalSlider.tooltip = "How often to check range (seconds). Lower = more responsive but higher CPU. Default: 0.5s"
-- Frame-level alpha (shown when element-specific is disabled)
local frameLevelAlpha = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Frame Alpha (Out of Range)", 0.1, 1.0, 0.05, db, "rangeFadeAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
frameLevelAlpha.hideOn = HideFrameLevelAlpha
-- Element-specific toggle
oorGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Element-Specific Alpha", db, "oorEnabled", function()
self:RefreshStates()
end), 30)
-- Element-specific sliders (shown when enabled)
local oorHealth = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Health Bar Alpha", 0.0, 1.0, 0.05, db, "oorHealthBarAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorHealth.hideOn = HideOOROptions
local oorMissingHealth = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Missing Health Alpha", 0.0, 1.0, 0.05, db, "oorMissingHealthAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorMissingHealth.hideOn = HideOOROptions
local oorBg = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Background Alpha", 0.0, 1.0, 0.05, db, "oorBackgroundAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorBg.hideOn = HideOOROptions
local oorName = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Name Text Alpha", 0.0, 1.0, 0.05, db, "oorNameTextAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorName.hideOn = HideOOROptions
local oorHealthText = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Health Text Alpha", 0.0, 1.0, 0.05, db, "oorHealthTextAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorHealthText.hideOn = HideOOROptions
local oorAuras = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Auras Alpha", 0.0, 1.0, 0.05, db, "oorAurasAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorAuras.hideOn = HideOOROptions
local oorIcons = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Icons Alpha", 0.0, 1.0, 0.05, db, "oorIconsAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorIcons.hideOn = HideOOROptions
local oorDispel = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Dispel Overlay Alpha", 0.0, 1.0, 0.05, db, "oorDispelOverlayAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorDispel.hideOn = HideOOROptions
-- My Buff Indicator OOR slider removed — feature deprecated
local oorPower = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Power Bar Alpha", 0.0, 1.0, 0.05, db, "oorPowerBarAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorPower.hideOn = HideOOROptions
local oorMissingBuff = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Missing Buff Alpha", 0.0, 1.0, 0.05, db, "oorMissingBuffAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorMissingBuff.hideOn = HideOOROptions
local oorDefensive = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Defensive Icon Alpha", 0.0, 1.0, 0.05, db, "oorDefensiveIconAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorDefensive.hideOn = HideOOROptions
local oorTargetedSpell = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Targeted Spell Alpha", 0.0, 1.0, 0.05, db, "oorTargetedSpellAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorTargetedSpell.hideOn = HideOOROptions
local oorAuraDesigner = oorGroup:AddWidget(GUI:CreateSlider(self.child, "Aura Designer Alpha", 0.0, 1.0, 0.05, db, "oorAuraDesignerAlpha", nil, function() DF:RefreshAllVisibleFrames() end, true), 55)
oorAuraDesigner.hideOn = HideOOROptions
Add(oorGroup, nil, 1)
-- ===== DEAD/OFFLINE FADING GROUP (Column 2) =====
local deadGroup = GUI:CreateSettingsGroup(self.child, 280)
deadGroup:AddWidget(GUI:CreateHeader(self.child, "Dead/Offline Fading"), 40)
deadGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Dead Fade", db, "fadeDeadFrames", function()
self:RefreshStates()
DF:UpdateAllFrames()
DF:RefreshAllVisibleFrames()
end), 30)
local function HideDeadOptions(d)
return not d.fadeDeadFrames
end
local deadBgAlpha = deadGroup:AddWidget(GUI:CreateSlider(self.child, "Background Alpha", 0.0, 1.0, 0.05, db, "fadeDeadBackground", function() DF:RefreshAllVisibleFrames() end, function() DF:RefreshAllVisibleFrames() end, true), 55)
deadBgAlpha.hideOn = HideDeadOptions
local deadHealthAlpha = deadGroup:AddWidget(GUI:CreateSlider(self.child, "Health Bar Alpha", 0.0, 1.0, 0.05, db, "fadeDeadHealthBar", function() DF:RefreshAllVisibleFrames() end, function() DF:RefreshAllVisibleFrames() end, true), 55)
deadHealthAlpha.hideOn = HideDeadOptions
local deadNameAlpha = deadGroup:AddWidget(GUI:CreateSlider(self.child, "Name Alpha", 0.0, 1.0, 0.05, db, "fadeDeadName", function() DF:RefreshAllVisibleFrames() end, function() DF:RefreshAllVisibleFrames() end, true), 55)
deadNameAlpha.hideOn = HideDeadOptions
local deadPowerAlpha = deadGroup:AddWidget(GUI:CreateSlider(self.child, "Power Bar Alpha", 0.0, 1.0, 0.05, db, "fadeDeadPowerBar", function() DF:RefreshAllVisibleFrames() end, function() DF:RefreshAllVisibleFrames() end, true), 55)
deadPowerAlpha.hideOn = HideDeadOptions
local deadIconsAlpha = deadGroup:AddWidget(GUI:CreateSlider(self.child, "Icons Alpha", 0.0, 1.0, 0.05, db, "fadeDeadIcons", function() DF:RefreshAllVisibleFrames() end, function() DF:RefreshAllVisibleFrames() end, true), 55)
deadIconsAlpha.hideOn = HideDeadOptions
local deadAurasAlpha = deadGroup:AddWidget(GUI:CreateSlider(self.child, "Auras Alpha", 0.0, 1.0, 0.05, db, "fadeDeadAuras", function() DF:RefreshAllVisibleFrames() end, function() DF:RefreshAllVisibleFrames() end, true), 55)
deadAurasAlpha.hideOn = HideDeadOptions
local deadTextAlpha = deadGroup:AddWidget(GUI:CreateSlider(self.child, "Status Text Alpha", 0.0, 1.0, 0.05, db, "fadeDeadStatusText", function() DF:RefreshAllVisibleFrames() end, function() DF:RefreshAllVisibleFrames() end, true), 55)
deadTextAlpha.hideOn = HideDeadOptions
local deadCustomBg = deadGroup:AddWidget(GUI:CreateCheckbox(self.child, "Custom Dead Background", db, "fadeDeadUseCustomColor", function()
self:RefreshStates()
DF:UpdateAllFrames()
DF:RefreshAllVisibleFrames()
end), 30)
deadCustomBg.hideOn = HideDeadOptions
local function HideDeadBgColor(d)
return not d.fadeDeadFrames or not d.fadeDeadUseCustomColor
end
local deadBgColor = deadGroup:AddWidget(GUI:CreateColorPicker(self.child, "Dead Background Color", db, "fadeDeadBackgroundColor", false, function() DF:RefreshAllVisibleFrames() end, function() DF:RefreshAllVisibleFrames() end, true), 35)
deadBgColor.hideOn = HideDeadBgColor
Add(deadGroup, nil, 2)
-- ===== HEALTH THRESHOLD FADING (above health threshold) =====
AddSpace(20, "both")
local hfGroup = GUI:CreateSettingsGroup(self.child, 560)
hfGroup:AddWidget(GUI:CreateHeader(self.child, "Health Threshold Fading"), 40)
hfGroup.tooltip = "Fade frames or elements when a unit's health is above the set threshold (e.g. 100% or 80%)."
hfGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Health Threshold Fade", db, "healthFadeEnabled", function()
self:RefreshStates()
DF:UpdateAllFrames()
DF:RefreshAllVisibleFrames()
end), 30)
local function HideHFOptions(d)
return not d.healthFadeEnabled
end
local hfThreshold = hfGroup:AddWidget(GUI:CreateSlider(self.child, "Health Threshold (%)", 50, 100, 1, db, "healthFadeThreshold", function()
DF:UpdateAllFrames()
DF:RefreshAllVisibleFrames()
end), 55)
hfThreshold.hideOn = HideHFOptions
hfThreshold.tooltip = "Units at or above this health percent are faded."
local hfCancelDispel = hfGroup:AddWidget(GUI:CreateCheckbox(self.child, "Cancel Fade on Dispellable Debuff", db, "hfCancelOnDispel", function()
DF:UpdateAllFrames()
DF:RefreshAllVisibleFrames()
end), 30)
hfCancelDispel.hideOn = HideHFOptions
-- Health fade sliders need UpdateAllFrameAppearances to force an immediate visual refresh.
-- Unlike OOR/dead fade which refresh on range/state changes, health fade alpha values
-- are only re-read during appearance updates, not triggered by FullFrameRefresh alone.
local function RefreshHealthFade()
if DF.InvalidateHealthFadeCurve then DF:InvalidateHealthFadeCurve() end
DF:RefreshAllVisibleFrames()
if DF.UpdateAllFrameAppearances then DF:UpdateAllFrameAppearances() end
end
local hfFrameAlpha = hfGroup:AddWidget(GUI:CreateSlider(self.child, "Frame Alpha (Above Threshold)", 0.1, 1.0, 0.05, db, "healthFadeAlpha", nil, RefreshHealthFade, true), 55)
hfFrameAlpha.hideOn = HideHFOptions
hfFrameAlpha.tooltip = "Frame opacity when health is above the threshold."
Add(hfGroup, nil, "both")
-- See Also links
AddSpace(20, "both")
Add(GUI:CreateSeeAlso(self.child, {
{pageId = "display_visibility", label = "Visibility"},
{pageId = "text_status", label = "Status Text"},
}), 30, "both")
end)
-- Display > Pet Frames
local pagePets = CreateSubTab("display", "display_pets", "Pet Frames")
BuildPage(pagePets, function(self, db, Add, AddSpace, AddSyncPoint)
-- Copy button at top right
Add(CreateCopyButton(self.child, {"pet"}, "Pet Frames", "display_pets"), 25, 2)
-- Check modes for conditional content
local isGroupedMode = db.petGroupMode == "GROUPED"
local isRaidMode = GUI.SelectedMode == "raid"
-- ===== GENERAL GROUP (full width) =====
local generalGroup = GUI:CreateSettingsGroup(self.child, 560)
generalGroup:AddWidget(GUI:CreateHeader(self.child, "Pet Frame Settings"), 40)
generalGroup:AddWidget(GUI:CreateCheckbox(self.child, "Enable Pet Frames", db, "petEnabled", function()
if DF.ApplyPetSettings then DF:ApplyPetSettings() end
end), 30)
generalGroup:AddWidget(GUI:CreateLabel(self.child, "Show health bars for player and party/raid member pets, anchored to their owner's frame. Pet frames hide when owner dies.", 530), 30)
Add(generalGroup, nil, "both")
-- ===== LAYOUT MODE GROUP (full width) =====
local layoutGroup = GUI:CreateSettingsGroup(self.child, 560)
layoutGroup:AddWidget(GUI:CreateHeader(self.child, "Layout Mode"), 40)
local groupModeValues = {
ATTACHED = "Attached to Owner",
GROUPED = "Separate Pet Group",
}
layoutGroup:AddWidget(GUI:CreateDropdown(self.child, "Layout Mode", groupModeValues, db, "petGroupMode", function()
if DF.UpdateAllPetFrames then DF:UpdateAllPetFrames(true) end
if DF.UpdateAllRaidPetFrames then DF:UpdateAllRaidPetFrames(true) end
GUI:RefreshCurrentPage()
end), 55)
if not isGroupedMode then
layoutGroup:AddWidget(GUI:CreateLabel(self.child, "Pet frames are positioned relative to their owner's frame.", 530), 25)
else
layoutGroup:AddWidget(GUI:CreateLabel(self.child, "Pet frames are grouped together in a separate container.", 530), 25)
end
Add(layoutGroup, nil, "both")
-- ===== COLUMN 1 GROUPS =====
-- GROUPED MODE: Group Settings (col1)
if isGroupedMode then
local groupedSettingsGroup = GUI:CreateSettingsGroup(self.child, 280)
groupedSettingsGroup:AddWidget(GUI:CreateHeader(self.child, "Group Settings"), 40)
local groupAnchorValues = {
BOTTOM = isRaidMode and "Below Raid" or "Below Party",
TOP = isRaidMode and "Above Raid" or "Above Party",
LEFT = isRaidMode and "Left of Raid" or "Left of Party",
RIGHT = isRaidMode and "Right of Raid" or "Right of Party",
}
local updateFunc = isRaidMode
and function() if DF.UpdateRaidPetGroupLayout then DF:UpdateRaidPetGroupLayout() end end
or function() if DF.UpdatePetGroupLayout then DF:UpdatePetGroupLayout() end end
groupedSettingsGroup:AddWidget(GUI:CreateDropdown(self.child, "Group Position", groupAnchorValues, db, "petGroupAnchor", updateFunc), 55)
local growthValues = { HORIZONTAL = "Horizontal", VERTICAL = "Vertical" }
groupedSettingsGroup:AddWidget(GUI:CreateDropdown(self.child, "Growth Direction", growthValues, db, "petGroupGrowth", updateFunc), 55)
groupedSettingsGroup:AddWidget(GUI:CreateSlider(self.child, "Pet Spacing", 0, 20, 1, db, "petGroupSpacing", updateFunc, updateFunc, true), 55)
groupedSettingsGroup:AddWidget(GUI:CreateSlider(self.child, "Group X Offset", -100, 100, 1, db, "petGroupOffsetX", updateFunc, updateFunc, true), 55)
groupedSettingsGroup:AddWidget(GUI:CreateSlider(self.child, "Group Y Offset", -100, 100, 1, db, "petGroupOffsetY", updateFunc, updateFunc, true), 55)
if isRaidMode then
groupedSettingsGroup:AddWidget(GUI:CreateCheckbox(self.child, "Show Group Label", db, "petGroupShowLabel", function()
if DF.UpdateRaidPetGroupLayout then DF:UpdateRaidPetGroupLayout() end
end), 30)
end
Add(groupedSettingsGroup, nil, 1)
end
-- SIZE GROUP (col1)
local sizeGroup = GUI:CreateSettingsGroup(self.child, 280)
sizeGroup:AddWidget(GUI:CreateHeader(self.child, "Size"), 40)
if not isGroupedMode then
sizeGroup:AddWidget(GUI:CreateCheckbox(self.child, "Match Owner Width", db, "petMatchOwnerWidth", function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
GUI:RefreshCurrentPage()
end), 30)
sizeGroup:AddWidget(GUI:CreateCheckbox(self.child, "Match Owner Height", db, "petMatchOwnerHeight", function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
GUI:RefreshCurrentPage()
end), 30)
end
local widthSlider = sizeGroup:AddWidget(GUI:CreateSlider(self.child, "Width", 40, 150, 1, db, "petFrameWidth", function()
if DF.ApplyPetSettings then DF:ApplyPetSettings() end
end, function() if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end end, true), 55)
if not isGroupedMode then
widthSlider.disableOn = function(d) return d.petMatchOwnerWidth end
end
local heightSlider = sizeGroup:AddWidget(GUI:CreateSlider(self.child, "Height", 10, 40, 1, db, "petFrameHeight", function()
if DF.ApplyPetSettings then DF:ApplyPetSettings() end
end, function() if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end end, true), 55)
if not isGroupedMode then
heightSlider.disableOn = function(d) return d.petMatchOwnerHeight end
end
Add(sizeGroup, nil, 1)
-- HEALTH BAR GROUP (col1)
local healthBarGroup = GUI:CreateSettingsGroup(self.child, 280)
healthBarGroup:AddWidget(GUI:CreateHeader(self.child, "Health Bar"), 40)
local healthColorValues = {
GREEN = "Always Green",
CLASS = "Owner's Class Color",
HEALTH = "By Health %",
CUSTOM = "Custom Color",
}
healthBarGroup:AddWidget(GUI:CreateDropdown(self.child, "Health Bar Color", healthColorValues, db, "petHealthColorMode", function()
if DF.ApplyPetSettings then DF:ApplyPetSettings() end
GUI:RefreshCurrentPage()
end), 55)
local customHealthColor = healthBarGroup:AddWidget(GUI:CreateColorPicker(self.child, "Custom Health Color", db, "petHealthColor", false, function()
if DF.ApplyPetSettings then DF:ApplyPetSettings() end
end, function() if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end end, true), 35)
customHealthColor.hideOn = function(d) return d.petHealthColorMode ~= "CUSTOM" end
healthBarGroup:AddWidget(GUI:CreateCheckbox(self.child, "Show Health Percentage", db, "petShowHealthText", function()
if DF.ApplyPetSettings then DF:ApplyPetSettings() end
end), 30)
Add(healthBarGroup, nil, 1)
-- NAME TEXT GROUP (col1)
local outlineValues = {
[""] = "None",
OUTLINE = "Outline",
THICKOUTLINE = "Thick Outline",
SHADOW = "Shadow",
MONOCHROME = "Monochrome",
}
local textAnchorValues = {
TOPLEFT = "Top Left", TOP = "Top", TOPRIGHT = "Top Right",
LEFT = "Left", CENTER = "Center", RIGHT = "Right",
BOTTOMLEFT = "Bottom Left", BOTTOM = "Bottom", BOTTOMRIGHT = "Bottom Right",
}
local nameTextGroup = GUI:CreateSettingsGroup(self.child, 280)
nameTextGroup:AddWidget(GUI:CreateHeader(self.child, "Name Text"), 40)
nameTextGroup:AddWidget(GUI:CreateFontDropdown(self.child, "Font", db, "petNameFont", function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end), 55)
nameTextGroup:AddWidget(GUI:CreateSlider(self.child, "Font Size", 6, 16, 1, db, "petNameFontSize", function()
if DF.ApplyPetSettings then DF:ApplyPetSettings() end
end, function() if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end end, true), 55)
nameTextGroup:AddWidget(GUI:CreateDropdown(self.child, "Font Outline", outlineValues, db, "petNameFontOutline", function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end), 55)
nameTextGroup:AddWidget(GUI:CreateSlider(self.child, "Max Name Length", 4, 20, 1, db, "petNameMaxLength", function()
if DF.ApplyPetSettings then DF:ApplyPetSettings() end
end), 55)
nameTextGroup:AddWidget(GUI:CreateDropdown(self.child, "Name Anchor", textAnchorValues, db, "petNameAnchor", function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end), 55)
nameTextGroup:AddWidget(GUI:CreateColorPicker(self.child, "Name Color", db, "petNameColor", false, function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end, function() if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end end, true), 35)
nameTextGroup:AddWidget(GUI:CreateSlider(self.child, "Name X Offset", -30, 30, 1, db, "petNameX", function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end, function() if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end end, true), 55)
nameTextGroup:AddWidget(GUI:CreateSlider(self.child, "Name Y Offset", -15, 15, 1, db, "petNameY", function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end, function() if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end end, true), 55)
Add(nameTextGroup, nil, 1)
-- ===== COLUMN 2 GROUPS =====
-- POSITION GROUP (col2, Attached mode only)
if not isGroupedMode then
local positionGroup = GUI:CreateSettingsGroup(self.child, 280)
positionGroup:AddWidget(GUI:CreateHeader(self.child, "Position"), 40)
local anchorValues = {
BOTTOM = "Below Owner",
TOP = "Above Owner",
LEFT = "Left of Owner",
RIGHT = "Right of Owner",
}
positionGroup:AddWidget(GUI:CreateDropdown(self.child, "Anchor Position", anchorValues, db, "petAnchor", function()
if DF.UpdateAllPetFramePositions then DF:UpdateAllPetFramePositions() end
end), 55)
positionGroup:AddWidget(GUI:CreateSlider(self.child, "X Offset", -50, 50, 1, db, "petOffsetX", function()
if DF.UpdateAllPetFramePositions then DF:UpdateAllPetFramePositions() end
end, function() if DF.UpdateAllPetFramePositions then DF:UpdateAllPetFramePositions() end end, true), 55)
positionGroup:AddWidget(GUI:CreateSlider(self.child, "Y Offset", -50, 50, 1, db, "petOffsetY", function()
if DF.UpdateAllPetFramePositions then DF:UpdateAllPetFramePositions() end
end, function() if DF.UpdateAllPetFramePositions then DF:UpdateAllPetFramePositions() end end, true), 55)
Add(positionGroup, nil, 2)
end
-- APPEARANCE GROUP (col2)
local appearanceGroup = GUI:CreateSettingsGroup(self.child, 280)
appearanceGroup:AddWidget(GUI:CreateHeader(self.child, "Appearance"), 40)
appearanceGroup:AddWidget(GUI:CreateTextureDropdown(self.child, "Health Bar Texture", db, "petTexture", function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end), 55)
appearanceGroup:AddWidget(GUI:CreateCheckbox(self.child, "Show Border", db, "petShowBorder", function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end), 30)
appearanceGroup:AddWidget(GUI:CreateColorPicker(self.child, "Border Color", db, "petBorderColor", true, function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end, function() if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end end, true), 35)
appearanceGroup:AddWidget(GUI:CreateColorPicker(self.child, "Background Color", db, "petBackgroundColor", true, function()
if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end
end, function() if DF.LightweightUpdatePetFrames then DF:LightweightUpdatePetFrames() end end, true), 35)
Add(appearanceGroup, nil, 2)