-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.lua
More file actions
1360 lines (1334 loc) · 66.5 KB
/
Copy pathconfig.lua
File metadata and controls
1360 lines (1334 loc) · 66.5 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 Addon = select(2, ...)
local Config = Addon:NewModule("Config")
Addon.Config = Config
local ConfigRegistry = LibStub("AceConfigRegistry-3.0")
local ConfigDialog = LibStub("AceConfigDialog-3.0")
local factions = Addon.Factions
local Debug = Addon.DEBUG
local Const = Addon.CONST
local searchQuery = ""
local function tags()
local result = ""
local tkeys = {}
-- populate the table that holds the keys
for k in pairs(Addon.TAGS.Definition) do table.insert(tkeys, k) end
-- sort the keys
table.sort(tkeys)
-- use the keys to retrieve the values in the sorted order
for _, k in ipairs(tkeys) do
result = result .. Addon.CONST.CONFIG_COLORS.TAG .. "[" .. k .. "]|r - " .. Addon.TAGS.Definition[k].desc .. "\n"
end
return result
end
local function conditionalTags()
local result = ""
result = result .. "This functionality allows adding conditional prefixes and/or suffixes to any text TAG (except for graphics ones like bar, icon etc.)" .. "\n"
result = result .. "\n"
result = result .. "Format is: |cnGOLD_FONT_COLOR:[{prefix}TAG{suffix}]|r, where both {prefix} and {suffix} are optional." .. "\n"
result = result .. "If [TAG] would return empty value, the output of [{prefix}TAG{suffix}] is also empty (ie. nothing will be displayed) " .. "\n"
result = result .. "No spaces are alowed except inside {} brackets as part of prefix or suffix text." .. "\n"
result = result .. "\n"
result = result .. "For example, |cnGOLD_FONT_COLOR:[{Level }paragonLevel{ paragon}]|r will display |cnGOLD_FONT_COLOR:Level 5 paragon|r if the Paragon level is 5, and nothing will be displayed if the faction does not have a Paragon level or has not reached it yet." .. "\n"
return result
end
local function faq()
local FAQ = Addon.FAQ
if not FAQ then return end
local result = {
type = "group",
order = 70,
name = FAQ.Header,
args = {},
}
for k,v in pairs(FAQ.Points) do
local order = k:match("^(%d+)%.")
local header = k:match("%d+%.%s*(.+)")
local description = v:gsub(" '", " |cnNORMAL_FONT_COLOR:")
description = description:gsub("'", "|r")
result.args["header" .. order] = {
type = "header",
order = order * 10,
name = header,
}
result.args["description" .. order] = {
type = "description",
order = order * 10 + 1,
name = description,
fontSize = "medium",
}
result.args["blank" .. order] = { type = "description", order = order * 10 + 2, fontSize = "large",name = " ",width = "full", }
end
result.args["footerSpacer"] = {
type = "header",
order = 9990,
name = " ",
}
result.args["footer"] = {
type = "description",
order = 9991,
name = "|cffffd200" .. FAQ.Footer .. "|r", -- gold/yellow highlight
fontSize = "large",
}
return result
end
local function standingColorsPresets()
local presets = {}
presets["custom"] = "Custom"
presets["blizzard"] = "Blizzard"
presets["ascii"] = "Ara Reputation"
presets["wowpro"] = "WoW-Pro (default)"
presets["tiptac"] = "TipTac"
presets["elvui"] = "ElvUI Progressively Colored DataBars"
return presets
end
local function standingColorsSet(value)
local function copy(obj, seen)
if type(obj) ~= 'table' then return obj end
if seen and seen[obj] then return seen[obj] end
local s = seen or {}
local res = setmetatable({}, getmetatable(obj))
s[obj] = res
for k, v in pairs(obj) do res[copy(k, s)] = copy(v, s) end
return res
end
local REP_COLORS = copy(Addon.CONST.REP_COLORS)
Debug:Table("colors", REP_COLORS)
if value == "blizzard" then Addon.db.profile.Colors = REP_COLORS.blizzardColors end
if value == "ascii" then Addon.db.profile.Colors = REP_COLORS.asciiColors end
if value == "wowpro" then Addon.db.profile.Colors = REP_COLORS.wowproColors end
if value == "tiptac" then Addon.db.profile.Colors = REP_COLORS.tiptacColors end
if value == "elvui" then Addon.db.profile.Colors = REP_COLORS.elvuiColors end
Addon.db.profile.ColorsPreset = value
local colorIndexLow = Const.REP_COLOR_INDEX_LOW
local colorIndexHigh = Const.REP_COLOR_INDEX_HIGH
local colorIndexParagon = Const.REP_COLOR_INDEX_PARAGON
Addon.db.profile.ColorRenownLow = Addon.db.profile.Colors[colorIndexLow] or Const.REP_COLORS.wowproColors[colorIndexLow]
Addon.db.profile.ColorRenownHigh = Addon.db.profile.Colors[colorIndexHigh] or Const.REP_COLORS.wowproColors[colorIndexHigh]
Addon.db.profile.ColorFriendLow = Addon.db.profile.Colors[colorIndexLow] or Const.REP_COLORS.wowproColors[colorIndexLow]
Addon.db.profile.ColorFriendHigh = Addon.db.profile.Colors[colorIndexHigh] or Const.REP_COLORS.wowproColors[colorIndexHigh]
Addon.db.profile.ColorParagon = Addon.db.profile.Colors[colorIndexParagon] or Const.REP_COLORS.wowproColors[colorIndexParagon]
end
local function contains_item(t, item)
if next(t) == nil then return false end
for _, value in pairs(t) do
if value == item then
return true
end
end
return false
end
local function remove_item(t, item)
local new_table = {}
for _, value in pairs(t) do
if value ~= item then
table.insert(new_table, value)
end
end
return new_table
end
local function ChatFrameGet(info)
return contains_item(Addon.db.profile.sinkChatFrames, info[#info])
end
local function ChatFrameSet(info, value)
if value then
table.insert(Addon.db.profile.sinkChatFrames, info[#info])
else
Addon.db.profile.sinkChatFrames = remove_item(Addon.db.profile.sinkChatFrames, info[#info])
end
end
local function getChatFrames()
local options = {
type = "group",
name = "Output to Chat Frames",
inline = true,
disabled = function() return (not (Addon.db.profile.sinkChat)) or (Addon.db.profile.sink20OutputSink == "ChatFrame") end,
}
local frames = {}
for i = 1, NUM_CHAT_WINDOWS do
local name = strlower(GetChatWindowInfo(i) or "")
if name ~= "" and _G["ChatFrame"..i.."Tab"]:IsVisible() then
local frame = {
type = "toggle",
order = i,
name = _G["ChatFrame" .. i].name,
get = ChatFrameGet,
set = ChatFrameSet,
}
frames["ChatFrame" .. i] = frame
end
end
options.args = frames
return options
end
local function getFactions(type)
local list = {}
local found
for k,v in pairs(factions) do
if not found then found = k end
if k == Addon.db.profile.Test.faction then found = k end
if type == "all" or searchQuery == "" or string.find(string.lower(k), string.lower(searchQuery)) then
if v and v.blizzFix then
if type == "all" or type == "blizzFix" then
list[k] = "|cffff0000"..k.."|r"
end
elseif type == "all" or type == "standard" then
list[k] = k
end
end
end
if type == "all" and not list["Darkmoon Faire"] then
list["Darkmoon Faire"] = "Darkmoon Faire"
end
Addon.db.profile.Test.faction = found
table.sort(list)
return list
end
local function SetBarsOptions()
Addon:SetBarsOptions()
Addon:UpdateBars()
end
local options = {
name = AddonTitle,
type = "group",
args = {
Settings = {
type = "group",
order = 10,
name = "Options",
childGroups = "tab",
args = {
General = {
type = "group",
order = 0,
name = "General",
args = {
Enabled = {
type = "toggle",
order = 1,
name = "Enabled",
desc = "Print prettified reputation message into chat",
width = "full",
get = function(info) return Addon.db.profile.Enabled end,
set = function(info, value)
Addon.db.profile.Enabled = value
Addon:OnToggle()
end
},
MiniMap = {
type = "toggle",
order = 2,
name = "Show minimap icon",
width = "full",
get = function(info) return not Addon.db.profile.minimapIcon.hide end,
set = function(info, value)
Addon.db.profile.minimapIcon.hide = not value
if Addon.db.profile.minimapIcon.hide then
Addon.icon:Hide(Addon.CONST.METADATA.NAME)
else
Addon.icon:Show(Addon.CONST.METADATA.NAME)
end
end
},
Compartment = {
type = "toggle",
order = 2.1,
name = "Show addon compartment button",
width = "full",
get = function(info) return not Addon.db.profile.AddonCompartment.hide end,
set = function(info, value)
Addon.db.profile.AddonCompartment.hide = not value
if Addon.db.profile.AddonCompartment.hide then
if Addon.icon:IsButtonInCompartment(Addon.CONST.METADATA.NAME) then
Addon.icon:RemoveButtonFromCompartment(Addon.CONST.METADATA.NAME)
end
else
if not Addon.icon:IsButtonInCompartment(Addon.CONST.METADATA.NAME) then
Addon.icon:AddButtonToCompartment(Addon.CONST.METADATA.NAME)
end
end
end
},
Splash = {
type = "toggle",
order = 3,
name = "Show splash reputation (|cnWARNING_FONT_COLOR:May cause lag!|r)",
desc = "Sometimes you can receive reputation changes with factions that are not announced by Blizzard. The addon has an option to display these changes as well, but be aware that this feature may slow down the system even if addon is not enabled on General panel and it's not recommended unless you really need it. It won't catch the first reputation change for a newly discovered 'splased' factions.",
width = "full",
get = function(info) return Addon.db.profile.Splash end,
set = function(info, value)
Addon.db.profile.Splash = value
end
},
Track = {
type = "group",
order = 4,
name = "Track",
inline = true,
args = {
Enabled = {
type = "toggle",
order = 1,
name = "Auto track",
desc = "Set faction with latest reputation change as watched",
get = function(info) return Addon.db.profile.Track end,
set = function(info, value)
Addon.db.profile.Track = value
end
},
OnlyPositive = {
type = "toggle",
order = 2,
name = "Only gain",
desc = "Only switch on a gain (not on a loss)",
get = function(info) return Addon.db.profile.TrackPositive end,
set = function(info, value)
Addon.db.profile.TrackPositive = value
end,
disabled = function() return not (Addon.db.profile.Track) end
},
Guild = {
type = "toggle",
order = 3,
name = "Guild",
desc = "Also switch on guild reputation change",
get = function(info) return Addon.db.profile.TrackGuild end,
set = function(info, value)
Addon.db.profile.TrackGuild = value
end,
disabled = function() return not (Addon.db.profile.Track) end
}
}
},
Tooltip = {
type = "select",
order = 5,
name = "Sort minimap/databroker tooltip by",
values = {
["value"] = "Session gain/loss",
["faction"] = "Faction name",
},
style = "dropdown",
get = function(info) return Addon.db.profile.TooltipSort end,
set = function(info, value)
Addon.db.profile.TooltipSort = value
end,
},
Seperator1 = { type = "description", order = 6, fontSize = "small",name = "",width = "full", },
Debug = {
type = "toggle",
order = 9,
name = "Debug",
desc = "Print debug messages in chat",
width = "full",
get = function(info) return Addon.db.profile.Debug end,
set = function(info, value)
Addon.db.profile.Debug = value
end
},
}
},
Message = {
type = "group",
order = 10,
name = "Message",
args = {
Pattern = {
type = "group",
order = 10,
name = "Message",
inline = true,
args = {
MessageBody = {
type = "input",
order = 1,
name = "pattern",
desc = "Construct your reputation message",
width = 2.75,
multiline =true,
get = function(info) return Addon.db.profile.Reputation.pattern end,
set = function(info, value)
Addon.db.profile.Reputation.pattern = value
end
},
DefaultMessageSet = {
type = "execute",
order = 2,
name = "Default",
desc = Addon.CONST.PATTERN,
width = "half",
func = function() Addon.db.profile.Reputation.pattern = Addon.CONST.PATTERN end
},
},
},
TagsHeader = {
type = "header",
order = 30,
name = "Available tags"
},
AvailableTags = {
type = "description",
order = 31,
name = function() return tags() end
},
ConditionalTagsHeader = {
type = "header",
order = 40,
name = "Conditional prefixes and suffixes for tags"
},
ConditionalTags = {
type = "description",
order = 41,
name = function() return conditionalTags() end
},
},
},
TagsOptions = {
type = "group",
order = 20,
name = "Tags options",
args = {
Bar = {
type = "group",
order = 10,
name = "[bar]",
desc = "options for [bar] and [c_bar] TAGs",
args = {
BarCharacter = {
type = "input",
order = 1,
name = "bar character",
desc = "character to be used for 1bar in barlike progress",
width = "half",
get = function(info) return Addon.db.profile.Reputation.barChar end,
set = function(info, value)
Addon.db.profile.Reputation.barChar = value
end
},
Blank1 = { type = "description", order = 1.1, fontSize = "small",name = "",width = "full", },
BarLength = {
type = "range",
order = 2,
name = "bar length",
desc = "number of bars in barlike progress (would be nice to be clean divider of 100)",
min = 1,
max = 100,
softMin = 5,
softMax = 50,
step = 1,
bigStep = 5,
get = function(info) return Addon.db.profile.Reputation.barLength end,
set = function(info, value)
Addon.db.profile.Reputation.barLength = value
end
},
},
},
BarTexture = {
type = "group",
order = 20,
name = "[barTexture]",
desc = "options for [barTexture] and [c_barTexture] TAGs",
args = {
BarTexture = {
type = "select",
order = 1,
name = "texture",
dialogControl = "LSM30_Statusbar",
values = AceGUIWidgetLSMlists.statusbar,
get = function() return Addon.db.profile.Reputation.barSolidTexture end,
set = function(info, value)
Addon.db.profile.Reputation.barSolidTexture = value
end,
},
Blank1 = { type = "description", order = 1.1, fontSize = "small",name = "",width = "full", },
BarWidth = {
type = "range",
order = 2,
name = "width",
desc = "width of progress bar",
min = 1,
max = 200,
softMin = 5,
softMax = 100,
step = 1,
bigStep = 5,
get = function(info) return Addon.db.profile.Reputation.barSolidWidth end,
set = function(info, value)
Addon.db.profile.Reputation.barSolidWidth = value
end
},
Blank2 = { type = "description", order = 2.1, fontSize = "small",name = "",width = "full", },
BarHeight = {
type = "range",
order = 3,
name = "height",
desc = "height of progress bar",
min = 1,
max = 50,
softMin = 5,
softMax = 20,
step = 1,
bigStep = 1,
get = function(info) return Addon.db.profile.Reputation.barSolidHeight end,
set = function(info, value)
Addon.db.profile.Reputation.barSolidHeight = value
end
},
Blank3 = { type = "description", order = 3.1, fontSize = "small",name = "",width = "full", },
BarOffset = {
type = "range",
order = 4,
name = "offset",
desc = "vertical offset of progress bar from bottom text line",
min = -20,
max = 20,
softMin = -10,
softMax = 10,
step = 1,
bigStep = 1,
get = function(info) return Addon.db.profile.Reputation.barSolidOffset end,
set = function(info, value)
Addon.db.profile.Reputation.barSolidOffset = value
end
},
},
},
StandigText = {
type = "group",
order = 30,
name = "[standing]",
desc = "options for [standing] and [standingNext] TAGs",
args = {
ParagonCount = {
type = "toggle",
order = 1,
name = "show paragon level instead of standing text",
width = "full",
get = function(info) return Addon.db.profile.Reputation.showParagonCount end,
set = function(info, value)
Addon.db.profile.Reputation.showParagonCount = value
end
},
},
},
Icon = {
type = "group",
order = 40,
name = "[icon]",
desc = "options for [icon] TAG",
args = {
Height = {
type = "range",
order = 1,
name = "icon size (0=text height)",
desc = "sets height of icon, 0 for text height",
min = 0,
max = 64,
softMin = 0,
softMax = 32,
step = 1,
bigStep = 1,
get = function(info) return Addon.db.profile.Reputation.iconHeight end,
set = function(info, value)
Addon.db.profile.Reputation.iconHeight = value
end
},
Blank1 = { type = "description", order = 1.1, fontSize = "small",name = "",width = "full", },
Style = {
type = "select",
order = 2,
name = "style",
desc = "style of icon",
values = {
["default"] = "Blizzard",
["clean"] = "Clean (no borders)",
},
get = function(info) return Addon.db.profile.Reputation.iconStyle end,
set = function(info, value)
Addon.db.profile.Reputation.iconStyle = value
end
}
},
},
SignText = {
type = "group",
order = 50,
name = "[signText]",
desc = "options for [signtext] TAG",
args = {
Positive = {
type = "input",
order = 1,
name = "text for reputation gain",
width = "full",
get = function(info) return Addon.db.profile.Reputation.signTextPositive end,
set = function(info, value)
Addon.db.profile.Reputation.signTextPositive = value
end
},
Negative = {
type = "input",
order = 1,
name = "text for reputation loss",
width = "full",
get = function(info) return Addon.db.profile.Reputation.signTextNegative end,
set = function(info, value)
Addon.db.profile.Reputation.signTextNegative = value
end
},
},
},
ShortTag = {
type = "group",
order = 60,
name = "[...Short]",
desc = "options for TAGs ending with 'Short'",
args = {
ShortTagChars = {
type = "range",
order = 1,
name = "number of characters for 'Short' TAGs",
width = 1.2,
min = 1,
max = 100,
softMin = 1,
softMax = 10,
step = 1,
bigStep = 1,
get = function(info) return Addon.db.profile.Reputation.shortCharCount end,
set = function(info, value)
Addon.db.profile.Reputation.shortCharCount = value
end
},
},
},
Paragon = {
type = "group",
order = 70,
name = "[c_...]",
desc = "options for TAGs starting with 'c_'",
args = {
ParagonCount = {
type = "toggle",
order = 1,
name = "paragon standing color overrides renown",
width = "full",
get = function(info) return Addon.db.profile.Reputation.paragonColorOverride end,
set = function(info, value)
Addon.db.profile.Reputation.paragonColorOverride = value
end
},
},
},
},
},
Output = {
type = "group",
order = 30,
name = "Output",
args = {
SinkChat = {
type = "toggle",
order = 20,
name = "Also display message in following chat frames",
desc = ". If you want to display the message only in first chat frame, you can select 'Chat' option above. If you only need to display in chat but not in first chat frame, choose 'None' option above and below select in which frames you would like to see the message.",
width = "full",
disabled = function() return (Addon.db.profile.sink20OutputSink == "ChatFrame") end,
get = function(info) return Addon.db.profile.sinkChat end,
set = function(info, value)
Addon.db.profile.sinkChat = value
end
},
PatternOverride = {
type = "toggle",
order = 50,
name = "Override pattern for chat frames",
width = "full",
disabled = function() return (Addon.db.profile.sink20OutputSink == "ChatFrame") or (not Addon.db.profile.sinkChat) end,
get = function(info) return Addon.db.profile.Reputation.patternChatFrameOverride end,
set = function(info, value)
Addon.db.profile.Reputation.patternChatFrameOverride = value
end
},
Pattern = {
type = "input",
order = 60,
name = "pattern",
desc = "Construct your reputation message",
width = "full",
multiline =true,
hidden = function() return not Addon.db.profile.Reputation.patternChatFrameOverride end,
disabled = function() return (not Addon.db.profile.Reputation.patternChatFrameOverride) or (Addon.db.profile.sink20OutputSink == "ChatFrame") or (not Addon.db.profile.sinkChat) end,
get = function(info) return Addon.db.profile.Reputation.patternChatFrame end,
set = function(info, value)
Addon.db.profile.Reputation.patternChatFrame = value
end
},
},
},
Bars = {
type = "group",
order = 40,
name = "Reputation bars",
args = {
Enabled = {
type = "toggle",
order = 10,
name = "Enabled",
width = "full",
get = function(info) return Addon.db.profile.Bars.enabled end,
set = function(info, value)
Addon.db.profile.Bars.enabled = value
SetBarsOptions()
end,
},
Locked = {
type = "toggle",
order = 110,
name = "Lock position",
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.locked end,
set = function(info, value)
Addon.db.profile.Bars.locked = value
SetBarsOptions()
end,
},
Icon = {
type = "toggle",
order = 120,
name = "Show faction icons",
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.icon end,
set = function(info, value)
Addon.db.profile.Bars.icon = value
SetBarsOptions()
end,
},
GrowUp = {
type = "toggle",
order = 130,
name = "Grows upward",
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.growUp end,
set = function(info, value)
Addon.db.profile.Bars.growUp = value
SetBarsOptions()
end,
},
Texture = {
type = "select",
dialogControl = "LSM30_Statusbar",
order = 210,
name = "Texture",
values = AceGUIWidgetLSMlists.statusbar,
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.texture end,
set = function(info, value)
Addon.db.profile.Bars.texture = value
SetBarsOptions()
end,
},
Width = {
type = "range",
order = 220,
name = "Width",
min = 20,
max = 2000,
softMin = 50,
softMax = 500,
step = 1,
bigStep = 10,
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.width end,
set = function(info, value)
Addon.db.profile.Bars.width = value
SetBarsOptions()
end,
},
Height = {
type = "range",
order = 230,
name = "Height",
min = 2,
max = 64,
softMin = 5,
softMax = 32,
step = 1,
bigStep = 1,
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.height end,
set = function(info, value)
Addon.db.profile.Bars.height = value
SetBarsOptions()
end,
},
Font = {
type = "select",
dialogControl = "LSM30_Font",
order = 310,
name = "Font",
values = AceGUIWidgetLSMlists.font,
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.font end,
set = function(info, value)
Addon.db.profile.Bars.font = value
SetBarsOptions()
end,
},
FontSize = {
type = "range",
order = 320,
name = "Font size",
min = 5,
max = 64,
softMin = 5,
softMax = 32,
step = 1,
bigStep = 1,
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.fontSize end,
set = function(info, value)
Addon.db.profile.Bars.fontSize = value
SetBarsOptions()
end,
},
FontOutline = {
type = "select",
order = 330,
name = "Font outline",
values = {
[""] = "None",
["OUTLINE"] = "Normal",
["THICKOUTLINE"] = "Thick",
},
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.fontOutline end,
set = function(info, value)
Addon.db.profile.Bars.fontOutline = value
SetBarsOptions()
end,
},
Alpha = {
type = "range",
order = 410,
name = "Opacity",
min = 0,
max = 1,
step = 0.01,
isPercent = true,
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.alpha end,
set = function(info, value)
Addon.db.profile.Bars.alpha = value
SetBarsOptions()
end,
},
Sort = {
type = "select",
order = 420,
name = "Sort bars by",
values = {
["faction"] = "Faction name",
["session"] = "Session gain/loss",
["overall"] = "Overall reputation value",
["recent"] = "Time of last change",
},
style = "dropdown",
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.sort end,
set = function(info, value)
Addon.db.profile.Bars.sort = value
SetBarsOptions()
end,
},
TooltipAnchor = {
type = "select",
order = 430,
name = "Anchor tooltip to",
values = {
["ANCHOR_TOP"] = "Top",
["ANCHOR_BOTTOM"] = "Bottom",
["RIGHT"] = "Right",
["LEFT"] = "Left",
["ANCHOR_CURSOR"] = "Cursor",
},
style = "dropdown",
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.tooltipAnchor end,
set = function(info, value)
Addon.db.profile.Bars.tooltipAnchor = value
end,
},
RemoveAfter = {
type = "range",
order = 510,
name = "Time (s)",
desc = "For how many seconds without reputation change will the faction bar be visible. 0=never hide.",
min = 0,
max = 900,
softMin = 0,
softMax = 300,
step = 1,
bigStep = 5,
disabled = function() return not Addon.db.profile.Bars.enabled end,
get = function(info) return Addon.db.profile.Bars.removeAfter end,
set = function(info, value)
Addon.db.profile.Bars.removeAfter = value
end,
},
blank1 = { type = "description", order = 600, fontSize = "small",name = "",width = "full", },
PatternLeft = {
type = "input",
order = 610,
name = "pattern for left text",
width = "full",
get = function(info) return Addon.db.profile.Bars.patternLeft end,
set = function(info, value)
Addon.db.profile.Bars.patternLeft = value
SetBarsOptions()
end
},
PatternRight = {
type = "input",
order = 620,
name = "pattern for right text",
width = "full",
get = function(info) return Addon.db.profile.Bars.patternRight end,
set = function(info, value)
Addon.db.profile.Bars.patternRight = value
SetBarsOptions()
end
},
ParagonOverride = {
type = "toggle",
order = 630,
name = "paragon standing color overrides renown",
width = "full",
get = function(info) return Addon.db.profile.Bars.paragonColorOverride end,
set = function(info, value)
Addon.db.profile.Bars.paragonColorOverride = value
SetBarsOptions()
end
},
},
},
Colors = {
type = "group",
order = 50,
name = "Colors",
args = {
ReputationColors = {
type = "group",
order = 10,
name = "Reputation standing colors",
inline = true,
args = {
Hated = {
type = "color",
order = 1,
name = Addon.CONST.REP_STANDING[1],
get = function(info)
local color = Addon.db.profile.Colors[1]
return color.r, color.g, color.b
end,
set = function(info, r, g, b, a)
local color = Addon.db.profile.Colors[1]
color.r, color.g, color.b = r, g, b
Addon.db.profile.ColorsPreset = "custom"
SetBarsOptions()
end
},
Hostile = {
type = "color",
order = 2,
name = Addon.CONST.REP_STANDING[2],
get = function(info)
local color = Addon.db.profile.Colors[2]
return color.r, color.g, color.b
end,
set = function(info, r, g, b, a)
local color = Addon.db.profile.Colors[2]
color.r, color.g, color.b = r, g, b
Addon.db.profile.ColorsPreset = "custom"
SetBarsOptions()
end
},
Unfriendly = {
type = "color",
order = 3,
name = Addon.CONST.REP_STANDING[3],
get = function(info)
local color = Addon.db.profile.Colors[3]
return color.r, color.g, color.b
end,
set = function(info, r, g, b, a)
local color = Addon.db.profile.Colors[3]
color.r, color.g, color.b = r, g, b
Addon.db.profile.ColorsPreset = "custom"
SetBarsOptions()
end
},
Neutral = {
type = "color",
order = 4,
name = Addon.CONST.REP_STANDING[4],
get = function(info)