forked from frankdekker/PerfectRaid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Config.lua
489 lines (467 loc) · 11.9 KB
/
Config.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
local options = {}
local db = {}
local L = PerfectRaidLocals
options.type = "group"
options.name = "PerfectRaid"
options.get = function(k) return db[k.arg] end
options.set = function(k,v) db[k.arg] = v end
options.get = function() end
options.set = function() end
options.args = {}
options.args.general = {
order = 1,
type = "group",
name = L["General Options"],
desc = L["General addon-wide options"],
args = {
hideblizzparty = {
name = L["Hide Blizzard party frames"],
desc = L["Forces the Blizzard party frames to be hidden"],
type = "toggle",
arg = "hideblizzparty",
},
lockframes = {
name = L["Lock PerfectRaid"],
desc = L["Locks frames in place so they can't be moved accidentally"],
type = "toggle",
arg = "lock",
},
tooltips = {
name = L["Show tooltips on mouseover"],
desc = L["Displays the unit tooltip on mouseover"],
type = "toggle",
arg = "tooltip",
},
},
}
options.args.aggro = {
type = "group",
name = L["Aggro Options"],
desc = L["Options for aggro calculation and display"],
args = {
showaggro = {
order = 1,
name = L["Perform aggro check"],
desc = L["Enables calculating which friendly units have aggro"],
type = "toggle",
arg = "aggro,enable",
},
aggrodelay = {
name = L["Update delay"],
desc = L["Controls the delay between aggro calculations, in seconds"],
type = "range",
min = 0.0, max = 2.0, step = 0.05,
arg = "aggro,delay"
},
},
}
options.args.highlight = {
type = "group",
name = L["Highlight Options"],
args = {
mouseover = {
type = "toggle",
name = L["Highlight on mouseover"],
},
disease = {
type = "toggle",
name = L["Highlight diseased units"],
},
curse = {
type = "toggle",
name = L["Highlight cursed units"],
},
magic = {
type = "toggle",
name = L["Highlight units with a magic debuff"],
},
poison = {
type = "toggle",
name = L["Highlight poisoned units"],
},
targetfocus = {
type = "group",
name = L["Target/Focus"],
args = {
target = {
order = 1,
type = "toggle",
name = L["Highlight player's target"],
},
targetcolor = {
order = 2,
type = "color",
name = L["Target highlight color"],
hasAlpha = true,
},
focus = {
order = 3,
type = "toggle",
name = L["Highlight player's focus"],
},
focuscolor = {
order = 4,
type = "color",
name = L["Focus highlight color"],
hasAlpha = true,
},
},
},
},
} -- end highlight
options.args.range = {
type = "group",
name = L["Range checking options"],
args = {
enable = {
type = "toggle",
name = L["Enable range checking"],
},
delay = {
type = "range",
name = L["Range checking delay"],
desc = L["Changes the delay between range checks"],
min = 0, max = 2, step = 0.05,
},
alpha = {
type = "range",
name = L["Out of range alpha"],
desc = L["The opacity level to be set on frames that are out of range"],
min = 0, max = 1.0, step = 0.05,
},
},
} -- end range
local function getFrameArgs()
return {
help = {
order = 1,
type = "description",
name = L["From here you can configure the options for a display frame, including what units it displays and other options that change the look, feel and operation of the frame."],
},
filters = {
type = "group",
name = L["Filters"],
desc = L["Filters which units are displayed in the frame"],
args = {
classes = {
order = 1,
type = "multiselect",
name = L["Classes"],
width = "half",
inline = true,
values = {
WARRIOR = L["Warrior"],
PRIEST = L["Priest"],
DRUID = L["Druid"],
SHAMAN = L["Shaman"],
PALADIN = L["Paladin"],
MAGE = L["Mage"],
ROGUE = L["Rogue"],
WARLOCK = L["Warlock"],
HUNTER = L["Hunter"],
DEMONHUNTER = L["Demon Hunter"],
}
},
groups = {
order = 2,
type = "multiselect",
name = L["Groups"],
width = "half",
inline = true,
values = {
L["Group 1"],
L["Group 2"],
L["Group 3"],
L["Group 4"],
L["Group 5"],
L["Group 6"],
L["Group 7"],
L["Group 8"],
}
},
roles = {
order = 3,
type = "multiselect",
name = L["Roles"],
width = "half",
inline = true,
values = {
MAINTANK = L["Main tank"],
MAINASSIST = L["Main assist"],
},
},
namelist = {
order = 4,
type = "input",
width = "full",
name = L["Name list"],
desc = L["A list of players name to be shown. This option will not be used if any of the group or class filters are set"],
},
strict = {
order = 5,
type = "toggle",
name = L["Strict filtering"],
desc = L["When strict filtering is enabled, a unit must match all given filters in order to be shown."],
},
},
}, -- end filters
visibility = {
type = "group",
name = L["Visibility"],
desc = L["Options that determine when the frames are shown"],
args = {
showRaid = {
width = "full",
type = "toggle",
name = L["Show the frame when in a raid"],
},
showParty = {
width = "full",
type = "toggle",
name = L["Show the frame when in a party, but not in a raid"],
},
showPlayer = {
width = "full",
type = "toggle",
name = L["Show the player when not in a raid"],
desc = L["Enables adding the player to the party or solo frames"],
},
showSolo = {
width = "full",
type = "toggle",
name = L["Show the frame when not grouped"],
-- TODO: Enable showPlayer at the same time
},
}
}, -- end visibility
groupsort = {
type = "group",
name = L["Grouping/Sorting"],
desc = L["Options that set the grouping and sorting for the frame"],
args = {
help = {
order = 1,
type = "description",
name = L["Grouping is the first level of sorting, allowing you to group all of the tanks together, and all of the healers together. After grouping is done, the sort order is applied."],
},
grouping = {
inline = true,
type = "group",
name = L["Grouping"],
args = {
groupBy = {
type = "select",
name = L["Group frames by:"],
desc = L["Chooses the criteria used to group the frames"],
values = {
nogrouping = L["No grouping"],
group = L["Raid group number"],
class = L["Class"],
role = L["Role"],
},
},
groupingOrder = {
type = "input",
name = L["Grouping order:"],
desc = L["Specifies the sort order for grouping. This should be a comma separated list of group numbers, uppercase english class names, or roles"],
},
},
}, -- end grouping
sorting = {
type = "group",
inline = true,
name = L["Sorting"],
args = {
sortMethod = {
type = "select",
name = L["Sort method"],
desc = L["Chooses the sort method when sorting frames. This sort is applied after the grouping order"],
values = {
index = L["By party/raid index"],
name = L["By name"],
},
},
sortDirection = {
type = "select",
name = L["Sort direction"],
values = {
ASC = "Ascending order",
DESC = "Descending order",
},
},
startIndex = {
type = "input",
name = L["Start index"],
desc = L["The start index of the final sorted unit list at which to begin displaying units"],
validate = function(info, value)
local num = tonumber(value)
if not num or num < 1 or num > 40 then
return L["Start index must be a value between 1 and 40"]
end
return true
end,
},
},
}, -- end sorting
},
}, -- end groupsort
columns = {
type = "group",
name = L["Columns"],
desc = L["Options that allow you to split the dislpay of frames into columns"],
args = {
maxColumns = {
type = "input",
name = L["Max columns to display"],
validate = function(info, value)
local num = tonumber(value)
if not num then
return L["Max column must be a number"]
end
return true
end,
},
unitsPerColumn = {
type = "input",
name = L["Number of units per column"],
validate = function(info, value)
if value and not tonumber(value) then
return L["Number of units per column must be a number, or nil"]
end
return true
end
},
columnSpacing = {
type = "input",
name = L["Column spacing"],
validate = function(info, value)
if value and not tonumber(value) then
return L["Column spacing must be a number, or nil"]
end
return true
end,
},
columnAnchorPoint = {
type = "select",
name = L["Column anchor point"],
desc = L["The anchor point for each new column. Setting this to LEFT will cause the columns to grow to the right, for example."],
values = {
"TOPLEFT","TOP","TOPRIGHT","RIGHT","BOTTOMRIGHT","BOTTOM","BOTTOMLEFT","LEFT"
},
},
},
}, -- end columns
display = {
type = "group",
name = L["General"],
args = {
backdrop = {
type = "group",
name = L["Backdrop"],
inline = true,
args = {
headerbackdrop = {
order = 1,
width = "double",
type = "toggle",
name = L["Display a backdrop behind frame"],
},
headercolor = {
order = 2,
type = "color",
name = L["Backdrop color"],
desc = L["The color to be applied to the backdrop"],
hasAlpha = true,
},
},
},
clickcasting = {
order = 99,
width = "double",
type = "toggle",
name = L["Enable click-casting on frames"],
desc = L["Sets the frames to work with addons such as Clique"],
},
title = {
order = 1,
type = "input",
width = "full",
name = L["Title of frame"],
desc = L["A title to be displayed above the frame"],
},
healthbars = {
type = "group",
inline = true,
name = L["Health bar options"],
args = {
classcolor = {
type = "toggle",
name = L["Color bars by class"],
},
reverse = {
type = "toggle",
name = L["Reverse HP bars"],
},
deficit = {
type = "toggle",
name = L["Show health deficit"],
desc = L["Shows the amount of health missing, rather than the amount of health the player has currently."],
},
percent = {
type = "toggle",
name = L["Show percentages only"],
desc = L["Changes the health display to only show percentages"],
},
shortnums = {
type = "toggle",
name = L["Shorten large numbers"],
desc = L["Shortens 1500 to 1.5k"],
},
},
}, -- end healthbars
manabars = {
type = "group",
inline = true,
name = L["Power bar options"],
args = {
barheight = {
type = "range",
name = L["Height of power bar"],
desc = L["The height of the power bar, in game pixels"],
min = 0, max = 10, step = 1,
},
manaonly = {
type = "toggle",
name = L["Only show mana users"],
desc = L["This option hides the power bars for non-mana users such as warriors and rogues."],
},
},
}, -- end manabars
},
}, -- end display
} -- end table definition
end
options.args.frames = {
type = "group",
name = L["Frame Editor"],
args = {
add = {
type = "input",
name = L["Add new frame:"],
desc = L["Each frame must be given a unique name. This is not the same as the title that can be displayed above the frame"],
set = function(self, name)
options.args.frames.args[name] = {
type = "group",
name = name,
arg = name,
childGroups = "tab",
args = getFrameArgs(),
}
end
},
},
}
if LibStub and LibStub("AceConfig-3.0") then
LibStub("AceConfig-3.0"):RegisterOptionsTable("PerfectRaid", options)
-- LibStub("AceConfigDialog-3.0"):Open("PerfectRaid")
end