-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathConfig.lua
More file actions
295 lines (285 loc) · 7.3 KB
/
Config.lua
File metadata and controls
295 lines (285 loc) · 7.3 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
local mod = LibStub("AceAddon-3.0"):GetAddon("Sexy Reputations")
local L = LibStub("AceLocale-3.0"):GetLocale("SexyReputation", false)
local R = LibStub("AceConfigRegistry-3.0")
local C = LibStub("AceConfigDialog-3.0")
local DBOpt = LibStub("AceDBOptions-3.0")
function mod:SetProfileParam(var, value)
local varName = var[#var]
mod.gdb[varName] = value
mod:UpdateLDBText()
end
function mod:GetProfileParam(var)
local varName = var[#var]
return mod.gdb[varName]
end
function mod:SetDefaultColors()
-- Populate default colors
if not mod.gdb.colors then
mod.gdb.colors = FACTION_BAR_COLORS
end
if #mod.gdb.colors == 8 then
mod.gdb.colors[9] = BLUE_FONT_COLOR
end
end
function mod:SetColorOpt(arg, r, g, b)
local color = mod.gdb.colors[mod.colorIds[arg[#arg]]]
color.r = r
color.g = g
color.b = b
mod:UpdateLDBText()
end
function mod:GetColorOpt(arg)
local color = mod.gdb.colors[mod.colorIds[arg[#arg]]]
return color.r, color.g, color.b, 1
end
mod.STYLE_BAR = 1
mod.STYLE_TEXT = 2
mod.STYLE_NONE = 3
mod.TEXT_STYLE_STANDING = 1
mod.TEXT_STYLE_REPUTATION = 2
mod.TEXT_STYLE_BOTH = 3
mod.defaults = {
char = {
factionHistory = {}, -- the gains of faction, per day
hf = {},
fr = true,
},
global = {
factionLookup = {},
factionIdMigrationComplete = false, -- flag to track if migration has run
warboundGainsMigrationComplete = false,
globalFactionHistory = {},
charRepData = {},
showCrossCharRep = true,
crossCharMax = 5,
colorFactions = true,
showStanding = false,
showRep = false,
showPercentage = true,
showTooltips = true,
showOnlyChanged = false,
showGains = true,
hideExalted = false,
showParagon = true,
repTextStyle = mod.TEXT_STYLE_BOTH,
repStyle = mod.STYLE_BAR,
trackName = true,
trackStanding = true,
trackRep = true,
trackPercentage = true,
trackGains = true,
maxHeight = 1000,
gridLines = false,
}
}
mod.options = {
type = "group",
name = L["Sexy Reputations"],
handler = mod,
set = "SetProfileParam",
get = "GetProfileParam",
args = {
tooltip = {
type = "group",
name = L["Tooltip Options"],
desc = L["Configure the look and feel of the faction tooltip."],
args = {
maxHeight = {
type = "range",
name = L["Tooltip max height"],
desc = L["Maximum tooltip height, in pixels. Regardless of this value, the tooltip will be sized to fit the screen."],
min = 100, max = 3000, step = 5
},
repTextStyle = {
type = "select",
values = {
L["Standing Only"], L["Reputation Only"], L["Both Standing and Reputation"]
},
name = L["Text Reputation Style"],
desc = L["Whether to show the standing and/or reputation level text."],
order = 200,
disabled = function()
return mod.gdb.repStyle ~= mod.STYLE_TEXT
end,
},
colorFactions = {
type = "toggle",
name = L["Color Text"],
desc = L["Color standing and reputation fields based on your standing with the different factions."],
order = 300,
disabled = function()
return mod.gdb.repStyle ~= mod.STYLE_TEXT
end,
},
gridLines = {
type = "toggle",
name = L["Show Row Lines"],
desc = L["Show lines after each row so you can more easily see which values below to which reputation"],
},
repStyle = {
type = "select",
values = {
L["Bar"], L["Text"], L["None"]
},
order = 100,
name = L["Standing Style"],
desc = L["Whether to show the reputation level as a bar, text or not at all"],
},
showPercentage = {
type = "toggle",
name = L["Show Percentage"],
desc = L["Show your rep as a percentage of the reputation standing (i.e Neutral 1500/3000 = 50%)"],
},
showGains = {
type = "toggle",
name = L["Show Gains"],
desc = L["Show reputation gained or lost in the session and today."],
},
showOnlyChanged = {
type = "toggle",
name = L["Active Factions Only"],
desc = L["Only show factions with recent reputation changes."],
},
hideExalted = {
type = "toggle",
name = L["Hide Exalted Factions"],
desc = L["Hide factions at exalted / max standing."],
},
showParagon = {
type = "toggle",
name = L["Always show Paragon Factions"],
desc = L["When enabled, Paragon factions will be shown when Exalted factions are hidden."],
},
},
},
trackedFaction = {
type = "group",
name = L["Text Display"],
desc = L["Configure the LDB display of the tracked faction."],
args = {
trackName = {
type = "toggle",
name = L["Show Name"],
desc = L["Show the name of the tracked faction."],
},
trackStanding = {
type = "toggle",
name = L["Standing"],
desc = L["Show the standing of the tracked faction."],
},
trackRep = {
type = "toggle",
name = L["Reputation"],
desc = L["Show the reputation numbers for the tracked faction."],
},
trackPercentage = {
type = "toggle",
name = L["Percentage"],
desc = L["Show the reputation percentage in the current standing level for the tracked faction."],
},
trackGains = {
type = "toggle",
name = L["Changes"],
desc = L["Show the session changes for the tracked faction."],
},
}
},
factionColors = {
type = "group",
name = L["Standing Colors"],
desc = L["The colors used for the bar/text for the reputation standings."],
order = 9,
set = "SetColorOpt",
get = "GetColorOpt",
args = {
hated = {
type = "color",
name = mod.repTitles[1],
hasAlpha = false,
order = 1,
},
hostile = {
type = "color",
name = mod.repTitles[2],
hasAlpha = false,
order = 2,
},
unfriendly = {
type = "color",
name = mod.repTitles[3],
hasAlpha = false,
order = 3,
},
neutral = {
type = "color",
name = mod.repTitles[4],
hasAlpha = false,
order = 4,
},
friendly = {
type = "color",
name = mod.repTitles[5],
hasAlpha = false,
order = 5,
},
honored = {
type = "color",
name = mod.repTitles[6],
hasAlpha = false,
order = 6,
},
revered = {
type = "color",
name = mod.repTitles[7],
hasAlpha = false,
order = 7,
},
exalted = {
type = "color",
name = mod.repTitles[8],
hasAlpha = false,
order = 8,
},
},
},
crossChar = {
type = "group",
name = L["Cross-Character"],
desc = L["Show other characters' standings when hovering a faction."],
order = 10,
args = {
showCrossCharRep = {
type = "toggle",
name = L["Show Other Characters"],
desc = L["Show other characters' standings when hovering a faction."],
order = 1,
},
crossCharMax = {
type = "range",
name = L["Max Characters"],
desc = L["Maximum number of characters to display per faction."],
min = 1, max = 20, step = 1,
order = 2,
},
clearData = {
type = "execute",
name = L["Clear Character Data"],
desc = L["Remove all stored cross-character reputation data."],
order = 3,
func = function()
wipe(mod.gdb.charRepData)
print("SexyReputation: Cross-character data cleared.")
end,
},
},
},
}
}
if RENOWN_LEVEL_LABEL then
mod.options.args.factionColors.renown = {
type = "color",
name = string.format(RENOWN_LEVEL_LABEL, "1"),
hasAlpha = false,
order = 9,
}
end