-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOptions.lua
More file actions
1585 lines (1487 loc) · 53 KB
/
Options.lua
File metadata and controls
1585 lines (1487 loc) · 53 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
-- Options.lua (Improved formatting and organization)
local PARENT_ADDON_INTERNAL_NAME = "RandomMountBuddy" -- Used as the key for the parent category
local PARENT_ADDON_DISPLAY_NAME = "Random Mount Buddy" -- What the user sees for the top-level
local addon = RandomMountBuddy
if not addon then
addon:DebugOptions("CRITICAL ERROR - RandomMountBuddy global (addon object) is nil!")
return
end
local LibAceConfig = LibStub("AceConfig-3.0")
local LibAceConfigDialog = LibStub("AceConfigDialog-3.0")
if not (LibAceConfig and LibAceConfigDialog) then
addon:DebugOptions("CRITICAL ERROR - AceConfig or AceConfigDialog libraries not found!")
return
end
-- Ensure necessary functions exist on the addon object for various pages
if type(addon.GetSetting) ~= "function" or type(addon.SetSetting) ~= "function" then
addon:DebugOptions("Core Get/SetSetting methods missing!")
end
if type(addon.BuildFamilyManagementArgs) ~= "function" then
addon:DebugOptions("addon.BuildFamilyManagementArgs is missing!")
addon.BuildFamilyManagementArgs = function()
return {
err = {
order = 1,
type = "description",
name = "Error: BuildFamilyManagementArgs missing!",
},
}
end
end
if type(addon.GetFavoriteMountsForOptions) ~= "function" then
addon:DebugOptions("addon.GetFavoriteMountsForOptions is missing!")
addon.GetFavoriteMountsForOptions = function()
return {
err = {
order = 1,
type = "description",
name = "Error: GetFavoriteMountsForOptions missing!",
},
}
end
end
if type(addon.PopulateFamilyManagementUI) ~= "function" then
addon:DebugOptions("addon.PopulateFamilyManagementUI is missing!")
end
--[[-----------------------------------------------------------------------------
0. Create the Parent Category in Blizzard's Options
-------------------------------------------------------------------------------]]
-- We register a minimal options table for the parent itself. Its main purpose is to establish the category.
local rootOptions_InternalName = PARENT_ADDON_INTERNAL_NAME .. "_RootConfig" -- Unique name for AceConfig registration
local rootOptionsTable = {
name = PARENT_ADDON_DISPLAY_NAME,
type = "group",
args = {
showMinimapButton = {
order = 20,
type = "toggle",
name = "Show Minimap Button",
desc =
"Toggle minimap icon.",
get = function() return addon:GetSetting("showMinimapButton") end,
set = function(i, v)
addon:SetSetting("showMinimapButton", v)
-- Update minimap button visibility
if addon.MinimapButton and addon.MinimapButton.UpdateMinimapButtonVisibility then
addon.MinimapButton:UpdateMinimapButtonVisibility()
end
end,
width = 1.2,
},
enableDebugMode = {
order = 21,
type = "toggle",
name = "Debug Messages",
desc = "Show detailed debug information in chat. Useful for troubleshooting.",
get = function()
-- Direct database access to avoid any SetSetting loops
if addon.db and addon.db.profile then
return addon.db.profile.enableDebugMode or false
end
return false
end,
set = function(i, v)
-- Direct database write to avoid triggering other systems
if addon.db and addon.db.profile then
addon.db.profile.enableDebugMode = v
end
-- Simple direct print - don't use AlwaysPrint to avoid any loops
if v then
print("RMB: Debug mode enabled - you'll see detailed debug messages")
else
print("RMB: Debug mode disabled")
end
end,
width = 1,
},
utilityMountsEnabled = {
order = 22,
type = "toggle",
name = "Show Utility Mounts",
desc =
"Display clickable utility mount icons on the game menu (ESC).\n|cff00ff00RFurther ustomization options can be found in the Mount Browser.|r",
get = function() return addon:GetSetting("utilityMounts_enabled") end,
set = function(i, v)
addon:SetSetting("utilityMounts_enabled", v)
-- Refresh utility mounts display
if addon.UtilityMounts and addon.UtilityMounts.RefreshDisplay then
addon.UtilityMounts:RefreshDisplay()
end
end,
width = 1.2,
},
generalHeader = {
order = 30,
type = "header",
name = "Summon Configuration",
},
contextualSummoning = {
order = 31,
type = "toggle",
name = "Contextual Summoning",
desc = "Automatically filter mounts based on location/situation.",
get = function() return addon:GetSetting("contextualSummoning") end,
set = function(i, v)
addon:SetSetting("contextualSummoning", v)
-- ENHANCED: Refresh mount pools since this affects mount selection logic
if addon.MountSummon and addon.MountSummon.RefreshMountPools then
addon.MountSummon:RefreshMountPools()
addon:DebugOptions("Refreshed mount pools after contextual summoning change")
end
end,
width = 1.2,
},
useDeterministicSummoning = {
order = 32,
type = "toggle",
name = "Improved randomness",
desc =
"When enabled, recently used mount groups become temporarily unavailable, ensuring more variety in mount selection. Groups become unavailable for a duration based on your collection size.",
get = function() return addon:GetSetting("useDeterministicSummoning") end,
set = function(i, v)
addon:SetSetting("useDeterministicSummoning", v)
-- Reset normal deterministic cache when toggling mode
if addon.MountSummon and addon.MountSummon.deterministicCache then
for poolName, cache in pairs(addon.MountSummon.deterministicCache) do
if cache then
cache.unavailableGroups = {}
cache.pendingSummon = nil
end
end
addon:DebugSummon("Normal cache reset due to mode toggle")
end
-- Also reset rule deterministic cache
if addon.MountSummon and addon.MountSummon.rulesDeterministicCache then
addon.MountSummon.rulesDeterministicCache = {}
addon:DebugSummon("Cleared rule deterministic cache due to mode toggle")
end
-- ENHANCED: Refresh mount pools since this affects selection logic
if addon.MountSummon and addon.MountSummon.RefreshMountPools then
addon.MountSummon:RefreshMountPools()
addon:DebugOptions("Refreshed mount pools after deterministic summoning change")
end
end,
width = 1.2,
},
mountedKeyBehavior = {
order = 32.1,
type = "select",
name = "RMB Keybind while Mounted",
desc =
"What happens when you press the mount key while already mounted.\n\n|cffffd700Dismount|r - Default behavior.\n|cffffd700Remount|r - Summon another mount.\n|cffffd700Do Nothing|r - The key does nothing while mounted.",
values = {
dismount = "Dismount",
remount = "Remount",
nothing = "Do Nothing",
},
get = function() return RandomMountBuddy:GetSetting("mountedKeyBehavior") or "dismount" end,
set = function(_, val)
RandomMountBuddy:SetSetting("mountedKeyBehavior", val)
RandomMountBuddy.SecureHandlers:OnSettingChanged("mountedKeyBehavior", val)
end,
},
summonTargetMount = {
order = 32.5,
type = "toggle",
name = "Summon Target's Mount",
desc =
"When targeting a player, summon their current mount instead of using normal mount selection logic. Takes priority over rules and weight settings. If you don't own the mount, the addon will use normal selection instead.",
get = function() return addon:GetSetting("summonTargetMount") end,
set = function(i, v)
addon:SetSetting("summonTargetMount", v)
end,
width = 1.2,
},
treatUniqueEffectsAsDistinct = {
order = 33,
type = "toggle",
name = "Favor Unique Mounts",
width = "1.2",
desc =
"Displays mounts in their assigned groups regardless whether you enabled the Improved Unique Mount Chances setting.\n|cff00ff00Recommended to keep Enabled|r",
get = function() return addon:GetSetting("treatUniqueEffectsAsDistinct") end,
set = function(i, v)
addon:SetSetting("treatUniqueEffectsAsDistinct", v)
-- ENHANCED: Explicitly refresh mount pools after trait changes
C_Timer.After(0.1, function()
if addon.RefreshMountPools then
addon:RefreshMountPools()
addon:DebugOptions("Refreshed mount pools after trait distinctness change")
end
end)
end,
disabled = function() return not addon:GetSetting("useSuperGrouping") end,
},
syncSettings = {
name = "",
type = "group",
inline = true,
args = {
favoriteSyncHeader = {
order = 100,
type = "header",
name = "Weight Sync Settings",
},
enableFavoriteSync = {
order = 101,
type = "toggle",
name = "Enable Weight Sync",
desc = "Automatically sync your WoW Mount Journal favorites with RMB mount weights",
get = function()
return addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync") or false
end,
set = function(i, v)
if addon.FavoriteSync then
addon.FavoriteSync:SetSetting("enableFavoriteSync", v)
end
-- Reset notification counter when toggling sync
if addon.uiState then
addon.uiState.weightChangeNotificationCount = 0
end
-- ENHANCED: Refresh mount pools since this affects weight assignments
C_Timer.After(0.2, function()
if addon.RefreshMountPools then
addon:RefreshMountPools()
addon:DebugOptions("Refreshed mount pools after FavoriteSync enable/disable")
end
-- Refresh the Family Management UI to show/hide sync warnings
if addon.PopulateFamilyManagementUI then
addon:PopulateFamilyManagementUI()
end
end)
end,
width = 2,
},
weightPriority = {
order = 101.5,
type = "description",
name = "|cffcbcbcbWeight = Summon Chance|r",
width = 1,
},
syncOnLogin = {
order = 102,
type = "toggle",
name = "Sync on Login",
desc =
"Automatically sync favorites when you log in.",
get = function()
return addon.FavoriteSync and addon.FavoriteSync:GetSetting("syncOnLogin") or false
end,
set = function(i, v)
if addon.FavoriteSync then
addon.FavoriteSync:SetSetting("syncOnLogin", v)
end
end,
disabled = function()
return not (addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync"))
end,
width = 1.2,
},
syncFamilyWeights = {
order = 104,
type = "toggle",
name = "Sync Family Weights",
desc =
"Apply favorite Mount weights to entire mount families when they contain favorite mounts.\nFamilies contain all recolors of a mount.\n|cff00ff00Recommended to keep Enabled|r",
get = function()
return addon.FavoriteSync and addon.FavoriteSync:GetSetting("syncFamilyWeights") or false
end,
set = function(i, v)
if addon.FavoriteSync then
addon.FavoriteSync:SetSetting("syncFamilyWeights", v)
end
-- ENHANCED: Refresh mount pools since this affects family-level weights
C_Timer.After(0.2, function()
if addon.RefreshMountPools then
addon:RefreshMountPools()
addon:DebugOptions("Refreshed mount pools after family sync setting change")
end
-- Refresh the Family Management UI to show/hide family-level sync warnings
if addon.PopulateFamilyManagementUI then
addon:PopulateFamilyManagementUI()
end
end)
end,
disabled = function()
return not (addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync"))
end,
width = 1.2,
},
syncSuperGroupWeights = {
order = 105,
type = "toggle",
name = "Sync Group Weights",
desc =
"Apply favorite Mount weights to entire supergroups when they contain favorite mounts.\nGroups contain all recolors and variants of a mount.\n|cff00ff00Recommended to keep Enabled|r",
get = function()
return addon.FavoriteSync and addon.FavoriteSync:GetSetting("syncSuperGroupWeights") or false
end,
set = function(i, v)
if addon.FavoriteSync then
addon.FavoriteSync:SetSetting("syncSuperGroupWeights", v)
end
-- ENHANCED: Refresh mount pools since this affects supergroup-level weights
C_Timer.After(0.2, function()
if addon.RefreshMountPools then
addon:RefreshMountPools()
addon:DebugOptions("Refreshed mount pools after supergroup sync setting change")
end
-- Refresh the Family Management UI to show/hide supergroup-level sync warnings
if addon.PopulateFamilyManagementUI then
addon:PopulateFamilyManagementUI()
end
end)
end,
disabled = function()
return not (addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync"))
end,
width = 1,
},
favoriteWeightMode = {
order = 105,
type = "select",
name = "Sync Mode",
desc =
"Replace weights: Syncing will update all weights.|cff00ff00Use this if you don't care about modifying weights manually|r.\nOnly increase weights: Syncing will only change weights that are below the selected values.|cff00ff00Use this if you want to set specific mounts/families/groups to a higher weight|r.",
values = {
["set"] = "Replace current weights",
["minimum"] = "Only increase weights",
},
get = function()
return addon.FavoriteSync and addon.FavoriteSync:GetSetting("favoriteWeightMode") or "set"
end,
set = function(i, v)
if addon.FavoriteSync then
addon.FavoriteSync:SetSetting("favoriteWeightMode", v)
end
-- Reset notification counter when changing mode
if addon.uiState then
addon.uiState.weightChangeNotificationCount = 0
end
-- ENHANCED: Auto-sync after mode change
C_Timer.After(0.2, function()
if addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync") then
addon:DebugOptions("Auto-syncing after weight mode change to " .. v)
addon.FavoriteSync:SyncFavoriteMounts(true)
end
if addon.RefreshMountPools then
addon:RefreshMountPools()
addon:DebugOptions("Refreshed mount pools after weight mode change")
end
end)
end,
disabled = function()
return not (addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync"))
end,
width = 1.2,
},
nonFavoriteWeight = {
order = 106,
type = "select",
name = "Non-Favorite Mount Weight",
desc = "Weight applied to mounts not marked as favorites. \nRecommended:0-2",
values = {
[0] = "Never (0)",
[1] = "Occasional (1)",
[2] = "Uncommon (2)",
[3] = "Normal (3)",
[4] = "Common (4)",
[5] = "Often (5)",
[6] = "Always (6)",
},
get = function()
return addon.FavoriteSync and addon.FavoriteSync:GetSetting("nonFavoriteWeight") or 3
end,
set = function(i, v)
if addon.FavoriteSync then
addon.FavoriteSync:SetSetting("nonFavoriteWeight", v)
end
-- ENHANCED: Auto-sync after weight change
C_Timer.After(0.2, function()
if addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync") then
addon:DebugOptions("Auto-syncing after non-favorite weight change to " .. v)
addon.FavoriteSync:SyncFavoriteMounts(true)
end
if addon.RefreshMountPools then
addon:RefreshMountPools()
addon:DebugOptions("Refreshed mount pools after non-favorite weight change")
end
end)
end,
disabled = function()
return not (addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync"))
end,
width = 1.2,
},
favoriteWeight = {
order = 107,
type = "select",
name = "Favorite Mount Weight",
desc = "Weight applied to mounts marked as favorites.\nRecommended:3-5",
values = {
[0] = "Never (0)",
[1] = "Occasional (1)",
[2] = "Uncommon (2)",
[3] = "Normal (3)",
[4] = "Common (4)",
[5] = "Often (5)",
[6] = "Always (6)",
},
get = function()
return addon.FavoriteSync and addon.FavoriteSync:GetSetting("favoriteWeight") or 4
end,
set = function(i, v)
if addon.FavoriteSync then
addon.FavoriteSync:SetSetting("favoriteWeight", v)
end
-- ENHANCED: Auto-sync after weight change
C_Timer.After(0.2, function()
if addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync") then
addon:DebugOptions("Auto-syncing after favorite weight change to " .. v)
addon.FavoriteSync:SyncFavoriteMounts(true)
end
if addon.RefreshMountPools then
addon:RefreshMountPools()
addon:DebugOptions("Refreshed mount pools after favorite weight change")
end
end)
end,
disabled = function()
return not (addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync"))
end,
width = 1.2,
},
favoriteSyncControlsGroup = {
order = 108,
type = "group",
inline = true,
name = "",
args = {
manualSyncButton = {
order = 2,
type = "execute",
name = "Sync Now",
desc = "Manually trigger favorite mount sync",
func = function()
if addon.FavoriteSync then
addon.FavoriteSync:ManualSync()
end
end,
disabled = function()
return not (addon.FavoriteSync and addon.FavoriteSync:GetSetting("enableFavoriteSync"))
end,
width = 0.8,
},
spacer = {
order = 3,
type = "description",
name = " ",
width = 0.1,
},
syncStats = {
order = 4,
type = "description",
name = function()
if not addon.FavoriteSync then
return ""
end
local stats = addon.FavoriteSync:GetSyncStatistics()
return string.format("Stats: %d favorite / %d collected mounts | Last sync: %s",
stats.favoriteMountCount, stats.totalMountCount, stats.lastSyncTimeFormatted)
end,
width = 3,
},
},
},
},
},
mountBrowserRedirect = {
order = 999,
name = "",
type = "group",
inline = true,
args = {
displaySettingsHeader = {
order = 9,
type = "header",
name = "Mount Browser",
},
browser_button_fmg = {
order = 20,
type = "execute",
name =
"Open Mount Browser - New Main menu + mount previewer!",
desc = "Visual grid reference of all mount families and supergroups",
func = function()
if addon.MountBrowser then
addon.MountBrowser:Show()
else
addon:AlwaysPrint("Mount Browser not available")
end
end,
width = "full",
},
},
},
},
}
LibAceConfig:RegisterOptionsTable(rootOptions_InternalName, rootOptionsTable)
local rootPanel, rootCategoryID = LibAceConfigDialog:AddToBlizOptions(rootOptions_InternalName, PARENT_ADDON_DISPLAY_NAME)
if not rootPanel then
addon:DebugOptions("FAILED to create parent category '" ..
PARENT_ADDON_DISPLAY_NAME .. "' in Blizzard Options.")
return -- If parent can't be made, children will fail
else
addon:DebugOptions("Parent category '" ..
PARENT_ADDON_DISPLAY_NAME ..
"' created/found. ID/Name: " .. tostring(rootCategoryID or (rootPanel and rootPanel.name)))
end
-- The key used by AddToBlizOptions for 'parent' is the *display name* if a specific ID isn't returned or known.
local actualParentCategoryKey = rootCategoryID or (rootPanel and rootPanel.name) or PARENT_ADDON_DISPLAY_NAME
--[[-----------------------------------------------------------------------------
1. Mount List Page
-------------------------------------------------------------------------------]]
local familyManagement_InternalName = PARENT_ADDON_INTERNAL_NAME .. "_FamilyManagement"
local familyManagement_DisplayName = "Mount List (LEGACY)"
local initialFamilyManagementArgs = {
_placeholder_header_fmg = {
order = 0,
type = "header",
name = "Family & Group Configuration",
},
_placeholder_description_fmg = {
order = 1,
type = "description",
name =
"This panel allows you to adjust weights for mount families and groups. Higher weights increase the chance of a mount being selected when using the random mount feature. You can also preview mounts in each family.",
fontSize = "medium",
},
_placeholder_refresh_button_fmg = {
order = 2,
type = "execute",
name = "Load / Refresh Mount Groups",
func = function()
if addon.MountDataManager then
addon.MountDataManager:InvalidateCache("manual_refresh")
end
if addon.PopulateFamilyManagementUI then
addon:PopulateFamilyManagementUI()
else
addon:DebugOptions("PopulateFamilyManagementUI missing!")
end
end,
width = "full",
},
_placeholder_browser_button_fmg = {
order = 2.5,
type = "execute",
name = "Open Mount Browser",
desc = "Visual grid reference of all mount families and supergroups",
func = function()
if addon.MountBrowser then
addon.MountBrowser:Show()
else
addon:AlwaysPrint("Mount Browser not available")
end
end,
width = "full",
},
_placeholder_status_fmg = {
order = 3,
type = "description",
name = "Click 'Load / Refresh' or wait for data to auto-populate.",
},
}
addon.fmArgsRef = initialFamilyManagementArgs -- Core.lua will use this reference
local familyManagementOptionsTable = {
name = "",
handler = addon,
type = "group",
order = 2,
args = initialFamilyManagementArgs,
}
LibAceConfig:RegisterOptionsTable(familyManagement_InternalName, familyManagementOptionsTable)
local familyPanel, familyCatID = LibAceConfigDialog:AddToBlizOptions(
familyManagement_InternalName,
familyManagement_DisplayName,
actualParentCategoryKey
)
if familyPanel then
addon.optionsPanel_Family = {
frame = familyPanel,
id = familyCatID or familyPanel.name,
}
addon:DebugOptions("Registered '" .. familyManagement_DisplayName .. "' page.")
else
addon:DebugOptions("FAILED Mount List AddToBliz.")
end
--[[-----------------------------------------------------------------------------
2. Class Settings
-------------------------------------------------------------------------------]]
local classSettings_InternalName = PARENT_ADDON_INTERNAL_NAME .. "_ClassSettings"
local classSettings_DisplayName = "Class Settings"
local favoriteMountsArgsTable = (addon.GetFavoriteMountsForOptions and addon:GetFavoriteMountsForOptions()) or
{ err = { order = 1, type = "description", name = "Error." } }
local classSettingsOptionsTable = {
name = classSettings_DisplayName,
handler = addon,
type = "group",
order = 3,
args = {
druidHeader = {
order = 10,
type = "group",
name = "Druid",
inline = true,
args = {
useTravelFormWhileMoving = {
order = 11,
type = "toggle",
name = "Cast Travel Form While Moving",
desc = "If checked, the keybind will use Travel Form while moving (Druids only).",
get = function() return addon:GetSetting("useTravelFormWhileMoving") end,
set = function(i, v)
addon:SetSetting("useTravelFormWhileMoving", v)
end,
width = 1.4,
},
keepTravelFormActive = {
order = 12,
type = "toggle",
name = "Don't cancel form",
desc = "If checked, pressing the keybind while already in Travel Form won't cancel the form.",
get = function() return addon:GetSetting("keepTravelFormActive") end,
set = function(i, v) addon:SetSetting("keepTravelFormActive", v) end,
width = 1,
},
useSmartFormSwitching = {
order = 13,
type = "toggle",
name = "Smart Form Switching",
desc =
"If checked, intelligently switches between Travel Form (outdoors/swimming) and Cat Form (indoors) based on context.",
get = function() return addon:GetSetting("useSmartFormSwitching") end,
set = function(i, v)
addon:SetSetting("useSmartFormSwitching", v)
-- Force an update of the macros if not in combat
if not InCombatLockdown() then
RandomMountBuddy:UpdateShapeshiftMacros()
end
end,
width = 1.2,
},
},
},
shamanHeader = {
order = 20,
type = "group",
name = "Shaman",
inline = true,
args = {
useGhostWolfWhileMoving = {
order = 21,
type = "toggle",
name = "Cast Ghost Wolf While Moving",
desc = "If checked, the keybind will use Ghost Wolf while moving or in combat (Shamans only).",
get = function() return addon:GetSetting("useGhostWolfWhileMoving") end,
set = function(i, v) addon:SetSetting("useGhostWolfWhileMoving", v) end,
width = 1.4,
},
keepGhostWolfActive = {
order = 22,
type = "toggle",
name = "Don't cancel form",
desc = "If checked, pressing the keybind while already in Ghost Wolf won't cancel the form.",
get = function() return addon:GetSetting("keepGhostWolfActive") end,
set = function(i, v) addon:SetSetting("keepGhostWolfActive", v) end,
width = 1,
},
},
},
monkHeader = {
order = 30,
type = "group",
name = "Monk",
inline = true,
args = {
useZenFlightWhileMoving = {
order = 31,
type = "toggle",
name = "Cast ZF While Moving/Falling",
desc =
"If checked, the keybind will use Zen Flight while moving or falling (Monks only). Will not cast in combat while falling.",
get = function() return addon:GetSetting("useZenFlightWhileMoving") end,
set = function(i, v) addon:SetSetting("useZenFlightWhileMoving", v) end,
width = 1.4,
},
keepZenFlightActive = {
order = 32,
type = "toggle",
name = "Don't cancel ZF",
desc = "If checked, pressing the keybind while already using Zen Flight won't cancel it.",
get = function() return addon:GetSetting("keepZenFlightActive") end,
set = function(i, v) addon:SetSetting("keepZenFlightActive", v) end,
width = 1,
},
},
},
mageHeader = {
order = 40,
type = "group",
name = "Mage",
inline = true,
args = {
useSlowFallWhileFalling = {
order = 41,
type = "toggle",
name = "Cast Slow Fall While Falling",
desc = "If checked, the keybind will use Slow Fall while falling (Mages only).",
get = function() return addon:GetSetting("useSlowFallWhileFalling") end,
set = function(i, v) addon:SetSetting("useSlowFallWhileFalling", v) end,
width = 1.4,
},
useSlowFallOnOthers = {
order = 42,
type = "toggle",
name = "Cast Slow Fall on Others",
desc =
"If checked, Slow Fall will try to cast on your target or mouseover first, before falling back to yourself.",
get = function() return addon:GetSetting("useSlowFallOnOthers") end,
set = function(i, v) addon:SetSetting("useSlowFallOnOthers", v) end,
width = 1.2,
},
},
},
priestHeader = {
order = 50,
type = "group",
name = "Priest",
inline = true,
args = {
useLevitateWhileFalling = {
order = 51,
type = "toggle",
name = "Cast Levitate While Falling",
desc = "If checked, the keybind will use Levitate while falling (Priests only).",
get = function() return addon:GetSetting("useLevitateWhileFalling") end,
set = function(i, v) addon:SetSetting("useLevitateWhileFalling", v) end,
width = 1.4,
},
useLevitateOnOthers = {
order = 52,
type = "toggle",
name = "Cast Levitate on Others",
desc =
"If checked, Levitate will try to cast on your target or mouseover first, before falling back to yourself.",
get = function() return addon:GetSetting("useLevitateOnOthers") end,
set = function(i, v) addon:SetSetting("useLevitateOnOthers", v) end,
width = 1.2,
},
},
},
},
}
LibAceConfig:RegisterOptionsTable(classSettings_InternalName, classSettingsOptionsTable)
local inspPanel, inspCatID = LibAceConfigDialog:AddToBlizOptions(
classSettings_InternalName,
classSettings_DisplayName,
actualParentCategoryKey
)
if inspPanel then
addon.optionsPanel_Inspector = {
frame = inspPanel,
id = inspCatID or inspPanel.name,
}
addon:DebugOptions("Registered '" .. classSettings_DisplayName .. "' page.")
else
addon:DebugOptions("FAILED Class Settings AddToBliz.")
end
--[[-----------------------------------------------------------------------------
3. Advanced Settings (Parent Category) - NEW EXPANDABLE STRUCTURE
-------------------------------------------------------------------------------]]
-- Initialize references for dynamic content if they don't exist
if not addon.sgMgmtArgsRef then
addon.sgMgmtArgsRef = {
loading_placeholder = {
order = 1,
type = "description",
name = "Loading supergroup data...",
},
}
end
if not addon.sgFamilyArgsRef then
addon.sgFamilyArgsRef = {
loading_placeholder = {
order = 1,
type = "description",
name = "Loading family assignment data...",
},
}
end
if not addon.separationArgsRef then
addon.separationArgsRef = {
loading_placeholder = {
order = 1,
type = "description",
name = "Loading mount separation data...",
},
}
end
-- Create Advanced Settings parent category
local advancedSettings_InternalName = PARENT_ADDON_INTERNAL_NAME .. "_AdvancedSettings"
local advancedSettings_DisplayName = "Advanced Settings"
local advancedSettingsOptionsTable = {
name = advancedSettings_DisplayName,
handler = addon,
type = "group",
order = 4,
args = {
description = {
order = 1,
type = "description",
name = "|cffffd700Advanced Settings Guide|r\n\n" ..
"The Advanced Settings allow fully overriding the base mount groupings for maximum customization. I recommend you read the below to get a better idea of how the addon works before making any changes.\n\n" ..
"|cffffff001. Mounts -> Families|r\n" ..
"Mounts that use the literal same model but different colors are grouped in families.\n Example 1: The Black Wolf and the Gray Wolf in the Wolf Family.\n Example 2: The Black War Wolf and Swift Gray Wolf are in the Armored Wolf family instead since they have extra armor on them.\n\n" ..
"|cffffff002. Families -> Supergroups|r\n" ..
"Families with similar models are grouped in the same Supergroups.\n" ..
" Example: The Wolf family and the Armored Wolf family are both in the Wolves supergroup.\n" ..
"Families with truly unique models like Jade, remain standalone (don't get added to supergroups).\n\n" ..
"|cffffff003. Uniqueness System|r\n" ..
"Families that are assigned to Groups can be labelled as Unique." ..
"Enabling the 'Favor Unique Mounts' toggle in Settings will ungroup the Unique Families, meaning that they will compete in the summoning process individually from their group.\n\n" ..
"|cffffff004. Summoning|r\n" ..
"The mount summoning process picks a supergroup or ungrouped family, then a mount within it, to equalize chances between mounts with a lot of recolor and unique ones.\n" ..
" Example 1: With the default settings, Wolves are one of the eligible groups and ungrouped families for summoning, meaning that to summon the Spectral Wolf, the Wolf group needs to win the roll, then the Spectral Wolf needs to win the roll.\n" ..
" Example 2: With the 'Favor Unique Mounts' toggle enabled, the summon pool will contain Wolves + Spectral Wolf separately, heavily increasing the chances of summoning the Spectral Wolf, and doubling the chance to summon any Wolf.\n\n" ..
"|cff00ff00Available Tools|r\n" ..
"|cffffff00Supergroup Management:|r Create custom supergroups, rename existing ones, delete unwanted groups\n" ..
"|cffffff00Family Assignment:|r Move families between supergroups, make families standalone\n" ..
"|cffffff00Mount Separation:|r Extract individual mounts from families, create custom single-mount families, override traits for separated mounts",
fontSize = "medium",
},
},
}
LibAceConfig:RegisterOptionsTable(advancedSettings_InternalName, advancedSettingsOptionsTable)
local advancedPanel, advancedCatID = LibAceConfigDialog:AddToBlizOptions(
advancedSettings_InternalName,
advancedSettings_DisplayName,
actualParentCategoryKey
)
if advancedPanel then
addon.optionsPanel_AdvancedSettings = {
frame = advancedPanel,
id = advancedCatID or advancedPanel.name,
}
addon:DebugOptions("Registered '" .. advancedSettings_DisplayName .. "' parent category.")
else
addon:DebugOptions("FAILED Advanced Settings parent category AddToBliz.")
end
-- Get the Advanced Settings category key for use as parent
local advancedSettingsParentKey = advancedCatID or (advancedPanel and advancedPanel.name) or advancedSettings_DisplayName
-- Now create the three sub-menus under Advanced Settings
--[[-----------------------------------------------------------------------------
3a. Supergroup Management (Child of Advanced Settings)
-------------------------------------------------------------------------------]]
local superGroupMgmt_InternalName = PARENT_ADDON_INTERNAL_NAME .. "_SuperGroupMgmt"
local superGroupMgmt_DisplayName = "Supergroup Management"
local superGroupMgmtOptionsTable = {
name = superGroupMgmt_DisplayName,
handler = addon,
type = "group",
order = 1,
args = addon.sgMgmtArgsRef, -- Direct reference to dynamic content
}
LibAceConfig:RegisterOptionsTable(superGroupMgmt_InternalName, superGroupMgmtOptionsTable)
local mgmtPanel, mgmtCatID = LibAceConfigDialog:AddToBlizOptions(
superGroupMgmt_InternalName,
superGroupMgmt_DisplayName,
advancedSettingsParentKey -- Child of Advanced Settings
)
if mgmtPanel then
addon.optionsPanel_SuperGroupMgmt = {
frame = mgmtPanel,
id = mgmtCatID or mgmtPanel.name,
}
addon:DebugOptions("Registered '" .. superGroupMgmt_DisplayName .. "' as child of Advanced Settings.")
else
addon:DebugOptions("FAILED Supergroup Management AddToBliz.")
end
--[[-----------------------------------------------------------------------------
3b. Family Assignment (Child of Advanced Settings)
-------------------------------------------------------------------------------]]
local familyAssign_InternalName = PARENT_ADDON_INTERNAL_NAME .. "_FamilyAssign"
local familyAssign_DisplayName = "Family Assignment"
local familyAssignOptionsTable = {
name = familyAssign_DisplayName,
handler = addon,
type = "group",
order = 2,
args = addon.sgFamilyArgsRef, -- Direct reference to dynamic content
}
LibAceConfig:RegisterOptionsTable(familyAssign_InternalName, familyAssignOptionsTable)
local assignPanel, assignCatID = LibAceConfigDialog:AddToBlizOptions(
familyAssign_InternalName,
familyAssign_DisplayName,
advancedSettingsParentKey -- Child of Advanced Settings
)
if assignPanel then
addon.optionsPanel_FamilyAssign = {
frame = assignPanel,
id = assignCatID or assignPanel.name,
}
addon:DebugOptions("Registered '" .. familyAssign_DisplayName .. "' as child of Advanced Settings.")