-
Notifications
You must be signed in to change notification settings - Fork 9
/
Options.lua
855 lines (825 loc) · 40.4 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
local type, pairs, tinsert, tsort = type, pairs, table.insert, table.sort
local tostring, str_match, tonumber, str_format = tostring, string.match, tonumber, string.format
local ceil, floor = ceil, floor
local ReloadUI = ReloadUI
local Gladdy = LibStub("Gladdy")
local L = Gladdy.L
Gladdy.TIMER_FORMAT = { tenths = "tenths", seconds = "seconds",
values = {
["tenths"] = "xx:xx Miliseconds",
["seconds"] = "xx Seconds"
}}
function Gladdy:FormatTimer(fontString, timeLeft, milibreakpoint, showSeconds)
if timeLeft < 0 then
fontString:SetText("")
return
end
local time = timeLeft >= 0.0 and timeLeft or 0.0
if Gladdy.db.timerFormat == Gladdy.TIMER_FORMAT.tenths and milibreakpoint then
fontString:SetFormattedText("%.1f", time)
else
if time >= 60 then
if showSeconds then
fontString:SetText(floor(timeLeft / 60) .. ":" .. str_format("%02.f", floor(timeLeft - floor(timeLeft / 60) * 60)))
else
fontString:SetText(ceil(ceil(time / 60)) .. "m")
end
else
fontString:SetFormattedText("%d", ceil(time))
end
end
end
Gladdy.defaults = {
profile = {
locked = false,
hideBlizzard = "arena",
x = 0,
y = 0,
growDirection = "BOTTOM",
growMiddle = false,
frameScale = 1,
pixelPerfect = false,
barWidth = 180,
bottomMargin = 2,
statusbarBorderOffset = 6,
timerFormat = Gladdy.TIMER_FORMAT.tenths,
backgroundColor = {r = 0, g = 0, b = 0, a = 0},
newLayout = false,
showMover = true,
useOmnicc =false,
version = Gladdy.version_num
},
}
SLASH_GLADDY1 = "/gladdy"
SlashCmdList["GLADDY"] = function(msg)
if (str_match(msg, "test[1-5]")) then
local _, num = str_match(msg, "(test)([1-5])")
Gladdy:ToggleFrame(tonumber(num))
elseif (msg == "test") then
Gladdy:ToggleFrame(3)
elseif (msg == "ui" or msg == "options" or msg == "config") then
LibStub("AceConfigDialog-3.0"):Open("Gladdy")
elseif (msg == "reset") then
Gladdy.dbi:ResetProfile()
elseif (msg == "hide") then
Gladdy:Reset()
Gladdy:HideFrame()
else
Gladdy:Print(L["Valid slash commands are:"])
Gladdy:Print("/gladdy ui")
Gladdy:Print("/gladdy test")
Gladdy:Print("/gladdy test1-5")
Gladdy:Print("/gladdy hide")
Gladdy:Print("/gladdy reset")
end
end
function Gladdy:option(params)
local defaults = {
get = function(info)
local key = info.arg or info[#info]
return Gladdy.dbi.profile[key]
end,
set = function(info, value)
local key = info.arg or info[#info]
Gladdy.dbi.profile[key] = value
Gladdy:UpdateFrame()
end,
}
for k, v in pairs(params) do
defaults[k] = v
end
return defaults
end
function Gladdy:SetColor(option, factor, altAlpha)
if not factor then
factor = 1
end
return option.r / factor, option.g / factor, option.b / factor, altAlpha or option.a
end
function Gladdy:colorOption(params)
local defaults = {
get = function(info)
local key = info.arg or info[#info]
return Gladdy.dbi.profile[key].r, Gladdy.dbi.profile[key].g, Gladdy.dbi.profile[key].b, Gladdy.dbi.profile[key].a
end,
set = function(info, r, g, b, a)
local key = info.arg or info[#info]
Gladdy.dbi.profile[key].r, Gladdy.dbi.profile[key].g, Gladdy.dbi.profile[key].b, Gladdy.dbi.profile[key].a = r, g, b, a
Gladdy:UpdateFrame()
end,
}
for k, v in pairs(params) do
defaults[k] = v
end
return defaults
end
local function getOpt(info)
local key = info.arg or info[#info]
return Gladdy.dbi.profile[key]
end
local function setOpt(info, value)
local key = info.arg or info[#info]
Gladdy.dbi.profile[key] = value
Gladdy:UpdateFrame()
if Gladdy.db.hideBlizzard == "always" then
Gladdy:BlizzArenaSetAlpha(0)
elseif Gladdy.db.hideBlizzard == "never" then
Gladdy:BlizzArenaSetAlpha(1)
end
end
local function getColorOpt(info)
local key = info.arg or info[#info]
return Gladdy.dbi.profile[key].r, Gladdy.dbi.profile[key].g, Gladdy.dbi.profile[key].b, Gladdy.dbi.profile[key].a
end
local function setColorOpt(info, r, g, b, a)
local key = info.arg or info[#info]
Gladdy.dbi.profile[key].r, Gladdy.dbi.profile[key].g, Gladdy.dbi.profile[key].b, Gladdy.dbi.profile[key].a = r, g, b, a
Gladdy:UpdateFrame()
end
function Gladdy:ResetMenu(name, module, order)
self.options.args[name].args = module:GetOptions()
self.options.args[name].args.reset = {
type = "execute",
name = L["Reset module"],
desc = L["Reset module to defaults"],
order = 1,
func = function()
for k, v in pairs(module.defaults) do
self.dbi.profile[k] = v
end
Gladdy:UpdateFrame()
Gladdy:SetupModule(name, module, order)
end
}
end
function Gladdy:SetupModule(name, module, order)
local options = module:GetOptions()
if options then
self.options.args[name] = {
type = "group",
name = L[name],
desc = L[name] .. " " .. L["settings"],
childGroups = "tab",
order = order,
args = {},
}
if (type(options) == "table") then
self.options.args[name].args = options
self.options.args[name].args.reset = {
type = "execute",
name = L["Reset module"],
desc = L["Reset module to defaults"],
order = 1,
func = function()
for k, v in pairs(module.defaults) do
self.dbi.profile[k] = v
end
Gladdy:UpdateFrame()
Gladdy:SetupModule(name, module, order) -- For example click names are not reset by default
end
}
else
self.options.args[name].args.nothing = {
type = "description",
name = L["No settings"],
desc = L["Module has no settings"],
order = 1,
}
end
end
end
function Gladdy:GetFromMultipleOptions(options)
local val = options[1]
local isAllSameValue = true
for _,v in pairs(options) do
if type(v) == "table" then
if not (v.r == val.r and v.g == val.g and v.b == val.b and v.a == val.a) then
isAllSameValue = false
break
end
else
if val ~= v then
isAllSameValue = false
break
end
end
end
if type(val) == "table" then
if isAllSameValue then
return val.r, val.g, val.b, val.a
else
return 0,0,0,0
end
else
return isAllSameValue and val or ""
end
end
local function setAll(value, options)
for k,_ in pairs(options) do
Gladdy.db[k] = value
end
Gladdy:UpdateFrame()
end
local function pairsByKeys(t)
local a = {}
for k in pairs(t) do
tinsert(a, k)
end
tsort(a, function(a, b) return L[a] < L[b] end)
local i = 0
return function()
i = i + 1
if (a[i] ~= nil) then
return a[i], t[a[i]]
else
return nil
end
end
end
function Gladdy:SetupOptions()
self.options = {
type = "group",
name = L["Gladdy"],
plugins = {},
childGroups = "tree",
get = getOpt,
set = setOpt,
args = {
lock = {
order = 1,
width = 0.7,
name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"],
desc = L["Toggle if frame can be moved"],
type = "execute",
func = function()
Gladdy.db.locked = not Gladdy.db.locked
Gladdy:UpdateFrame()
self.options.args.lock.name = Gladdy.db.locked and L["Unlock frame"] or L["Lock frame"]
end,
},
showMover = {
order = 2,
width = 0.7,
name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"],
desc = L["Toggle to show Mover Frames"],
type = "execute",
func = function()
Gladdy.db.showMover = not Gladdy.db.showMover
Gladdy:UpdateFrame()
self.options.args.showMover.name = Gladdy.db.showMover and L["Hide Mover"] or L["Show Mover"]
end,
},
test = {
order = 2,
width = 0.7,
name = L["Test"],
desc = L["Show Test frames"],
type = "execute",
func = function()
Gladdy:ToggleFrame(3)
end,
},
hide = {
order = 3,
width = 0.7,
name = L["Hide"],
desc = L["Hide frames"],
type = "execute",
func = function()
Gladdy:Reset()
Gladdy:HideFrame()
end,
},
reload = {
order = 4,
width = 0.7,
name = L["ReloadUI"],
desc = L["Reloads the UI"],
type = "execute",
func = function()
ReloadUI()
end,
},
version = {
order = 5,
width = 1,
type = "description",
name = " " .. Gladdy.version
},
general = {
type = "group",
name = L["General"],
desc = L["General settings"],
childGroups = "tab",
order = 5,
args = {
growDirection = {
type = "select",
name = L["Grow Direction"],
order = 3,
values = {
["BOTTOM"] = L["Down"],
["TOP"] = L["Up"],
["LEFT"] = L["Left"],
["RIGHT"] = L["Right"],
}
},
hideBlizzard = {
type = "select",
name = L["Hide Blizzard"],
values = {
["arena"] = L["Arena only"],
["never"] = L["Never"],
["always"] = L["Always"],
},
order = 4,
},
group = {
type = "group",
name = L["General"],
order = 6,
childGroups = "tree",
args = {
frameGeneral = {
type = "group",
name = L["Frame General"],
order = 3,
args = {
headerFrame = {
type = "header",
name = L["Frame General"],
order = 2,
},
growMiddle = {
type = "toggle",
name = L["Grow Middle"],
desc = L["Frames expand along a centric anchor"],
order = 3,
},
pixelPerfect = {
type = "toggle",
name = L["Pixel Perfect Scale"],
desc = L["Enables Pixel Perfect Scale - disables manual "].. L["Frame scale"],
order = 4,
},
frameScale = {
type = "range",
name = L["Frame scale"],
desc = L["Scale of the frame"],
disabled = function() return Gladdy.db.pixelPerfect end,
order = 5,
min = .1,
max = 2,
step = .01,
},
barWidth = {
type = "range",
name = L["Frame width"],
desc = L["Width of the bars"],
order = 7,
min = 10,
max = 500,
step = 5,
},
bottomMargin = {
type = "range",
name = L["Margin"],
desc = L["Margin between each button"],
order = 8,
min = -200,
max = 200,
step = 1,
},
backgroundColor = {
type = "color",
name = L["Background color"],
desc = L["Background Color of the frame"],
order = 9,
hasAlpha = true,
get = getColorOpt,
set = setColorOpt,
},
}
},
cooldownGeneral = {
type = "group",
name = L["Cooldown General"],
order = 4,
args = {
headerCooldown = {
type = "header",
name = L["Cooldown General"],
order = 8,
},
useOmnicc = {
type = "toggle",
name = L["OmniCC Enabled"],
order = 9,
},
disableCooldownCircle = {
type = "toggle",
name = L["No Cooldown Circle"],
order = 10,
disabled = function()
return Gladdy.db.useOmnicc
end,
get = function(info)
local isAllSameValue = Gladdy:GetFromMultipleOptions({
Gladdy.db.auraDisableCircle,
Gladdy.db.buffsDisableCircle,
Gladdy.db.cooldownDisableCircle,
Gladdy.db.drDisableCircle,
Gladdy.db.racialDisableCircle,
Gladdy.db.trinketDisableCircle,
})
if isAllSameValue then
return Gladdy.db.auraDisableCircle
else
return false
end
end,
set = function(info, value)
Gladdy.db.auraDisableCircle = value
Gladdy.db.buffsDisableCircle = value
Gladdy.db.cooldownDisableCircle = value
Gladdy.db.drDisableCircle = value
Gladdy.db.racialDisableCircle = value
Gladdy.db.trinketDisableCircle = value
Gladdy:UpdateFrame()
end,
width= "full",
},
cooldownCircleAlpha = {
type = "range",
name = L["Cooldown circle alpha"],
order = 11,
min = 0,
max = 1,
step = 0.1,
disabled = function()
return Gladdy.db.useOmnicc
end,
get = function(info)
return Gladdy:GetFromMultipleOptions({
Gladdy.db.auraCooldownAlpha,
Gladdy.db.buffsCooldownAlpha,
Gladdy.db.cooldownCooldownAlpha,
Gladdy.db.drCooldownAlpha,
Gladdy.db.racialCooldownAlpha,
Gladdy.db.totemPulseCooldownAlpha,
Gladdy.db.trinketCooldownAlpha,
})
end,
set = function(info, value)
Gladdy.db.auraCooldownAlpha = value
Gladdy.db.buffsCooldownAlpha = value
Gladdy.db.cooldownCooldownAlpha = value
Gladdy.db.drCooldownAlpha = value
Gladdy.db.racialCooldownAlpha = value
Gladdy.db.totemPulseCooldownAlpha = value
Gladdy.db.trinketCooldownAlpha = value
Gladdy:UpdateFrame()
end
},
timerFormat = Gladdy:option({
type = "select",
name = L["Timer Format"],
order = 12,
values = Gladdy.TIMER_FORMAT.values,
disabled = function()
return Gladdy.db.useOmnicc
end,
})
},
},
fontGeneral = {
type = "group",
name = L["Font General"],
order = 4,
args = {
headerFont = {
type = "header",
name = L["Font General"],
order = 10,
},
font = {
type = "select",
name = L["Font"],
desc = L["General Font"],
order = 11,
dialogControl = "LSM30_Font",
values = AceGUIWidgetLSMlists.font,
get = function(info)
return Gladdy:GetFromMultipleOptions({
Gladdy.db.auraFont,
Gladdy.db.buffsFont,
Gladdy.db.castBarFont,
Gladdy.db.cooldownFont,
Gladdy.db.drFont,
Gladdy.db.drLevelTextFont,
Gladdy.db.healthBarFont,
Gladdy.db.petHealthBarFont,
Gladdy.db.powerBarFont,
Gladdy.db.racialFont,
Gladdy.db.targetsHealthBarFont,
Gladdy.db.npTremorFont,
Gladdy.db.totemPulseTextFont,
Gladdy.db.trinketFont
})
end,
set = function(info, value)
setAll(value, {
auraFont = value,
buffsFont = value,
castBarFont = value,
cooldownFont = value,
drFont = value,
drLevelTextFont = value,
healthBarFont = value,
petHealthBarFont = value,
powerBarFont = value,
racialFont = value,
targetsHealthBarFont = value,
npTremorFont = value,
totemPulseTextFont = value,
trinketFont = value,
})
end,
},
fontColor = {
type = "color",
name = L["Font color text"],
desc = L["Color of the text"],
order = 12,
hasAlpha = true,
get = function(info)
return Gladdy:GetFromMultipleOptions({
Gladdy.db.castBarFontColor,
Gladdy.db.healthBarFontColor,
Gladdy.db.petHealthBarFontColor,
Gladdy.db.powerBarFontColor,
Gladdy.db.petHealthBarFontColor,
Gladdy.db.targetHealthBarFontColor,
})
end,
set = function(info, r, g, b, a)
local rgb = {r = r, g = g, b = b, a = a}
setAll(rgb, {
castBarFontColor = true,
healthBarFontColor = true,
petHealthBarFontColor = true,
powerBarFontColor = true,
petHealthBarFontColor = true,
targetHealthBarFontColor = true,
})
end,
},
fontColorCD = {
type = "color",
name = L["Font color timer"],
desc = L["Color of the timers"],
order = 12,
hasAlpha = true,
get = function(info)
return Gladdy:GetFromMultipleOptions({
Gladdy.db.auraFontColor,
Gladdy.db.buffsFontColor,
Gladdy.db.cooldownFontColor,
Gladdy.db.drFontColor,
})
end,
set = function(info, r, g, b, a)
local rgb = {r = r, g = g, b = b, a = a}
setAll(rgb, {
auraFontColor = true,
buffsFontColor = true,
cooldownFontColor = true,
drFontColor = true,
})
end,
},
},
},
iconsGeneral = {
type = "group",
name = L["Icons General"],
order = 5,
args = {
headerIcon = {
type = "header",
name = L["Icons General"],
order = 13,
},
buttonBorderStyle = {
type = "select",
name = L["Icon border style"],
desc = L["This changes the border style of all icons"],
order = 14,
values = Gladdy:GetIconStyles(),
get = function(info)
return Gladdy:GetFromMultipleOptions({
Gladdy.db.auraBorderStyle,
Gladdy.db.buffsBorderStyle,
Gladdy.db.castBarIconStyle,
Gladdy.db.classIconBorderStyle,
Gladdy.db.ciBorderStyle,
Gladdy.db.cooldownBorderStyle,
Gladdy.db.drBorderStyle,
Gladdy.db.petPortraitBorderStyle,
Gladdy.db.racialBorderStyle,
Gladdy.db.targetPortraitBorderStyle,
Gladdy.db.npTotemPlatesBorderStyle,
Gladdy.db.trinketBorderStyle,
})
end,
set = function(info, value)
setAll(value, {
auraBorderStyle = true,
buffsBorderStyle = true,
castBarIconStyle = true,
classIconBorderStyle = true,
ciBorderStyle = true,
cooldownBorderStyle = true,
drBorderStyle = true,
petPortraitBorderStyle = true,
racialBorderStyle = true,
targetPortraitBorderStyle = true,
npTotemPlatesBorderStyle = true,
trinketBorderStyle = true,
})
end,
},
buttonBorderColor = {
type = "color",
name = L["Icon border color"],
desc = L["This changes the border color of all icons"],
order = 15,
hasAlpha = true,
get = function(info)
return Gladdy:GetFromMultipleOptions({
Gladdy.db.buffsBorderColor,
Gladdy.db.castBarIconColor,
Gladdy.db.classIconBorderColor,
Gladdy.db.ciBorderColor,
Gladdy.db.cooldownBorderColor,
Gladdy.db.drBorderColor,
Gladdy.db.petPortraitBorderColor,
Gladdy.db.racialBorderColor,
Gladdy.db.targetPortraitBorderColor,
Gladdy.db.trinketBorderColor,
})
end,
set = function(info, r, g, b, a)
local rgb = {r = r, g = g, b = b, a = a}
setAll(rgb, {
buffsBorderColor = true,
castBarIconColor = true,
classIconBorderColor = true,
ciBorderColor = true,
cooldownBorderColor = true,
drBorderColor = true,
petPortraitBorderColor = true,
racialBorderColor = true,
targetPortraitBorderColor = true,
trinketBorderColor = true,
})
end,
},
},
},
statusbarGeneral = {
type = "group",
name = L["Statusbar General"],
order = 6,
args = {
headerStatusbar = {
type = "header",
name = L["Statusbar General"],
order = 47,
},
statusbarTexture = {
type = "select",
name = L["Statusbar texture"],
desc = L["This changes the texture of all statusbar frames"],
order = 48,
dialogControl = "LSM30_Statusbar",
values = AceGUIWidgetLSMlists.statusbar,
get = function(info)
return Gladdy:GetFromMultipleOptions({
Gladdy.db.castBarTexture,
Gladdy.db.healthBarTexture,
Gladdy.db.petHealthBarTexture,
Gladdy.db.powerBarTexture,
Gladdy.db.targetHealthBarTexture,
Gladdy.db.totemPulseBarTexture,
})
end,
set = function(info, value)
Gladdy.db.castBarTexture = value
Gladdy.db.healthBarTexture = value
Gladdy.db.petHealthBarTexture = value
Gladdy.db.powerBarTexture = value
Gladdy.db.targetHealthBarTexture = value
Gladdy.db.totemPulseBarTexture = value
Gladdy:UpdateFrame()
end,
width= "full",
},
statusbarBorderStyle = {
type = "select",
name = L["Statusbar border style"],
desc = L["This changes the border style of all statusbar frames"],
order = 49,
dialogControl = "LSM30_Border",
values = AceGUIWidgetLSMlists.border,
get = function(info)
return Gladdy:GetFromMultipleOptions({
Gladdy.db.castBarBorderStyle,
Gladdy.db.healthBarBorderStyle,
Gladdy.db.petHealthBarBorderStyle,
Gladdy.db.powerBarBorderStyle,
Gladdy.db.targetHealthBarBorderStyle,
Gladdy.db.totemPulseBarBorderStyle,
})
end,
set = function(info, value)
Gladdy.db.castBarBorderStyle = value
Gladdy.db.healthBarBorderStyle = value
Gladdy.db.petHealthBarBorderStyle = value
Gladdy.db.powerBarBorderStyle = value
Gladdy.db.targetHealthBarBorderStyle = value
Gladdy.db.totemPulseBarBorderStyle = value
Gladdy:UpdateFrame()
end,
},
statusbarBorderOffset = Gladdy:option({
type = "range",
name = L["Statusbar border offset divider (smaller is higher offset)"],
desc = L["Offset of border to statusbar (in case statusbar shows beyond the border)"],
min = 1,
max = 20,
step = 0.1,
}),
statusbarBorderColor = {
type = "color",
name = L["Statusbar border color"],
desc = L["This changes the border color of all statusbar frames"],
order = 50,
hasAlpha = true,
get = function(info)
return Gladdy:GetFromMultipleOptions({
Gladdy.db.castBarBorderColor,
Gladdy.db.healthBarBorderColor,
Gladdy.db.petHealthBarBorderColor,
Gladdy.db.powerBarBorderColor,
Gladdy.db.targetHealthBarBorderColor,
Gladdy.db.totemPulseBarBorderColor,
})
end,
set = function(info, r, g, b, a)
local value = {r = r, g = g, b = b, a = a}
Gladdy.db.castBarBorderColor = value
Gladdy.db.healthBarBorderColor = value
Gladdy.db.petHealthBarBorderColor = value
Gladdy.db.powerBarBorderColor = value
Gladdy.db.targetHealthBarBorderColor = value
Gladdy.db.totemPulseBarBorderColor = value
Gladdy:UpdateFrame()
end,
},
},
},
},
},
},
},
},
}
local order = 6
for k, v in pairsByKeys(self.modules) do
self:SetupModule(k, v, order)
order = order + 1
end
local options = {
name = L["Gladdy"],
type = "group",
args = {
load = {
name = L["Load configuration"],
desc = L["Load configuration options"],
type = "execute",
func = function()
HideUIPanel(SettingsPanel)
LibStub("AceConfigDialog-3.0"):Open("Gladdy")
end,
},
},
}
self.options.plugins.profiles = { profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.dbi) }
LibStub("AceConfig-3.0"):RegisterOptionsTable("Gladdy_blizz", options)
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Gladdy_blizz", "Gladdy")
LibStub("AceConfig-3.0"):RegisterOptionsTable("Gladdy", self.options)
end
function Gladdy:ShowOptions()
LibStub("AceConfigDialog-3.0"):Open("Gladdy")
end