forked from Hekili/hekili
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Options.lua
11529 lines (9648 loc) · 493 KB
/
Options.lua
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
-- Everything related to building/configuring options.
local addon, ns = ...
local Hekili = _G[ addon ]
local class = Hekili.Class
local scripts = Hekili.Scripts
local state = Hekili.State
local format, lower, match = string.format, string.lower, string.match
local insert, remove, sort, wipe = table.insert, table.remove, table.sort, table.wipe
local callHook = ns.callHook
local SpaceOut = ns.SpaceOut
local formatKey = ns.formatKey
local orderedPairs = ns.orderedPairs
local tableCopy = ns.tableCopy
local GetItemInfo = ns.CachedGetItemInfo
-- Atlas/Textures
local AtlasToString, GetAtlasFile, GetAtlasCoords = ns.AtlasToString, ns.GetAtlasFile, ns.GetAtlasCoords
local ACD = LibStub( "AceConfigDialog-3.0" )
local LDBIcon = LibStub( "LibDBIcon-1.0", true )
local NewFeature = "|TInterface\\OptionsFrame\\UI-OptionsFrame-NewFeatureIcon:0|t"
local GreenPlus = "Interface\\AddOns\\Hekili\\Textures\\GreenPlus"
local RedX = "Interface\\AddOns\\Hekili\\Textures\\RedX"
local BlizzBlue = "|cFF00B4FF"
local ClassColor = C_ClassColor.GetClassColor( class.file )
-- Interrupts
do
local db = {}
-- Generate encounter DB.
local function GenerateEncounterDB()
local active = EJ_GetCurrentTier()
wipe( db )
for t = 1, EJ_GetNumTiers() do
EJ_SelectTier( t )
local i = 1
while EJ_GetInstanceByIndex( i, true ) do
local instanceID, name = EJ_GetInstanceByIndex( i, true )
i = i + 1
local j = 1
while EJ_GetEncounterInfoByIndex( j, instanceID ) do
local name, _, encounterID = EJ_GetEncounterInfoByIndex( j, instanceID )
db[ encounterID ] = name
j = j + 1
end
end
end
end
GenerateEncounterDB()
function Hekili:GetEncounterList()
return db
end
end
-- One Time Fixes
local oneTimeFixes = {
--[[ refreshForBfA_II = function( p )
for k, v in pairs( p.displays ) do
if type( k ) == 'number' then
p.displays[ k ] = nil
end
end
p.runOnce.refreshForBfA_II = nil
p.actionLists = nil
end, ]]
--[[ reviseDisplayModes_20180709 = function( p )
if p.toggles.mode.type ~= "AutoDual" and p.toggles.mode.type ~= "AutoSingle" and p.toggles.mode.type ~= "SingleAOE" then
p.toggles.mode.type = "AutoDual"
end
if p.toggles.mode.value ~= "automatic" and p.toggles.mode.value ~= "single" and p.toggles.mode.value ~= "aoe" and p.toggles.mode.value ~= "dual" then
p.toggles.mode.value = "automatic"
end
end, ]]
--[[ reviseDisplayQueueAnchors_20180718 = function( p )
for name, display in pairs( p.displays ) do
if display.queue.offset then
if display.queue.anchor:sub( 1, 3 ) == "TOP" or display.queue.anchor:sub( 1, 6 ) == "BOTTOM" then
display.queue.offsetY = display.queue.offset
display.queue.offsetX = 0
else
display.queue.offsetX = display.queue.offset
display.queue.offsetY = 0
end
display.queue.offset = nil
end
end
p.runOnce.reviseDisplayQueueAnchors_20180718 = nil
end,
enableAllOfTheThings_20180820 = function( p )
for name, spec in pairs( p.specs ) do
spec.enabled = true
end
end,
wipeSpecPotions_20180910_1 = function( p )
local latestVersion = 20180919.1
for id, spec in pairs( class.specs ) do
if id > 0 and ( not p.specs[ id ].potionsReset or type( p.specs[ id ].potionsReset ) ~= 'number' or p.specs[ id ].potionsReset < latestVersion ) then
p.specs[ id ].potion = spec.potion
p.specs[ id ].potionsReset = latestVersion
end
end
p.runOnce.wipeSpecPotions_20180910_1 = nil
end,
enabledArcaneMageOnce_20190309 = function( p )
local arcane = class.specs[ 62 ]
if arcane and not arcane.enabled then
arcane.enabled = true
return
end
-- Clears the flag if Arcane wasn't actually enabled.
p.runOnce.enabledArcaneMageOnce_20190309 = nil
end,
autoconvertGlowsForCustomGlow_20190326 = function( p )
for k, v in pairs( p.displays ) do
if v.glow and v.glow.shine ~= nil then
if v.glow.shine then
v.glow.mode = "autocast"
else
v.glow.mode = "standard"
end
v.glow.shine = nil
end
end
end,
autoconvertDisplayToggle_20190621_1 = function( p )
local m = p.toggles.mode
local types = m.type
if types then
m.automatic = nil
m.single = nil
m.aoe = nil
m.dual = nil
m.reactive = nil
m.type = nil
if types == "AutoSingle" then
m.automatic = true
m.single = true
elseif types == "SingleAOE" then
m.single = true
m.aoe = true
elseif types == "AutoDual" then
m.automatic = true
m.dual = true
elseif types == "ReactiveDual" then
m.reactive = true
end
if not m[ m.value ] then
if m.automatic then m.value = "automatic"
elseif m.single then m.value = "single"
elseif m.aoe then m.value = "aoe"
elseif m.dual then m.value = "dual"
elseif m.reactive then m.value = "reactive" end
end
end
end,
resetPotionsToDefaults_20190717 = function( p )
for _, v in pairs( p.specs ) do
v.potion = nil
end
end, ]]
resetAberrantPackageDates_20190728_1 = function( p )
for _, v in pairs( p.packs ) do
if type( v.date ) == 'string' then v.date = tonumber( v.date ) or 0 end
if type( v.version ) == 'string' then v.date = tonumber( v.date ) or 0 end
if v.date then while( v.date > 21000000 ) do v.date = v.date / 10 end end
if v.version then while( v.version > 21000000 ) do v.version = v.version / 10 end end
end
end,
--[[ autoconvertDelaySweepToExtend_20190729 = function( p )
for k, v in pairs( p.displays ) do
if v.delays.type == "CDSW" then
v.delays.type = "__NA"
end
end
end,
autoconvertPSCDsToCBs_20190805 = function( p )
for _, pack in pairs( p.packs ) do
for _, list in pairs( pack.lists ) do
for i, entry in ipairs( list ) do
if entry.action == "pocketsized_computation_device" then
entry.action = "cyclotronic_blast"
end
end
end
end
p.runOnce.autoconvertPSCDsToCBs_20190805 = nil -- repeat as needed.
end,
cleanupAnyPriorityVersionTypoes_20200124 = function ( p )
for _, pack in pairs( p.packs ) do
if pack.date and pack.date > 99999999 then pack.date = 0 end
if pack.version and pack.version > 99999999 then pack.version = 0 end
end
p.runOnce.cleanupAnyPriorityVersionTypoes_20200124 = nil -- repeat as needed.
end,
resetRogueMfDOption_20200226 = function( p )
if class.file == "ROGUE" then
p.specs[ 259 ].settings.mfd_waste = nil
p.specs[ 260 ].settings.mfd_waste = nil
p.specs[ 261 ].settings.mfd_waste = nil
end
end,
resetAllPotions_20201209 = function( p )
for id in pairs( p.specs ) do
p.specs[ id ].potion = nil
end
end,
resetGlobalCooldownSync_20210403 = function( p )
for id, spec in pairs( p.specs ) do
spec.gcdSync = nil
end
end, ]]
forceEnableEnhancedRecheckBoomkin_20210712 = function( p )
local s = rawget( p.specs, 102 )
if s then s.enhancedRecheck = true end
end,
updateMaxRefreshToNewSpecOptions_20220222 = function( p )
for id, spec in pairs( p.specs ) do
if spec.settings.maxRefresh then
spec.settings.combatRefresh = 1 / spec.settings.maxRefresh
spec.settings.regularRefresh = min( 1, 5 * spec.settings.combatRefresh )
spec.settings.maxRefresh = nil
end
end
end,
forceEnableAllClassesOnceDueToBug_20220225 = function( p )
for id, spec in pairs( p.specs ) do
spec.enabled = true
end
end,
forceReloadAllDefaultPriorities_20220228 = function( p )
for name, pack in pairs( p.packs ) do
if pack.builtIn then
Hekili.DB.profile.packs[ name ] = nil
Hekili:RestoreDefault( name )
end
end
end,
forceReloadClassDefaultOptions_20220306 = function( p )
local sendMsg = false
for spec, data in pairs( class.specs ) do
if spec > 0 and not p.runOnce[ 'forceReloadClassDefaultOptions_20220306_' .. spec ] then
local cfg = p.specs[ spec ]
for k, v in pairs( data.options ) do
if cfg[ k ] == ns.specTemplate[ k ] and cfg[ k ] ~= v then
cfg[ k ] = v
sendMsg = true
end
end
p.runOnce[ 'forceReloadClassDefaultOptions_20220306_' .. spec ] = true
end
end
if sendMsg then
C_Timer.After( 5, function()
if Hekili.DB.profile.notifications.enabled then Hekili:Notify( "Some specialization options were reset.", 6 ) end
Hekili:Print( "Some specialization options were reset to default; this can occur once per profile/specialization." )
end )
end
p.runOnce.forceReloadClassDefaultOptions_20220306 = nil
end,
forceDeleteBrokenMultiDisplay_20220319 = function( p )
if rawget( p.displays, "Multi" ) then
p.displays.Multi = nil
end
p.runOnce.forceDeleteBrokenMultiDisplay_20220319 = nil
end,
}
function Hekili:RunOneTimeFixes()
local profile = Hekili.DB.profile
if not profile then return end
profile.runOnce = profile.runOnce or {}
for k, v in pairs( oneTimeFixes ) do
if not profile.runOnce[ k ] then
profile.runOnce[k] = true
local ok, err = pcall( v, profile )
if err then
Hekili:Error( "One-Time update failed: " .. k .. ": " .. err )
profile.runOnce[ k ] = nil
end
end
end
end
-- Display Controls
-- Single Display -- single vs. auto in one display.
-- Dual Display -- single in one display, aoe in another.
-- Hybrid Display -- automatic in one display, can toggle to single/AOE.
local displayTemplate = {
enabled = true,
numIcons = 4,
primaryWidth = 50,
primaryHeight = 50,
elvuiCooldown = false,
keepAspectRatio = true,
zoom = 30,
frameStrata = "LOW",
frameLevel = 10,
queue = {
anchor = 'RIGHT',
direction = 'RIGHT',
style = 'RIGHT',
alignment = 'CENTER',
width = 50,
height = 50,
-- offset = 5, -- deprecated.
offsetX = 5,
offsetY = 0,
spacing = 5,
elvuiCooldown = false,
--[[ font = ElvUI and 'PT Sans Narrow' or 'Arial Narrow',
fontSize = 12,
fontStyle = "OUTLINE" ]]
},
visibility = {
advanced = false,
mode = {
aoe = true,
automatic = true,
dual = true,
single = true,
reactive = true,
},
pve = {
alpha = 1,
always = 1,
target = 1,
combat = 1,
combatTarget = 1,
hideMounted = false,
},
pvp = {
alpha = 1,
always = 1,
target = 1,
combat = 1,
combatTarget = 1,
hideMounted = false,
},
},
border = {
enabled = true,
width = 1,
coloring = 'custom',
color = { 0, 0, 0, 1 },
},
range = {
enabled = true,
type = 'ability',
},
glow = {
enabled = false,
queued = false,
mode = "autocast",
coloring = "default",
color = { 0.95, 0.95, 0.32, 1 },
},
flash = {
enabled = false,
color = { 255/255, 215/255, 0, 1 }, -- gold.
brightness = 100,
size = 240,
blink = false,
suppress = false,
},
captions = {
enabled = false,
queued = false,
align = "CENTER",
anchor = "BOTTOM",
x = 0,
y = 0,
font = ElvUI and 'PT Sans Narrow' or 'Arial Narrow',
fontSize = 12,
fontStyle = "OUTLINE",
color = { 1, 1, 1, 1 },
},
indicators = {
enabled = true,
queued = true,
anchor = "RIGHT",
x = 0,
y = 0,
},
targets = {
enabled = true,
font = ElvUI and 'PT Sans Narrow' or 'Arial Narrow',
fontSize = 12,
fontStyle = "OUTLINE",
anchor = "BOTTOMRIGHT",
x = 0,
y = 0,
color = { 1, 1, 1, 1 },
},
delays = {
type = "__NA",
fade = false,
extend = true,
elvuiCooldowns = false,
font = ElvUI and 'PT Sans Narrow' or 'Arial Narrow',
fontSize = 12,
fontStyle = "OUTLINE",
anchor = "TOPLEFT",
x = 0,
y = 0,
color = { 1, 1, 1, 1 },
},
keybindings = {
enabled = true,
queued = true,
font = ElvUI and "PT Sans Narrow" or "Arial Narrow",
fontSize = 12,
fontStyle = "OUTLINE",
lowercase = false,
queuedFont = ElvUI and "PT Sans Narrow" or "Arial Narrow",
queuedFontSize = 12,
queuedFontStyle = "OUTLINE",
queuedLowercase = false,
anchor = "TOPRIGHT",
x = 1,
y = -1,
cPortOverride = true,
cPortZoom = 0.6,
color = { 1, 1, 1, 1 },
queuedColor = { 1, 1, 1, 1 },
},
}
local actionTemplate = {
action = "heart_essence",
enabled = true,
criteria = "",
caption = "",
description = "",
-- Shared Modifiers
early_chain_if = "", -- NYI
cycle_targets = 0,
max_cycle_targets = 3,
max_energy = 0,
interrupt = 0, --NYI
interrupt_if = "", --NYI
interrupt_immediate = 0, -- NYI
travel_speed = nil,
enable_moving = false,
moving = nil,
sync = "",
use_while_casting = 0,
use_off_gcd = 0,
wait_on_ready = 0, -- NYI
-- Call/Run Action List
list_name = nil,
strict = nil,
-- Pool Resource
wait = "0.5",
for_next = 0,
extra_amount = "0",
-- Potion
potion = "default",
-- Variable
op = "set",
condition = "",
default = "",
value = "",
value_else = "",
var_name = "unnamed",
-- Wait
sec = "1",
}
local packTemplate = {
spec = 0,
builtIn = false,
author = UnitName("player"),
desc = "This is a package of action lists for Hekili.",
source = "",
date = tonumber( date("%Y%M%D.%H%M") ),
warnings = "",
hidden = false,
lists = {
precombat = {
{
enabled = false,
action = "heart_essence",
},
},
default = {
{
enabled = false,
action = "heart_essence",
},
},
}
}
local specTemplate = ns.specTemplate
do
local defaults
-- Default Table
function Hekili:GetDefaults()
defaults = defaults or {
global = {
styles = {},
},
profile = {
enabled = true,
minimapIcon = false,
autoSnapshot = true,
screenshot = true,
-- SpellFlash shared.
flashTexture = "Interface\\Cooldown\\star4",
fixedSize = false,
fixedBrightness = false,
toggles = {
pause = {
key = "ALT-SHIFT-P",
},
snapshot = {
key = "ALT-SHIFT-[",
},
mode = {
key = "ALT-SHIFT-N",
-- type = "AutoSingle",
automatic = true,
single = true,
value = "automatic",
},
cooldowns = {
key = "ALT-SHIFT-R",
value = false,
override = false,
separate = false,
},
defensives = {
key = "ALT-SHIFT-T",
value = false,
separate = false,
},
potions = {
key = "",
value = false,
},
interrupts = {
key = "ALT-SHIFT-I",
value = false,
separate = false,
},
essences = {
key = "ALT-SHIFT-G",
value = true,
override = true,
},
custom1 = {
key = "",
value = false,
name = "Custom #1"
},
custom2 = {
key = "",
value = false,
name = "Custom #2"
}
},
specs = {
['**'] = specTemplate
},
packs = {
['**'] = packTemplate
},
notifications = {
enabled = true,
x = 0,
y = 0,
font = ElvUI and "Expressway" or "Arial Narrow",
fontSize = 20,
fontStyle = "OUTLINE",
width = 600,
height = 40,
},
displays = {
Primary = {
enabled = true,
builtIn = true,
name = "Primary",
relativeTo = "SCREEN",
displayPoint = "TOP",
anchorPoint = "BOTTOM",
x = 0,
y = -225,
numIcons = 3,
order = 1,
flash = {
color = { 1, 0, 0, 1 },
},
glow = {
enabled = true,
mode = "autocast"
},
},
AOE = {
enabled = true,
builtIn = true,
name = "AOE",
x = 0,
y = -170,
numIcons = 3,
order = 2,
flash = {
color = { 0, 1, 0, 1 },
},
glow = {
enabled = true,
mode = "autocast",
},
},
Cooldowns = {
enabled = true,
builtIn = true,
name = "Cooldowns",
filter = 'cooldowns',
x = 0,
y = -280,
numIcons = 1,
order = 3,
flash = {
color = { 1, 0.82, 0, 1 },
},
glow = {
enabled = true,
mode = "autocast",
},
},
Defensives = {
enabled = true,
builtIn = true,
name = "Defensives",
filter = 'defensives',
x = -110,
y = -225,
numIcons = 1,
order = 4,
flash = {
color = { 0.522, 0.302, 1, 1 },
},
glow = {
enabled = true,
mode = "autocast",
},
},
Interrupts = {
enabled = true,
builtIn = true,
name = "Interrupts",
filter = 'interrupts',
x = -55,
y = -225,
numIcons = 1,
order = 5,
flash = {
color = { 1, 1, 1, 1 },
},
glow = {
enabled = true,
mode = "autocast",
},
},
['**'] = displayTemplate
},
-- STILL NEED TO REVISE.
Clash = 0,
-- (above)
runOnce = {
},
clashes = {
},
trinkets = {
['**'] = {
disabled = false,
minimum = 0,
maximum = 0,
}
},
interrupts = {
pvp = {},
encounters = {},
},
iconStore = {
hide = false,
},
},
}
for id, spec in pairs( class.specs ) do
if id > 0 then
defaults.profile.specs[ id ] = defaults.profile.specs[ id ] or tableCopy( specTemplate )
for k, v in pairs( spec.options ) do
defaults.profile.specs[ id ][ k ] = v
end
end
end
return defaults
end
end
do
local shareDB = {
displays = {},
styleName = "",
export = "",
exportStage = 0,
import = "",
imported = {},
importStage = 0
}
function Hekili:GetDisplayShareOption( info )
local n = #info
local option = info[ n ]
if shareDB[ option ] then return shareDB[ option ] end
return shareDB.displays[ option ]
end
function Hekili:SetDisplayShareOption( info, val, v2, v3, v4 )
local n = #info
local option = info[ n ]
if type(val) == 'string' then val = val:trim() end
if shareDB[ option ] then shareDB[ option ] = val; return end
shareDB.displays[ option ] = val
shareDB.export = ""
end
local multiDisplays = {
Primary = true,
AOE = true,
Cooldowns = false,
Defensives = false,
Interrupts = false,
}
local frameStratas = ns.FrameStratas
-- Display Config.
function Hekili:GetDisplayOption( info )
local n = #info
local display, category, option = info[ 2 ], info[ 3 ], info[ n ]
if category == "shareDisplays" then
return self:GetDisplayShareOption( info )
end
local conf = self.DB.profile.displays[ display ]
if category ~= option and category ~= "main" then
conf = conf[ category ]
end
if option == "color" or option == "queuedColor" then return unpack( conf.color ) end
if option == "frameStrata" then return frameStratas[ conf.frameStrata ] or 3 end
if option == "name" then return display end
return conf[ option ]
end
local multiSet = false
local rebuild = false
local function QueueRebuildUI()
rebuild = true
C_Timer.After( 0.5, function ()
if rebuild then
Hekili:BuildUI()
rebuild = false
end
end )
end
function Hekili:SetDisplayOption( info, val, v2, v3, v4 )
local n = #info
local display, category, option = info[ 2 ], info[ 3 ], info[ n ]
local set = false
local all = false
if category == "shareDisplays" then
self:SetDisplayShareOption( info, val, v2, v3, v4 )
return
end
local conf = self.DB.profile.displays[ display ]
if category ~= option and category ~= 'main' then conf = conf[ category ] end
if option == 'color' or option == 'queuedColor' then
conf[ option ] = { val, v2, v3, v4 }
set = true
elseif option == 'frameStrata' then
conf.frameStrata = frameStratas[ val ] or "LOW"
set = true
end
if not set then
val = type( val ) == 'string' and val:trim() or val
conf[ option ] = val
end
if not multiSet then QueueRebuildUI() end
end
function Hekili:GetMultiDisplayOption( info )
info[ 2 ] = "Primary"
local val, v2, v3, v4 = self:GetDisplayOption( info )
info[ 2 ] = "Multi"
return val, v2, v3, v4
end
function Hekili:SetMultiDisplayOption( info, val, v2, v3, v4 )
multiSet = true
local orig = info[ 2 ]