forked from fxpw/ElvUI_OptionsUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAuras.lua
453 lines (450 loc) · 12.6 KB
/
Auras.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
local E, _, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local C, L = unpack(select(2, ...))
local A = E:GetModule("Auras")
local RB = E:GetModule("ReminderBuffs")
local M = E:GetModule("Minimap")
local format = string.format
--
local function GetAuraOptions(headerName)
local auraOptions = {
header = {
order = 1,
type = "header",
name = headerName
},
size = {
order = 2,
type = "range",
name = L["Size"],
desc = L["Set the size of the individual auras."],
min = 16, max = 60, step = 2
},
durationFontSize = {
order = 3,
type = "range",
name = L["Duration Font Size"],
min = 4, max = 32, step = 1,
},
countFontSize = {
order = 4,
type = "range",
name = L["Count Font Size"],
min = 4, max = 32, step = 1,
},
growthDirection = {
order = 5,
type = "select",
name = L["Growth Direction"],
desc = L["The direction the auras will grow and then the direction they will grow after they reach the wrap after limit."],
values = {
DOWN_RIGHT = format(L["%s and then %s"], L["Down"], L["Right"]),
DOWN_LEFT = format(L["%s and then %s"], L["Down"], L["Left"]),
UP_RIGHT = format(L["%s and then %s"], L["Up"], L["Right"]),
UP_LEFT = format(L["%s and then %s"], L["Up"], L["Left"]),
RIGHT_DOWN = format(L["%s and then %s"], L["Right"], L["Down"]),
RIGHT_UP = format(L["%s and then %s"], L["Right"], L["Up"]),
LEFT_DOWN = format(L["%s and then %s"], L["Left"], L["Down"]),
LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"])
}
},
wrapAfter = {
order = 6,
type = "range",
name = L["Wrap After"],
desc = L["Begin a new row or column after this many auras."],
min = 1, max = 32, step = 1
},
maxWraps = {
order = 7,
type = "range",
name = L["Max Wraps"],
desc = L["Limit the number of rows or columns."],
min = 1, max = 32, step = 1
},
horizontalSpacing = {
order = 8,
type = "range",
name = L["Horizontal Spacing"],
min = 0, max = 50, step = 1
},
verticalSpacing = {
order = 9,
type = "range",
name = L["Vertical Spacing"],
min = 0, max = 50, step = 1
},
sortMethod = {
order = 10,
type = "select",
name = L["Sort Method"],
desc = L["Defines how the group is sorted."],
values = {
["INDEX"] = L["Index"],
["TIME"] = L["Time"],
["NAME"] = L["NAME"]
}
},
sortDir = {
order = 11,
type = "select",
name = L["Sort Direction"],
desc = L["Defines the sort order of the selected sort method."],
values = {
["+"] = L["Ascending"],
["-"] = L["Descending"]
}
},
seperateOwn = {
order = 12,
type = "select",
name = L["Seperate"],
desc = L["Indicate whether buffs you cast yourself should be separated before or after."],
values = {
[-1] = L["Other's First"],
[0] = L["No Sorting"],
[1] = L["Your Auras First"]
}
}
}
return auraOptions
end
E.Options.args.auras = {
type = "group",
name = L["BUFFOPTIONS_LABEL"],
childGroups = "tab",
get = function(info) return E.db.auras[info[#info]] end,
set = function(info, value) E.db.auras[info[#info]] = value A:UpdateHeader(ElvUIPlayerBuffs) A:UpdateHeader(ElvUIPlayerDebuffs) end,
args = {
intro = {
order = 1,
type = "description",
name = L["AURAS_DESC"]
},
enable = {
order = 2,
type = "toggle",
name = L["Enable"],
get = function(info) return E.private.auras[info[#info]] end,
set = function(info, value)
E.private.auras[info[#info]] = value
E:StaticPopup_Show("PRIVATE_RL")
end
},
disableBlizzard = {
order = 3,
type = "toggle",
name = L["Disabled Blizzard"],
get = function(info) return E.private.auras[info[#info]] end,
set = function(info, value)
E.private.auras[info[#info]] = value
E:StaticPopup_Show("PRIVATE_RL")
end
},
general = {
order = 4,
type = "group",
name = L["General"],
args = {
header = {
order = 1,
type = "header",
name = L["General"]
},
fadeThreshold = {
order = 2,
type = "range",
name = L["Fade Threshold"],
desc = L["Threshold before the icon will fade out and back in. Set to -1 to disable."],
min = -1, max = 30, step = 1
},
showDuration = {
order = 3,
type = "toggle",
name = L["Duration Enable"]
},
font = {
order = 4,
type = "select", dialogControl = "LSM30_Font",
name = L["Font"],
values = AceGUIWidgetLSMlists.font
},
fontOutline = {
order = 5,
type = "select",
name = L["Font Outline"],
desc = L["Set the font outline."],
values = C.Values.FontFlags
},
timeXOffset = {
order = 6,
type = "range",
name = L["Time xOffset"],
min = -60, max = 60, step = 1
},
timeYOffset = {
order = 7,
type = "range",
name = L["Time yOffset"],
min = -60, max = 60, step = 1
},
countXOffset = {
order = 8,
type = "range",
name = L["Count xOffset"],
min = -60, max = 60, step = 1
},
countYOffset = {
order = 9,
type = "range",
name = L["Count yOffset"],
min = -60, max = 60, step = 1
},
statusBar = {
order = 10,
type = "group",
name = L["Statusbar"],
guiInline = true,
get = function(info) return E.db.auras[info[#info]] end,
set = function(info, value) E.db.auras[info[#info]] = value; A:UpdateHeader(ElvUIPlayerBuffs); A:UpdateHeader(ElvUIPlayerDebuffs) end,
args = {
barShow = {
order = 1,
type = "toggle",
name = L["Enable"],
},
barNoDuration = {
order = 2,
type = "toggle",
name = L["No Duration"],
},
barTexture = {
order = 3,
type = "select", dialogControl = "LSM30_Statusbar",
name = L["Texture"],
values = _G.AceGUIWidgetLSMlists.statusbar,
},
barColor = {
type = "color",
order = 4,
name = L.COLOR,
hasAlpha = false,
disabled = function() return not E.db.auras.barShow or (E.db.auras.barColorGradient or not E.db.auras.barShow) end,
get = function(info)
local t = E.db.auras.barColor
local d = P.auras.barColor
return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a
end,
set = function(info, r, g, b)
local t = E.db.auras.barColor
t.r, t.g, t.b = r, g, b
end,
},
barColorGradient = {
order = 5,
type = "toggle",
name = L["Color by Value"],
disabled = function() return not E.db.auras.barShow end,
},
barWidth = {
order = 6,
type = "range",
name = L["Width"],
min = 1, max = 10, step = 1,
disabled = function() return not E.db.auras.barShow end,
},
barHeight = {
order = 7,
type = "range",
name = L["Height"],
min = 1, max = 10, step = 1,
disabled = function() return not E.db.auras.barShow end,
},
barSpacing = {
order = 8,
type = "range",
name = L["Spacing"],
min = -10, max = 10, step = 1,
disabled = function() return not E.db.auras.barShow end,
},
barPosition = {
order = 9,
type = "select",
name = L["Position"],
disabled = function() return not E.db.auras.barShow end,
values = {
["TOP"] = L["Top"],
["BOTTOM"] = L["Bottom"],
["LEFT"] = L["Left"],
["RIGHT"] = L["Right"],
},
},
},
},
lbf = {
order = 11,
type = "group",
guiInline = true,
name = L["LBF Support"],
get = function(info) return E.private.auras.lbf[info[#info]] end,
set = function(info, value) E.private.auras.lbf[info[#info]] = value E:StaticPopup_Show("PRIVATE_RL") end,
disabled = function() return not E.private.auras.enable end,
args = {
enable = {
order = 1,
type = "toggle",
name = L["Enable"],
desc = L["Allow LBF to handle the skinning of this element."]
}
}
}
}
},
buffs = {
order = 5,
type = "group",
name = L["Buffs"],
get = function(info) return E.db.auras.buffs[info[#info]] end,
set = function(info, value) E.db.auras.buffs[info[#info]] = value A:UpdateHeader(ElvUIPlayerBuffs) end,
args = GetAuraOptions(L["Buffs"])
},
debuffs = {
order = 6,
type = "group",
name = L["Debuffs"],
get = function(info) return E.db.auras.debuffs[info[#info]] end,
set = function(info, value) E.db.auras.debuffs[info[#info]] = value A:UpdateHeader(ElvUIPlayerDebuffs) end,
args = GetAuraOptions(L["Debuffs"])
},
reminder = {
order = 7,
type = "group",
name = L["Reminder"],
get = function(info) return E.db.general.reminder[info[#info]] end,
set = function(info, value) E.db.general.reminder[info[#info]] = value RB:UpdateSettings() end,
disabled = function() return not E.private.general.minimap.enable end,
args = {
header = {
order = 1,
type = "header",
name = L["Reminder"]
},
enable = {
order = 2,
type = "toggle",
name = L["Enable"],
desc = L["Display reminder bar on the minimap."],
set = function(info, value) E.db.general.reminder[info[#info]] = value M:UpdateSettings() end
},
generalGroup = {
order = 3,
type = "group",
guiInline = true,
name = L["General"],
disabled = function() return not E.db.general.reminder.enable end,
args = {
durations = {
order = 1,
type = "toggle",
name = L["Remaining Time"]
},
reverse = {
order = 2,
type = "toggle",
name = L["Reverse Style"],
desc = L["When enabled active buff icons will light up instead of becoming darker, while inactive buff icons will become darker instead of being lit up."]
},
position = {
order = 3,
type = "select",
name = L["Position"],
set = function(info, value) E.db.general.reminder[info[#info]] = value RB:UpdatePosition() end,
values = {
["LEFT"] = L["Left"],
["RIGHT"] = L["Right"]
}
}
}
},
fontGroup = {
order = 4,
type = "group",
guiInline = true,
name = L["Font"],
disabled = function() return not E.db.general.reminder.enable or not E.db.general.reminder.durations end,
args = {
font = {
order = 1,
type = "select", dialogControl = "LSM30_Font",
name = L["Font"],
values = AceGUIWidgetLSMlists.font
},
fontSize = {
order = 2,
type = "range",
name = L["FONT_SIZE"],
min = 6, max = 22, step = 1
},
fontOutline = {
order = 3,
type = "select",
name = L["Font Outline"],
desc = L["Set the font outline."],
values = C.Values.FontFlags
}
}
},
checkgroup ={
order = 5,
type = "group",
guiInline = true,
name = "Бафы для отображения",
disabled = function() return not E.db.general.reminder.enable end,
args = {
pot = {
order = 1,
type = "toggle",
name = "Настои", -----------------------TODO loc
set = function(info, value) E.db.general.reminder[info[#info]] = value RB:UpdateButtonStatus() end,
},
food = {
order = 2,
type = "toggle",
name = "Еда", -----------------------TODO loc
set = function(info, value) E.db.general.reminder[info[#info]] = value RB:UpdateButtonStatus() end,
},
drubuff = {
order = 3,
type = "toggle",
name = "Дар дикой природы", -----------------------TODO loc
set = function(info, value) E.db.general.reminder[info[#info]] = value RB:UpdateButtonStatus() end,
},
palcask = {
order = 4,
type = "toggle",
name = "Благославление королей", -----------------------TODO loc
set = function(info, value) E.db.general.reminder[info[#info]] = value RB:UpdateButtonStatus() end,
},
inta = {
order = 5,
type = "toggle",
name = "Интеллект/кулак", -----------------------TODO loc
set = function(info, value) E.db.general.reminder[info[#info]] = value RB:UpdateButtonStatus() end,
},
palmp5 = {
order = 6,
type = "toggle",
name = "Благославление мудрости", -----------------------TODO loc
set = function(info, value) E.db.general.reminder[info[#info]] = value RB:UpdateButtonStatus() end,
},
oil = {
order = 7,
type = "toggle",
name = "Масло", -----------------------TODO loc
set = function(info, value) E.db.general.reminder[info[#info]] = value RB:UpdateButtonStatus() end,
},
}
}
}
}
}
}