· 6 years ago · Oct 01, 2019, 04:12 PM
1local E, _, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
2local C, L = unpack(select(2, ...))
3local UF = E:GetModule('UnitFrames')
4local NP = E:GetModule("NamePlates")
5
6local _G = _G
7local format, gsub, ipairs, pairs, select, strmatch, strsplit = format, gsub, ipairs, pairs, select, strmatch, strsplit
8local tconcat, tinsert, tremove, type, wipe, tonumber = table.concat, tinsert, tremove, type, wipe, tonumber
9local GetScreenWidth = GetScreenWidth
10local IsAddOnLoaded = IsAddOnLoaded
11
12-- GLOBALS: ElvUF_Parent, ElvUF_Player, ElvUF_Pet, ElvUF_PetTarget, ElvUF_Party, ElvUF_Raidpet
13-- GLOBALS: ElvUF_Target, ElvUF_TargetTarget, ElvUF_TargetTargetTarget, ElvUF_Focus, ElvUF_FocusTarget
14
15local ACD = E.Libs.AceConfigDialog
16
17local positionValues = {
18 TOPLEFT = 'TOPLEFT',
19 LEFT = 'LEFT',
20 BOTTOMLEFT = 'BOTTOMLEFT',
21 RIGHT = 'RIGHT',
22 TOPRIGHT = 'TOPRIGHT',
23 BOTTOMRIGHT = 'BOTTOMRIGHT',
24 CENTER = 'CENTER',
25 TOP = 'TOP',
26 BOTTOM = 'BOTTOM',
27}
28
29local orientationValues = {
30 --["AUTOMATIC"] = L["Automatic"], not sure if i will use this yet
31 ["LEFT"] = L["Left"],
32 ["MIDDLE"] = L["Middle"],
33 ["RIGHT"] = L["Right"],
34}
35
36local petAnchors = {
37 TOPLEFT = 'TOPLEFT',
38 LEFT = 'LEFT',
39 BOTTOMLEFT = 'BOTTOMLEFT',
40 RIGHT = 'RIGHT',
41 TOPRIGHT = 'TOPRIGHT',
42 BOTTOMRIGHT = 'BOTTOMRIGHT',
43 TOP = 'TOP',
44 BOTTOM = 'BOTTOM',
45}
46
47local attachToValues = {
48 ["Health"] = L["Health"],
49 ["Power"] = L["Power"],
50 ["InfoPanel"] = L["Information Panel"],
51 ["Frame"] = L["Frame"],
52}
53
54local growthDirectionValues = {
55 DOWN_RIGHT = format(L["%s and then %s"], L["Down"], L["Right"]),
56 DOWN_LEFT = format(L["%s and then %s"], L["Down"], L["Left"]),
57 UP_RIGHT = format(L["%s and then %s"], L["Up"], L["Right"]),
58 UP_LEFT = format(L["%s and then %s"], L["Up"], L["Left"]),
59 RIGHT_DOWN = format(L["%s and then %s"], L["Right"], L["Down"]),
60 RIGHT_UP = format(L["%s and then %s"], L["Right"], L["Up"]),
61 LEFT_DOWN = format(L["%s and then %s"], L["Left"], L["Down"]),
62 LEFT_UP = format(L["%s and then %s"], L["Left"], L["Up"]),
63}
64
65local smartAuraPositionValues = {
66 ["DISABLED"] = L["DISABLE"],
67 ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
68 ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
69 ["FLUID_BUFFS_ON_DEBUFFS"] = L["Fluid Position Buffs on Debuffs"],
70 ["FLUID_DEBUFFS_ON_BUFFS"] = L["Fluid Position Debuffs on Buffs"],
71}
72
73local colorOverrideValues = {
74 ['USE_DEFAULT'] = L["Use Default"],
75 ['FORCE_ON'] = L["Force On"],
76 ['FORCE_OFF'] = L["Force Off"],
77}
78
79local blendModeValues = {
80 ['DISABLE'] = L["Disable"],
81 ['BLEND'] = L["Blend"],
82 ['ADD'] = L["Additive Blend"],
83 ['MOD'] = L["Modulating Blend"],
84 ['ALPHAKEY'] = L["Alpha Key"],
85}
86
87local CUSTOMTEXT_CONFIGS = {}
88
89local carryFilterFrom, carryFilterTo
90local function filterValue(value)
91 return gsub(value,'([%(%)%.%%%+%-%*%?%[%^%$])','%%%1')
92end
93
94local function filterMatch(s,v)
95 local m1, m2, m3, m4 = "^"..v.."$", "^"..v..",", ","..v.."$", ","..v..","
96 return (strmatch(s, m1) and m1) or (strmatch(s, m2) and m2) or (strmatch(s, m3) and m3) or (strmatch(s, m4) and v..",")
97end
98
99local function filterPriority(auraType, groupName, value, remove, movehere, friendState)
100 if not auraType or not value then return end
101 local filter = E.db.unitframe.units[groupName] and E.db.unitframe.units[groupName][auraType] and E.db.unitframe.units[groupName][auraType].priority
102 if not filter then return end
103 local found = filterMatch(filter, filterValue(value))
104 if found and movehere then
105 local tbl, sv, sm = {strsplit(",",filter)}
106 for i in ipairs(tbl) do
107 if tbl[i] == value then sv = i elseif tbl[i] == movehere then sm = i end
108 if sv and sm then break end
109 end
110 tremove(tbl, sm);tinsert(tbl, sv, movehere);
111 E.db.unitframe.units[groupName][auraType].priority = tconcat(tbl,',')
112 elseif found and friendState then
113 local realValue = strmatch(value, "^Friendly:([^,]*)") or strmatch(value, "^Enemy:([^,]*)") or value
114 local friend = filterMatch(filter, filterValue("Friendly:"..realValue))
115 local enemy = filterMatch(filter, filterValue("Enemy:"..realValue))
116 local default = filterMatch(filter, filterValue(realValue))
117
118 local state =
119 (friend and (not enemy) and format("%s%s","Enemy:",realValue)) --[x] friend [ ] enemy: > enemy
120 or ((not enemy and not friend) and format("%s%s","Friendly:",realValue)) --[ ] friend [ ] enemy: > friendly
121 or (enemy and (not friend) and default and format("%s%s","Friendly:",realValue)) --[ ] friend [x] enemy: (default exists) > friendly
122 or (enemy and (not friend) and strmatch(value, "^Enemy:") and realValue) --[ ] friend [x] enemy: (no default) > realvalue
123 or (friend and enemy and realValue) --[x] friend [x] enemy: > default
124
125 if state then
126 local stateFound = filterMatch(filter, filterValue(state))
127 if not stateFound then
128 local tbl, sv = {strsplit(",",filter)}
129 for i in ipairs(tbl) do
130 if tbl[i] == value then sv = i;break end
131 end
132 tinsert(tbl, sv, state);tremove(tbl, sv+1)
133 E.db.unitframe.units[groupName][auraType].priority = tconcat(tbl,',')
134 end
135 end
136 elseif found and remove then
137 E.db.unitframe.units[groupName][auraType].priority = gsub(filter, found, "")
138 elseif not found and not remove then
139 E.db.unitframe.units[groupName][auraType].priority = (filter == '' and value) or (filter..","..value)
140 end
141end
142
143-----------------------------------------------------------------------
144-- OPTIONS TABLES
145-----------------------------------------------------------------------
146local function GetOptionsTable_AuraBars(updateFunc, groupName)
147 local config = {
148 order = 1100,
149 type = 'group',
150 name = L["Aura Bars"],
151 get = function(info) return E.db.unitframe.units[groupName].aurabar[info[#info]] end,
152 set = function(info, value) E.db.unitframe.units[groupName].aurabar[info[#info]] = value; updateFunc(UF, groupName) end,
153 args = {
154 header = {
155 order = 1,
156 type = "header",
157 name = L["Aura Bars"],
158 },
159 enable = {
160 type = 'toggle',
161 order = 2,
162 name = L["Enable"],
163 },
164 configureButton1 = {
165 order = 3,
166 name = L["Coloring"],
167 desc = L["This opens the UnitFrames Color settings. These settings affect all unitframes."],
168 type = 'execute',
169 func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup", "auraBars") end,
170 },
171 configureButton2 = {
172 order = 4,
173 name = L["Coloring (Specific)"],
174 type = 'execute',
175 func = function() E:SetToFilterConfig('AuraBar Colors') end,
176 },
177 anchorPoint = {
178 type = 'select',
179 order = 5,
180 name = L["Anchor Point"],
181 desc = L["What point to anchor to the frame you set to attach to."],
182 values = {
183 ['ABOVE'] = L["Above"],
184 ['BELOW'] = L["Below"],
185 },
186 },
187 attachTo = {
188 type = 'select',
189 order = 6,
190 name = L["Attach To"],
191 desc = L["The object you want to attach to."],
192 values = {
193 ['FRAME'] = L["Frame"],
194 ['DEBUFFS'] = L["Debuffs"],
195 ['BUFFS'] = L["Buffs"],
196 },
197 },
198 height = {
199 type = 'range',
200 order = 7,
201 name = L["Height"],
202 min = 6, max = 40, step = 1,
203 },
204 maxBars = {
205 type = 'range',
206 order = 8,
207 name = L["Max Bars"],
208 min = 1, max = 40, step = 1,
209 },
210 sort = {
211 type = 'select',
212 order = 9,
213 name = L["Sort Method"],
214 values = {
215 ['TIME_REMAINING'] = L["Time Remaining"],
216 ['TIME_REMAINING_REVERSE'] = L["Time Remaining Reverse"],
217 ['TIME_DURATION'] = L["Duration"],
218 ['TIME_DURATION_REVERSE'] = L["Duration Reverse"],
219 ['NAME'] = L["NAME"],
220 ['NONE'] = L["NONE"],
221 },
222 },
223 friendlyAuraType = {
224 type = 'select',
225 order = 16,
226 name = L["Friendly Aura Type"],
227 desc = L["Set the type of auras to show when a unit is friendly."],
228 values = {
229 ['HARMFUL'] = L["Debuffs"],
230 ['HELPFUL'] = L["Buffs"],
231 },
232 },
233 enemyAuraType = {
234 type = 'select',
235 order = 17,
236 name = L["Enemy Aura Type"],
237 desc = L["Set the type of auras to show when a unit is a foe."],
238 values = {
239 ['HARMFUL'] = L["Debuffs"],
240 ['HELPFUL'] = L["Buffs"],
241 },
242 },
243 uniformThreshold = {
244 order = 18,
245 type = "range",
246 name = L["Uniform Threshold"],
247 desc = L["Seconds remaining on the aura duration before the bar starts moving. Set to 0 to disable."],
248 min = 0, max = 3600, step = 1,
249 },
250 yOffset = {
251 order = 19,
252 type = 'range',
253 name = L["yOffset"],
254 min = -1000, max = 1000, step = 1,
255 },
256 spacing = {
257 order = 20,
258 type = "range",
259 name = L["Spacing"],
260 min = 0, softMax = 20, step = 1,
261 },
262 filters = {
263 name = L["FILTERS"],
264 guiInline = true,
265 type = 'group',
266 order = 500,
267 args = {},
268 },
269 },
270 }
271
272 if groupName == "target" then
273 config.args.attachTo.values.PLAYER_AURABARS = L["Player Frame Aura Bars"]
274 end
275
276 config.args.filters.args.minDuration = {
277 order = 16,
278 type = 'range',
279 name = L["Minimum Duration"],
280 desc = L["Don't display auras that are shorter than this duration (in seconds). Set to zero to disable."],
281 min = 0, max = 10800, step = 1,
282 }
283 config.args.filters.args.maxDuration = {
284 order = 17,
285 type = 'range',
286 name = L["Maximum Duration"],
287 desc = L["Don't display auras that are longer than this duration (in seconds). Set to zero to disable."],
288 min = 0, max = 10800, step = 1,
289 }
290 config.args.filters.args.jumpToFilter = {
291 order = 18,
292 name = L["Filters Page"],
293 desc = L["Shortcut to 'Filters' section of the config."],
294 type = "execute",
295 func = function() ACD:SelectGroup("ElvUI", "filters") end,
296 }
297 config.args.filters.args.specialPriority = {
298 order = 19,
299 sortByValue = true,
300 type = 'select',
301 name = L["Add Special Filter"],
302 desc = L["These filters don't use a list of spells like the regular filters. Instead they use the WoW API and some code logic to determine if an aura should be allowed or blocked."],
303 values = function()
304 local filters = {}
305 local list = E.global.unitframe.specialFilters
306 if not list then return end
307 for filter in pairs(list) do
308 filters[filter] = L[filter]
309 end
310 return filters
311 end,
312 set = function(info, value)
313 filterPriority('aurabar', groupName, value)
314 updateFunc(UF, groupName)
315 end
316 }
317 config.args.filters.args.priority = {
318 order = 20,
319 name = L["Add Regular Filter"],
320 desc = L["These filters use a list of spells to determine if an aura should be allowed or blocked. The content of these filters can be modified in the 'Filters' section of the config."],
321 type = 'select',
322 values = function()
323 local filters = {}
324 local list = E.global.unitframe.aurafilters
325 if not list then return end
326 for filter in pairs(list) do
327 filters[filter] = filter
328 end
329 return filters
330 end,
331 set = function(info, value)
332 filterPriority('aurabar', groupName, value)
333 updateFunc(UF, groupName)
334 end
335 }
336 config.args.filters.args.resetPriority = {
337 order = 21,
338 name = L["Reset Priority"],
339 desc = L["Reset filter priority to the default state."],
340 type = "execute",
341 func = function()
342 E.db.unitframe.units[groupName].aurabar.priority = P.unitframe.units[groupName].aurabar.priority
343 updateFunc(UF, groupName)
344 end,
345 }
346 config.args.filters.args.filterPriority = {
347 order = 22,
348 dragdrop = true,
349 type = "multiselect",
350 name = L["Filter Priority"],
351 dragOnLeave = E.noop, --keep this here
352 dragOnEnter = function(info)
353 carryFilterTo = info.obj.value
354 end,
355 dragOnMouseDown = function(info)
356 carryFilterFrom, carryFilterTo = info.obj.value, nil
357 end,
358 dragOnMouseUp = function(info)
359 filterPriority('aurabar', groupName, carryFilterTo, nil, carryFilterFrom) --add it in the new spot
360 carryFilterFrom, carryFilterTo = nil, nil
361 end,
362 dragOnClick = function(info)
363 filterPriority('aurabar', groupName, carryFilterFrom, true)
364 end,
365 stateSwitchGetText = function(_, TEXT)
366 local friend, enemy = strmatch(TEXT, "^Friendly:([^,]*)"), strmatch(TEXT, "^Enemy:([^,]*)")
367 local text = friend or enemy or TEXT
368 local SF, localized = E.global.unitframe.specialFilters[text], L[text]
369 local blockText = SF and localized and text:match("^block") and localized:gsub("^%[.-]%s?", "")
370 local filterText = (blockText and format("|cFF999999%s|r %s", _G.BLOCK, blockText)) or localized or text
371 return (friend and format("|cFF33FF33%s|r %s", _G.FRIEND, filterText)) or (enemy and format("|cFFFF3333%s|r %s", _G.ENEMY, filterText)) or filterText
372 end,
373 stateSwitchOnClick = function(info)
374 filterPriority('aurabar', groupName, carryFilterFrom, nil, nil, true)
375 end,
376 values = function()
377 local str = E.db.unitframe.units[groupName].aurabar.priority
378 if str == "" then return nil end
379 return {strsplit(",",str)}
380 end,
381 get = function(info, value)
382 local str = E.db.unitframe.units[groupName].aurabar.priority
383 if str == "" then return nil end
384 local tbl = {strsplit(",",str)}
385 return tbl[value]
386 end,
387 set = function(info)
388 E.db.unitframe.units[groupName].aurabar[info[#info]] = nil -- this was being set when drag and drop was first added, setting it to nil to clear tester profiles of this variable
389 updateFunc(UF, groupName)
390 end
391 }
392 config.args.filters.args.spacer1 = {
393 order = 23,
394 type = "description",
395 name = L["Use drag and drop to rearrange filter priority or right click to remove a filter."].."\n"..L["Use Shift+LeftClick to toggle between friendly or enemy or normal state. Normal state will allow the filter to be checked on all units. Friendly state is for friendly units only and enemy state is for enemy units."],
396 }
397
398 return config
399end
400
401local function GetOptionsTable_Auras(auraType, isGroupFrame, updateFunc, groupName, numUnits)
402 local config = {
403 order = auraType == 'buffs' and 600 or 700,
404 type = 'group',
405 name = auraType == 'buffs' and L["Buffs"] or L["Debuffs"],
406 get = function(info) return E.db.unitframe.units[groupName][auraType][info[#info]] end,
407 set = function(info, value) E.db.unitframe.units[groupName][auraType][info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
408 args = {
409 header = {
410 type = "header",
411 order = 1,
412 name = auraType == 'buffs' and L["Buffs"] or L["Debuffs"],
413 },
414 enable = {
415 type = 'toggle',
416 order = 2,
417 name = L["Enable"],
418 },
419 perrow = {
420 type = 'range',
421 order = 3,
422 name = L["Per Row"],
423 min = 1, max = 20, step = 1,
424 },
425 numrows = {
426 type = 'range',
427 order = 4,
428 name = L["Num Rows"],
429 min = 1, max = 10, step = 1,
430 },
431 sizeOverride = {
432 type = 'range',
433 order = 5,
434 name = L["Size Override"],
435 desc = L["If not set to 0 then override the size of the aura icon to this."],
436 min = 0, max = 60, step = 1,
437 },
438 xOffset = {
439 order = 6,
440 type = 'range',
441 name = L["xOffset"],
442 min = -1000, max = 1000, step = 1,
443 },
444 yOffset = {
445 order = 7,
446 type = 'range',
447 name = L["yOffset"],
448 min = -1000, max = 1000, step = 1,
449 },
450 anchorPoint = {
451 type = 'select',
452 order = 8,
453 name = L["Anchor Point"],
454 desc = L["What point to anchor to the frame you set to attach to."],
455 values = positionValues,
456 },
457 clickThrough = {
458 order = 9,
459 name = L["Click Through"],
460 desc = L["Ignore mouse events."],
461 type = 'toggle',
462 },
463 sortMethod = {
464 order = 10,
465 name = L["Sort By"],
466 desc = L["Method to sort by."],
467 type = 'select',
468 values = {
469 ['TIME_REMAINING'] = L["Time Remaining"],
470 ['DURATION'] = L["Duration"],
471 ['NAME'] = L["NAME"],
472 ['INDEX'] = L["Index"],
473 ["PLAYER"] = L["PLAYER"],
474 },
475 },
476 sortDirection = {
477 order = 11,
478 name = L["Sort Direction"],
479 desc = L["Ascending or Descending order."],
480 type = 'select',
481 values = {
482 ['ASCENDING'] = L["Ascending"],
483 ['DESCENDING'] = L["Descending"],
484 },
485 },
486 stacks = {
487 type = "group",
488 order = 12,
489 name = L["Stack Counter"],
490 guiInline = true,
491 get = function(info, value) return E.db.unitframe.units[groupName][auraType][info[#info]] end,
492 set = function(info, value) E.db.unitframe.units[groupName][auraType][info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
493 args = {
494 countFont = {
495 type = "select", dialogControl = 'LSM30_Font',
496 order = 1,
497 name = L["Font"],
498 values = _G.AceGUIWidgetLSMlists.font,
499 },
500 countFontSize = {
501 order = 2,
502 name = L["FONT_SIZE"],
503 type = "range",
504 min = 4, max = 20, step = 1, -- max 20 cause otherwise it looks weird
505 },
506 countFontOutline = {
507 order = 3,
508 name = L["Font Outline"],
509 desc = L["Set the font outline."],
510 type = "select",
511 values = C.Values.FontFlags,
512 },
513 }
514 },
515 duration = {
516 type = "group",
517 order = 13,
518 name = L["Duration"],
519 guiInline = true,
520 get = function(info) return E.db.unitframe.units[groupName][auraType][info[#info]] end,
521 set = function(info, value) E.db.unitframe.units[groupName][auraType][info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
522 args = {
523 cooldownShortcut = {
524 order = 1,
525 type = "execute",
526 name = L["Cooldowns"],
527 buttonElvUI = true,
528 func = function() ACD:SelectGroup("ElvUI", "cooldown", "unitframe") end,
529 },
530 durationPosition = {
531 order = 2,
532 name = L["Position"],
533 type = "select",
534 values = {
535 ["TOP"] = "TOP",
536 ["LEFT"] = "LEFT",
537 ["BOTTOM"] = "BOTTOM",
538 ["CENTER"] = "CENTER",
539 ["TOPLEFT"] = "TOPLEFT",
540 ["BOTTOMLEFT"] = "BOTTOMLEFT",
541 ["TOPRIGHT"] = "TOPRIGHT",
542 },
543 },
544 }
545 },
546 filters = {
547 name = L["FILTERS"],
548 guiInline = true,
549 type = 'group',
550 order = 500,
551 args = {},
552 },
553 },
554 }
555
556 if auraType == "buffs" then
557 config.args.attachTo = {
558 type = 'select',
559 order = 7,
560 name = L["Attach To"],
561 desc = L["What to attach the buff anchor frame to."],
562 values = {
563 ['FRAME'] = L["Frame"],
564 ['DEBUFFS'] = L["Debuffs"],
565 ["HEALTH"] = L["Health"],
566 ["POWER"] = L["Power"],
567 },
568 disabled = function()
569 local smartAuraPosition = E.db.unitframe.units[groupName].smartAuraPosition
570 return (smartAuraPosition and (smartAuraPosition == "BUFFS_ON_DEBUFFS" or smartAuraPosition == "FLUID_BUFFS_ON_DEBUFFS"))
571 end,
572 }
573 else
574 config.args.attachTo = {
575 type = 'select',
576 order = 7,
577 name = L["Attach To"],
578 desc = L["What to attach the debuff anchor frame to."],
579 values = {
580 ['FRAME'] = L["Frame"],
581 ['BUFFS'] = L["Buffs"],
582 ["HEALTH"] = L["Health"],
583 ["POWER"] = L["Power"],
584 },
585 disabled = function()
586 local smartAuraPosition = E.db.unitframe.units[groupName].smartAuraPosition
587 return (smartAuraPosition and (smartAuraPosition == "DEBUFFS_ON_BUFFS" or smartAuraPosition == "FLUID_DEBUFFS_ON_BUFFS"))
588 end,
589 }
590 end
591
592 if isGroupFrame then
593 config.args.countFontSize = {
594 order = 10,
595 name = L["Count Font Size"],
596 type = "range",
597 min = 6, max = 212, step = 1,
598 }
599 end
600
601 config.args.filters.args.minDuration = {
602 order = 16,
603 type = 'range',
604 name = L["Minimum Duration"],
605 desc = L["Don't display auras that are shorter than this duration (in seconds). Set to zero to disable."],
606 min = 0, max = 10800, step = 1,
607 }
608 config.args.filters.args.maxDuration = {
609 order = 17,
610 type = 'range',
611 name = L["Maximum Duration"],
612 desc = L["Don't display auras that are longer than this duration (in seconds). Set to zero to disable."],
613 min = 0, max = 10800, step = 1,
614 }
615 config.args.filters.args.jumpToFilter = {
616 order = 18,
617 name = L["Filters Page"],
618 desc = L["Shortcut to 'Filters' section of the config."],
619 type = "execute",
620 func = function() ACD:SelectGroup("ElvUI", "filters") end,
621 }
622 config.args.filters.args.specialPriority = {
623 order = 19,
624 sortByValue = true,
625 type = 'select',
626 name = L["Add Special Filter"],
627 desc = L["These filters don't use a list of spells like the regular filters. Instead they use the WoW API and some code logic to determine if an aura should be allowed or blocked."],
628 values = function()
629 local filters = {}
630 local list = E.global.unitframe.specialFilters
631 if not list then return end
632 for filter in pairs(list) do
633 filters[filter] = L[filter]
634 end
635 return filters
636 end,
637 set = function(info, value)
638 filterPriority(auraType, groupName, value)
639 updateFunc(UF, groupName, numUnits)
640 end
641 }
642 config.args.filters.args.priority = {
643 order = 20,
644 name = L["Add Regular Filter"],
645 desc = L["These filters use a list of spells to determine if an aura should be allowed or blocked. The content of these filters can be modified in the 'Filters' section of the config."],
646 type = 'select',
647 values = function()
648 local filters = {}
649 local list = E.global.unitframe.aurafilters
650 if not list then return end
651 for filter in pairs(list) do
652 filters[filter] = filter
653 end
654 return filters
655 end,
656 set = function(info, value)
657 filterPriority(auraType, groupName, value)
658 updateFunc(UF, groupName, numUnits)
659 end
660 }
661 config.args.filters.args.resetPriority = {
662 order = 21,
663 name = L["Reset Priority"],
664 desc = L["Reset filter priority to the default state."],
665 type = "execute",
666 func = function()
667 E.db.unitframe.units[groupName][auraType].priority = P.unitframe.units[groupName][auraType].priority
668 updateFunc(UF, groupName, numUnits)
669 end,
670 }
671 config.args.filters.args.filterPriority = {
672 order = 22,
673 dragdrop = true,
674 type = "multiselect",
675 name = L["Filter Priority"],
676 dragOnLeave = E.noop, --keep this here
677 dragOnEnter = function(info)
678 carryFilterTo = info.obj.value
679 end,
680 dragOnMouseDown = function(info)
681 carryFilterFrom, carryFilterTo = info.obj.value, nil
682 end,
683 dragOnMouseUp = function(info)
684 filterPriority(auraType, groupName, carryFilterTo, nil, carryFilterFrom) --add it in the new spot
685 carryFilterFrom, carryFilterTo = nil, nil
686 end,
687 dragOnClick = function(info)
688 filterPriority(auraType, groupName, carryFilterFrom, true)
689 end,
690 stateSwitchGetText = function(_, TEXT)
691 local friend, enemy = strmatch(TEXT, "^Friendly:([^,]*)"), strmatch(TEXT, "^Enemy:([^,]*)")
692 local text = friend or enemy or TEXT
693 local SF, localized = E.global.unitframe.specialFilters[text], L[text]
694 local blockText = SF and localized and text:match("^block") and localized:gsub("^%[.-]%s?", "")
695 local filterText = (blockText and format("|cFF999999%s|r %s", _G.BLOCK, blockText)) or localized or text
696 return (friend and format("|cFF33FF33%s|r %s", _G.FRIEND, filterText)) or (enemy and format("|cFFFF3333%s|r %s", _G.ENEMY, filterText)) or filterText
697 end,
698 stateSwitchOnClick = function(info)
699 filterPriority(auraType, groupName, carryFilterFrom, nil, nil, true)
700 end,
701 values = function()
702 local str = E.db.unitframe.units[groupName][auraType].priority
703 if str == "" then return nil end
704 return {strsplit(",",str)}
705 end,
706 get = function(info, value)
707 local str = E.db.unitframe.units[groupName][auraType].priority
708 if str == "" then return nil end
709 local tbl = {strsplit(",",str)}
710 return tbl[value]
711 end,
712 set = function(info)
713 E.db.unitframe.units[groupName][auraType][info[#info]] = nil -- this was being set when drag and drop was first added, setting it to nil to clear tester profiles of this variable
714 updateFunc(UF, groupName, numUnits)
715 end
716 }
717 config.args.filters.args.spacer1 = {
718 order = 23,
719 type = "description",
720 name = L["Use drag and drop to rearrange filter priority or right click to remove a filter."].."\n"..L["Use Shift+LeftClick to toggle between friendly or enemy or normal state. Normal state will allow the filter to be checked on all units. Friendly state is for friendly units only and enemy state is for enemy units."],
721 }
722
723 return config
724end
725
726local function GetOptionsTable_Fader(updateFunc, groupName, numUnits)
727 local config = {
728 order = 550,
729 type = 'group',
730 name = L["Fader"],
731 get = function(info) return E.db.unitframe.units[groupName].fader[info[#info]] end,
732 set = function(info, value) E.db.unitframe.units[groupName].fader[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
733 args = {
734 header = {
735 order = 1,
736 type = "header",
737 name = L["Fader"],
738 },
739 enable = {
740 type = 'toggle',
741 order = 2,
742 name = L["Enable"],
743 },
744 range = {
745 type = 'toggle',
746 order = 3,
747 name = L["Range"],
748 disabled = function() return not E.db.unitframe.units[groupName].fader.enable end,
749 hidden = function() return groupName == 'player' end,
750 },
751 hover = {
752 type = 'toggle',
753 order = 4,
754 name = L["Hover"],
755 disabled = function() return not E.db.unitframe.units[groupName].fader.enable or E.db.unitframe.units[groupName].fader.range end,
756 },
757 combat = {
758 type = 'toggle',
759 order = 5,
760 name = L["Combat"],
761 disabled = function() return not E.db.unitframe.units[groupName].fader.enable or E.db.unitframe.units[groupName].fader.range end,
762 },
763 unittarget = {
764 type = 'toggle',
765 order = 6,
766 name = L["Unit Target"],
767 disabled = function() return not E.db.unitframe.units[groupName].fader.enable or E.db.unitframe.units[groupName].fader.range end,
768 hidden = function() return groupName == 'player' end,
769 },
770 playertarget = {
771 type = 'toggle',
772 order = 7,
773 name = (groupName == 'player' and L["Target"]) or L["Player Target"],
774 disabled = function() return not E.db.unitframe.units[groupName].fader.enable or E.db.unitframe.units[groupName].fader.range end,
775 },
776 health = {
777 type = 'toggle',
778 order = 9,
779 name = L["Health"],
780 disabled = function() return not E.db.unitframe.units[groupName].fader.enable or E.db.unitframe.units[groupName].fader.range end,
781 },
782 power = {
783 type = 'toggle',
784 order = 10,
785 name = L["Power"],
786 disabled = function() return not E.db.unitframe.units[groupName].fader.enable or E.db.unitframe.units[groupName].fader.range end,
787 },
788 casting = {
789 type = 'toggle',
790 order = 12,
791 name = L["Casting"],
792 disabled = function() return not E.db.unitframe.units[groupName].fader.enable or E.db.unitframe.units[groupName].fader.range end,
793 },
794 spacer = {
795 order = 13,
796 type = 'description',
797 name = ' ',
798 width = 'full',
799 },
800 delay = {
801 order = 14,
802 name = L["Fade Out Delay"],
803 type = 'range',
804 min = 0, max = 3, step = 0.01,
805 disabled = function() return not E.db.unitframe.units[groupName].fader.enable or E.db.unitframe.units[groupName].fader.range end,
806 },
807 smooth = {
808 order = 15,
809 name = L["Smooth"],
810 type = 'range',
811 min = 0, max = 1, step = 0.01,
812 disabled = function() return not E.db.unitframe.units[groupName].fader.enable end,
813 },
814 minAlpha = {
815 order = 16,
816 name = L["Min Alpha"],
817 type = 'range',
818 min = 0, max = 1, step = 0.01,
819 disabled = function() return not E.db.unitframe.units[groupName].fader.enable end,
820 },
821 maxAlpha = {
822 order = 17,
823 name = L["Max Alpha"],
824 type = 'range',
825 min = 0, max = 1, step = 0.01,
826 disabled = function() return not E.db.unitframe.units[groupName].fader.enable end,
827 },
828 },
829 }
830
831 return config
832end
833
834local function GetOptionsTable_Castbar(hasTicks, updateFunc, groupName, numUnits)
835 local config = {
836 order = 800,
837 type = 'group',
838 name = L["Castbar"],
839 get = function(info) return E.db.unitframe.units[groupName].castbar[info[#info]] end,
840 set = function(info, value) E.db.unitframe.units[groupName].castbar[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
841 args = {
842 header = {
843 order = 1,
844 type = "header",
845 name = L["Castbar"],
846 },
847 matchsize = {
848 order = 2,
849 type = 'execute',
850 name = L["Match Frame Width"],
851 func = function() E.db.unitframe.units[groupName].castbar.width = E.db.unitframe.units[groupName].width; updateFunc(UF, groupName, numUnits) end,
852 },
853 forceshow = {
854 order = 3,
855 name = L["SHOW"]..' / '..L["HIDE"],
856 func = function()
857 local frameName = E:StringTitle(groupName)
858 frameName = "ElvUF_"..frameName
859 frameName = frameName:gsub('t(arget)', 'T%1')
860
861 if groupName == "party" then
862 local header = UF.headers[groupName]
863 for i = 1, header:GetNumChildren() do
864 local group = select(i, header:GetChildren())
865 for j = 1, group:GetNumChildren() do
866 --Party unitbutton
867 local unitbutton = select(j, group:GetChildren())
868 local castbar = unitbutton.Castbar
869 if not castbar.oldHide then
870 castbar.oldHide = castbar.Hide
871 castbar.Hide = castbar.Show
872 castbar:Show()
873 else
874 castbar.Hide = castbar.oldHide
875 castbar.oldHide = nil
876 castbar:Hide()
877 end
878 end
879 end
880 elseif numUnits then
881 for i = 1, numUnits do
882 local castbar = _G[frameName..i].Castbar
883 if not castbar.oldHide then
884 castbar.oldHide = castbar.Hide
885 castbar.Hide = castbar.Show
886 castbar:Show()
887 else
888 castbar.Hide = castbar.oldHide
889 castbar.oldHide = nil
890 castbar:Hide()
891 end
892 end
893 else
894 local castbar = _G[frameName].Castbar
895 if not castbar.oldHide then
896 castbar.oldHide = castbar.Hide
897 castbar.Hide = castbar.Show
898 castbar:Show()
899 else
900 castbar.Hide = castbar.oldHide
901 castbar.oldHide = nil
902 castbar:Hide()
903 end
904 end
905 end,
906 type = 'execute',
907 },
908 configureButton = {
909 order = 4,
910 name = L["Coloring"],
911 desc = L["This opens the UnitFrames Color settings. These settings affect all unitframes."],
912 type = 'execute',
913 func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup", "castBars") end,
914 },
915 enable = {
916 type = 'toggle',
917 order = 5,
918 name = L["Enable"],
919 },
920 width = {
921 order = 6,
922 name = L["Width"],
923 type = 'range',
924 softMax = 600,
925 min = 50, max = GetScreenWidth(), step = 1,
926 },
927 height = {
928 order = 7,
929 name = L["Height"],
930 type = 'range',
931 min = 10, max = 85, step = 1,
932 },
933 latency = {
934 order = 8,
935 name = L["Latency"],
936 type = 'toggle',
937 },
938 format = {
939 order = 9,
940 type = 'select',
941 name = L["Format"],
942 values = {
943 ['CURRENTMAX'] = L["Current / Max"],
944 ['CURRENT'] = L["Current"],
945 ['REMAINING'] = L["Remaining"],
946 ['REMAININGMAX'] = L["Remaining / Max"],
947 },
948 },
949 spark = {
950 order = 10,
951 type = 'toggle',
952 name = L["Spark"],
953 desc = L["Display a spark texture at the end of the castbar statusbar to help show the differance between castbar and backdrop."],
954 },
955 insideInfoPanel = {
956 order = 11,
957 name = L["Inside Information Panel"],
958 desc = L["Display the castbar inside the information panel, the icon will be displayed outside the main unitframe."],
959 type = "toggle",
960 disabled = function() return not E.db.unitframe.units[groupName].infoPanel or not E.db.unitframe.units[groupName].infoPanel.enable end,
961 },
962 iconSettings = {
963 order = 13,
964 type = "group",
965 name = L["Icon"],
966 guiInline = true,
967 get = function(info) return E.db.unitframe.units[groupName].castbar[info[#info]] end,
968 set = function(info, value) E.db.unitframe.units[groupName].castbar[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
969 args = {
970 icon = {
971 order = 1,
972 name = L["Enable"],
973 type = 'toggle',
974 },
975 iconAttached = {
976 order = 2,
977 name = L["Icon Inside Castbar"],
978 desc = L["Display the castbar icon inside the castbar."],
979 type = "toggle",
980 },
981 iconSize = {
982 order = 3,
983 name = L["Icon Size"],
984 desc = L["This dictates the size of the icon when it is not attached to the castbar."],
985 type = "range",
986 disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
987 min = 8, max = 150, step = 1,
988 },
989 iconAttachedTo = {
990 order = 4,
991 type = "select",
992 name = L["Attach To"],
993 disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
994 values = {
995 ["Frame"] = L["Frame"],
996 ["Castbar"] = L["Castbar"],
997 },
998 },
999 iconPosition = {
1000 type = 'select',
1001 order = 5,
1002 name = L["Position"],
1003 values = positionValues,
1004 disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
1005 },
1006 iconXOffset = {
1007 order = 5,
1008 type = "range",
1009 name = L["xOffset"],
1010 min = -300, max = 300, step = 1,
1011 disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
1012 },
1013 iconYOffset = {
1014 order = 6,
1015 type = "range",
1016 name = L["yOffset"],
1017 min = -300, max = 300, step = 1,
1018 disabled = function() return E.db.unitframe.units[groupName].castbar.iconAttached end,
1019 },
1020 },
1021 },
1022 timeToHold = {
1023 order = 8,
1024 name = L["Time To Hold"],
1025 desc = L["How many seconds the castbar should stay visible after the cast failed or was interrupted."],
1026 type = "range",
1027 min = 0, max = 10, step = .1,
1028 },
1029 strataAndLevel = {
1030 order = 9,
1031 type = "group",
1032 name = L["Strata and Level"],
1033 get = function(info) return E.db.unitframe.units[groupName].castbar.strataAndLevel[info[#info]] end,
1034 set = function(info, value) E.db.unitframe.units[groupName].castbar.strataAndLevel[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1035 guiInline = true,
1036 args = {
1037 useCustomStrata = {
1038 order = 1,
1039 type = "toggle",
1040 name = L["Use Custom Strata"],
1041 },
1042 frameStrata = {
1043 order = 2,
1044 type = "select",
1045 name = L["Frame Strata"],
1046 values = {
1047 ["BACKGROUND"] = "BACKGROUND",
1048 ["LOW"] = "LOW",
1049 ["MEDIUM"] = "MEDIUM",
1050 ["HIGH"] = "HIGH",
1051 ["DIALOG"] = "DIALOG",
1052 ["TOOLTIP"] = "TOOLTIP",
1053 },
1054 },
1055 spacer = {
1056 order = 3,
1057 type = "description",
1058 name = "",
1059 },
1060 useCustomLevel = {
1061 order = 4,
1062 type = "toggle",
1063 name = L["Use Custom Level"],
1064 },
1065 frameLevel = {
1066 order = 5,
1067 type = "range",
1068 name = L["Frame Level"],
1069 min = 2, max = 128, step = 1,
1070 },
1071 },
1072 }
1073 },
1074 }
1075
1076
1077 if hasTicks then
1078 config.args.displayTarget = {
1079 order = 11,
1080 type = 'toggle',
1081 name = L["Display Target"],
1082 desc = L["Display the target of your current cast. Useful for mouseover casts."],
1083 }
1084 config.args.ticks = {
1085 order = 12,
1086 type = "group",
1087 guiInline = true,
1088 name = L["Ticks"],
1089 args = {
1090 ticks = {
1091 order = 1,
1092 type = 'toggle',
1093 name = L["Ticks"],
1094 desc = L["Display tick marks on the castbar for channelled spells. This will adjust automatically for spells like Drain Soul and add additional ticks based on haste."],
1095 },
1096 tickColor = {
1097 order = 2,
1098 type = "color",
1099 name = L["COLOR"],
1100 hasAlpha = true,
1101 get = function(info)
1102 local c = E.db.unitframe.units[groupName].castbar.tickColor
1103 local d = P.unitframe.units[groupName].castbar.tickColor
1104 return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
1105 end,
1106 set = function(info, r, g, b, a)
1107 local c = E.db.unitframe.units[groupName].castbar.tickColor
1108 c.r, c.g, c.b, c.a = r, g, b, a
1109 updateFunc(UF, groupName, numUnits)
1110 end,
1111 },
1112 tickWidth = {
1113 order = 3,
1114 type = "range",
1115 name = L["Width"],
1116 min = 1, max = 20, step = 1,
1117 },
1118 },
1119 }
1120 end
1121
1122 return config
1123end
1124
1125
1126local function GetOptionsTable_InformationPanel(updateFunc, groupName, numUnits)
1127
1128 local config = {
1129 order = 4000,
1130 type = 'group',
1131 name = L["Information Panel"],
1132 get = function(info) return E.db.unitframe.units[groupName].infoPanel[info[#info]] end,
1133 set = function(info, value) E.db.unitframe.units[groupName].infoPanel[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1134 args = {
1135 header = {
1136 order = 1,
1137 type = "header",
1138 name = L["Information Panel"],
1139 },
1140 enable = {
1141 type = 'toggle',
1142 order = 2,
1143 name = L["Enable"],
1144 },
1145 transparent = {
1146 type = "toggle",
1147 order = 3,
1148 name = L["Transparent"],
1149 },
1150 height = {
1151 type = 'range',
1152 order = 4,
1153 name = L["Height"],
1154 min = 4, max = 30, step = 1,
1155 },
1156 }
1157 }
1158
1159 return config
1160end
1161
1162local function GetOptionsTable_Health(isGroupFrame, updateFunc, groupName, numUnits)
1163 local config = {
1164 order = 100,
1165 type = 'group',
1166 name = L["Health"],
1167 get = function(info) return E.db.unitframe.units[groupName].health[info[#info]] end,
1168 set = function(info, value) E.db.unitframe.units[groupName].health[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1169 args = {
1170 header = {
1171 order = 0,
1172 type = "header",
1173 name = L["Health"],
1174 },
1175 position = {
1176 type = 'select',
1177 order = 1,
1178 name = L["Text Position"],
1179 values = positionValues,
1180 },
1181 xOffset = {
1182 order = 2,
1183 type = 'range',
1184 name = L["Text xOffset"],
1185 desc = L["Offset position for text."],
1186 min = -300, max = 300, step = 1,
1187 },
1188 yOffset = {
1189 order = 3,
1190 type = 'range',
1191 name = L["Text yOffset"],
1192 desc = L["Offset position for text."],
1193 min = -300, max = 300, step = 1,
1194 },
1195 reverseFill = {
1196 type = "toggle",
1197 order = 4,
1198 name = L["Reverse Fill"],
1199 },
1200 attachTextTo = {
1201 type = 'select',
1202 order = 5,
1203 name = L["Attach Text To"],
1204 values = attachToValues,
1205 },
1206 bgUseBarTexture = {
1207 type = "toggle",
1208 order = 6,
1209 name = L["Use Health Texture on Background"],
1210 },
1211 configureButton = {
1212 order = 7,
1213 name = L["Coloring"],
1214 desc = L["This opens the UnitFrames Color settings. These settings affect all unitframes."],
1215 type = 'execute',
1216 func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup", "healthGroup") end,
1217 },
1218 text_format = {
1219 order = 10,
1220 name = L["Text Format"],
1221 type = 'input',
1222 width = 'full',
1223 desc = L["TEXT_FORMAT_DESC"],
1224 },
1225 },
1226 }
1227
1228 if isGroupFrame then
1229 config.args.frequentUpdates = {
1230 type = 'toggle',
1231 order = 8,
1232 name = L["Frequent Updates"],
1233 desc = L["Rapidly update the health, uses more memory and cpu. Only recommended for healing."],
1234 }
1235
1236 config.args.orientation = {
1237 type = 'select',
1238 order = 9,
1239 name = L["Statusbar Fill Orientation"],
1240 desc = L["Direction the health bar moves when gaining/losing health."],
1241 values = {
1242 ['HORIZONTAL'] = L["Horizontal"],
1243 ['VERTICAL'] = L["Vertical"],
1244 },
1245 }
1246 end
1247
1248 return config
1249end
1250
1251local function CreateCustomTextGroup(unit, objectName)
1252 if not E.Options.args.unitframe.args[unit] then
1253 return
1254 elseif E.Options.args.unitframe.args[unit].args.customText.args[objectName] then
1255 E.Options.args.unitframe.args[unit].args.customText.args[objectName].hidden = false -- Re-show existing custom texts which belong to current profile and were previously hidden
1256 tinsert(CUSTOMTEXT_CONFIGS, E.Options.args.unitframe.args[unit].args.customText.args[objectName]) --Register this custom text config to be hidden again on profile change
1257 return
1258 end
1259
1260 E.Options.args.unitframe.args[unit].args.customText.args[objectName] = {
1261 order = -1,
1262 type = 'group',
1263 name = objectName,
1264 get = function(info) return E.db.unitframe.units[unit].customTexts[objectName][info[#info]] end,
1265 set = function(info, value)
1266 E.db.unitframe.units[unit].customTexts[objectName][info[#info]] = value;
1267
1268 if unit == 'party' or unit:find('raid') then
1269 UF:CreateAndUpdateHeaderGroup(unit)
1270 else
1271 UF:CreateAndUpdateUF(unit)
1272 end
1273 end,
1274 args = {
1275 header = {
1276 order = 1,
1277 type = "header",
1278 name = objectName,
1279 },
1280 delete = {
1281 type = 'execute',
1282 order = 2,
1283 name = L["DELETE"],
1284 func = function()
1285 E.Options.args.unitframe.args[unit].args.customText.args[objectName] = nil;
1286 E.db.unitframe.units[unit].customTexts[objectName] = nil;
1287
1288 if unit == 'party' or unit:find('raid') then
1289 for i=1, UF[unit]:GetNumChildren() do
1290 local child = select(i, UF[unit]:GetChildren())
1291 if child.Untag then
1292 child:Untag(child.customTexts[objectName]);
1293 child.customTexts[objectName]:Hide();
1294 child.customTexts[objectName] = nil
1295 else
1296 for x=1, child:GetNumChildren() do
1297 local c2 = select(x, child:GetChildren())
1298 if(c2.Untag) then
1299 c2:Untag(c2.customTexts[objectName]);
1300 c2.customTexts[objectName]:Hide();
1301 c2.customTexts[objectName] = nil
1302 end
1303 end
1304 end
1305 end
1306 elseif UF[unit] then
1307 UF[unit]:Untag(UF[unit].customTexts[objectName]);
1308 UF[unit].customTexts[objectName]:Hide();
1309 UF[unit].customTexts[objectName] = nil
1310 end
1311 end,
1312 },
1313 enable = {
1314 order = 3,
1315 type = "toggle",
1316 name = L["Enable"],
1317 },
1318 font = {
1319 type = "select", dialogControl = 'LSM30_Font',
1320 order = 4,
1321 name = L["Font"],
1322 values = _G.AceGUIWidgetLSMlists.font,
1323 },
1324 size = {
1325 order = 5,
1326 name = L["FONT_SIZE"],
1327 type = "range",
1328 min = 4, max = 212, step = 1,
1329 },
1330 fontOutline = {
1331 order = 6,
1332 name = L["Font Outline"],
1333 desc = L["Set the font outline."],
1334 type = "select",
1335 values = C.Values.FontFlags,
1336 },
1337 justifyH = {
1338 order = 7,
1339 type = 'select',
1340 name = L["JustifyH"],
1341 desc = L["Sets the font instance's horizontal text alignment style."],
1342 values = {
1343 ['CENTER'] = L["Center"],
1344 ['LEFT'] = L["Left"],
1345 ['RIGHT'] = L["Right"],
1346 },
1347 },
1348 xOffset = {
1349 order = 8,
1350 type = 'range',
1351 name = L["xOffset"],
1352 min = -400, max = 400, step = 1,
1353 },
1354 yOffset = {
1355 order = 9,
1356 type = 'range',
1357 name = L["yOffset"],
1358 min = -400, max = 400, step = 1,
1359 },
1360 attachTextTo = {
1361 type = 'select',
1362 order = 10,
1363 name = L["Attach Text To"],
1364 values = attachToValues,
1365 },
1366 text_format = {
1367 order = 100,
1368 name = L["Text Format"],
1369 type = 'input',
1370 width = 'full',
1371 desc = L["TEXT_FORMAT_DESC"],
1372 },
1373 },
1374 }
1375
1376 tinsert(CUSTOMTEXT_CONFIGS, E.Options.args.unitframe.args[unit].args.customText.args[objectName]) --Register this custom text config to be hidden on profile change
1377end
1378
1379local function GetOptionsTable_CustomText(updateFunc, groupName, numUnits)
1380 local config = {
1381 order = 5100,
1382 type = "group",
1383 name = L["Custom Texts"],
1384 args = {
1385 header = {
1386 order = 1,
1387 type = "header",
1388 name = L["Custom Texts"],
1389 },
1390 createCustomText = {
1391 order = 2,
1392 type = 'input',
1393 name = L["Create Custom Text"],
1394 width = 'full',
1395 get = function() return '' end,
1396 set = function(info, textName)
1397 for object in pairs(E.db.unitframe.units[groupName]) do
1398 if object:lower() == textName:lower() then
1399 E:Print(L["The name you have selected is already in use by another element."])
1400 return
1401 end
1402 end
1403
1404 if not E.db.unitframe.units[groupName].customTexts then
1405 E.db.unitframe.units[groupName].customTexts = {};
1406 end
1407
1408 local frameName = "ElvUF_"..E:StringTitle(groupName)
1409 if E.db.unitframe.units[groupName].customTexts[textName] or (_G[frameName] and _G[frameName].customTexts and _G[frameName].customTexts[textName] or _G[frameName.."Group1UnitButton1"] and _G[frameName.."Group1UnitButton1"].customTexts and _G[frameName.."Group1UnitButton1"][textName]) then
1410 E:Print(L["The name you have selected is already in use by another element."])
1411 return;
1412 end
1413
1414 E.db.unitframe.units[groupName].customTexts[textName] = {
1415 ['text_format'] = '',
1416 ['size'] = E.db.unitframe.fontSize,
1417 ['font'] = E.db.unitframe.font,
1418 ['xOffset'] = 0,
1419 ['yOffset'] = 0,
1420 ['justifyH'] = 'CENTER',
1421 ['fontOutline'] = E.db.unitframe.fontOutline,
1422 ['attachTextTo'] = 'Health'
1423 };
1424
1425 CreateCustomTextGroup(groupName, textName)
1426 updateFunc(UF, groupName, numUnits)
1427 end,
1428 },
1429 },
1430 }
1431
1432 return config
1433end
1434
1435local function GetOptionsTable_Name(updateFunc, groupName, numUnits)
1436 local config = {
1437 order = 400,
1438 type = 'group',
1439 name = L["Name"],
1440 get = function(info) return E.db.unitframe.units[groupName].name[info[#info]] end,
1441 set = function(info, value) E.db.unitframe.units[groupName].name[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1442 args = {
1443 header = {
1444 order = 1,
1445 type = "header",
1446 name = L["Name"],
1447 },
1448 position = {
1449 type = 'select',
1450 order = 2,
1451 name = L["Text Position"],
1452 values = positionValues,
1453 },
1454 xOffset = {
1455 order = 3,
1456 type = 'range',
1457 name = L["Text xOffset"],
1458 desc = L["Offset position for text."],
1459 min = -300, max = 300, step = 1,
1460 },
1461 yOffset = {
1462 order = 4,
1463 type = 'range',
1464 name = L["Text yOffset"],
1465 desc = L["Offset position for text."],
1466 min = -300, max = 300, step = 1,
1467 },
1468 attachTextTo = {
1469 type = 'select',
1470 order = 5,
1471 name = L["Attach Text To"],
1472 values = attachToValues,
1473 },
1474 text_format = {
1475 order = 100,
1476 name = L["Text Format"],
1477 type = 'input',
1478 width = 'full',
1479 desc = L["TEXT_FORMAT_DESC"],
1480 },
1481 },
1482 }
1483
1484 return config
1485end
1486
1487local function GetOptionsTable_Portrait(updateFunc, groupName, numUnits)
1488 local config = {
1489 order = 400,
1490 type = 'group',
1491 name = L["Portrait"],
1492 get = function(info) return E.db.unitframe.units[groupName].portrait[info[#info]] end,
1493 set = function(info, value) E.db.unitframe.units[groupName].portrait[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1494 args = {
1495 header = {
1496 order = 1,
1497 type = "header",
1498 name = L["Portrait"],
1499 },
1500 enable = {
1501 type = 'toggle',
1502 order = 2,
1503 name = L["Enable"],
1504 desc = L["If you have a lot of 3D Portraits active then it will likely have a big impact on your FPS. Disable some portraits if you experience FPS issues."],
1505 confirmText = L["If you have a lot of 3D Portraits active then it will likely have a big impact on your FPS. Disable some portraits if you experience FPS issues."],
1506 confirm = true,
1507 },
1508 overlay = {
1509 order = 3,
1510 type = 'toggle',
1511 name = L["Overlay"],
1512 desc = L["The Portrait will overlay the Healthbar. This will be automatically happen if the Frame Orientation is set to Middle."],
1513 },
1514 fullOverlay = {
1515 order = 4,
1516 type = 'toggle',
1517 name = L["Full Overlay"],
1518 desc = L["This option allows the overlay to span the whole health, including the background."],
1519 disabled = function() return not E.db.unitframe.units[groupName].portrait.overlay end,
1520 },
1521 style = {
1522 order = 5,
1523 type = 'select',
1524 name = L["Style"],
1525 desc = L["Select the display method of the portrait."],
1526 values = {
1527 ['2D'] = L["2D"],
1528 ['3D'] = L["3D"],
1529 },
1530 },
1531 width = {
1532 order = 6,
1533 type = 'range',
1534 name = L["Width"],
1535 min = 15, max = 150, step = 1,
1536 disabled = function() return E.db.unitframe.units[groupName].portrait.overlay or (E.db.unitframe.units[groupName].portrait.style ~= '2D') end,
1537 },
1538 rotation = {
1539 order = 7,
1540 type = 'range',
1541 name = L["Model Rotation"],
1542 min = 0, max = 360, step = 1,
1543 disabled = function() return E.db.unitframe.units[groupName].portrait.style ~= '3D' end,
1544 },
1545 camDistanceScale = {
1546 order = 8,
1547 type = 'range',
1548 name = L["Camera Distance Scale"],
1549 desc = L["How far away the portrait is from the camera."],
1550 min = 0.01, max = 4, step = 0.01,
1551 disabled = function() return E.db.unitframe.units[groupName].portrait.style ~= '3D' end,
1552 },
1553 xOffset = {
1554 order = 9,
1555 type = "range",
1556 name = L["xOffset"],
1557 desc = L["Position the Model horizontally."],
1558 min = -1, max = 1, step = 0.01,
1559 disabled = function() return E.db.unitframe.units[groupName].portrait.style ~= '3D' end,
1560 },
1561 yOffset = {
1562 order = 10,
1563 type = "range",
1564 name = L["yOffset"],
1565 desc = L["Position the Model vertically."],
1566 min = -1, max = 1, step = 0.01,
1567 disabled = function() return E.db.unitframe.units[groupName].portrait.style ~= '3D' end,
1568 },
1569 overlayAlpha = {
1570 order = 11,
1571 type = "range",
1572 name = L["Overlay Alpha"],
1573 desc = L["Set the alpha level of portrait when frame is overlayed."],
1574 min = 0.01, max = 1, step = 0.01,
1575 disabled = function() return E.db.unitframe.units[groupName].portrait.overlay == false end,
1576 },
1577 },
1578 }
1579
1580 return config
1581end
1582
1583local function GetOptionsTable_Power(hasDetatchOption, updateFunc, groupName, numUnits, hasStrataLevel)
1584 local config = {
1585 order = 200,
1586 type = 'group',
1587 name = L["Power"],
1588 get = function(info) return E.db.unitframe.units[groupName].power[info[#info]] end,
1589 set = function(info, value) E.db.unitframe.units[groupName].power[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1590 args = {
1591 header = {
1592 order = 0,
1593 type = "header",
1594 name = L["Power"],
1595 },
1596 enable = {
1597 type = 'toggle',
1598 order = 1,
1599 name = L["Enable"],
1600 },
1601 powerPrediction = {
1602 type = 'toggle',
1603 order = 2,
1604 name = L["Power Prediction"],
1605 },
1606 text_format = {
1607 order = 100,
1608 name = L["Text Format"],
1609 type = 'input',
1610 width = 'full',
1611 desc = L["TEXT_FORMAT_DESC"],
1612 },
1613 width = {
1614 type = 'select',
1615 order = 3,
1616 name = L["Style"],
1617 values = {
1618 ['fill'] = L["Filled"],
1619 ['spaced'] = L["Spaced"],
1620 ['inset'] = L["Inset"]
1621 },
1622 set = function(info, value)
1623 E.db.unitframe.units[groupName].power[info[#info]] = value;
1624
1625 local frameName = E:StringTitle(groupName)
1626 frameName = "ElvUF_"..frameName
1627 frameName = frameName:gsub('t(arget)', 'T%1')
1628
1629 if numUnits then
1630 for i=1, numUnits do
1631 if _G[frameName..i] then
1632 local min, max = _G[frameName..i].Power:GetMinMaxValues()
1633 _G[frameName..i].Power:SetMinMaxValues(min, max+500)
1634 _G[frameName..i].Power:SetValue(1)
1635 _G[frameName..i].Power:SetValue(0)
1636 end
1637 end
1638 else
1639 if _G[frameName] and _G[frameName].Power then
1640 local min, max = _G[frameName].Power:GetMinMaxValues()
1641 _G[frameName].Power:SetMinMaxValues(min, max+500)
1642 _G[frameName].Power:SetValue(1)
1643 _G[frameName].Power:SetValue(0)
1644 else
1645 for i=1, _G[frameName]:GetNumChildren() do
1646 local child = select(i, _G[frameName]:GetChildren())
1647 if child and child.Power then
1648 local min, max = child.Power:GetMinMaxValues()
1649 child.Power:SetMinMaxValues(min, max+500)
1650 child.Power:SetValue(1)
1651 child.Power:SetValue(0)
1652 end
1653 end
1654 end
1655 end
1656
1657 updateFunc(UF, groupName, numUnits)
1658 end,
1659 },
1660 height = {
1661 type = 'range',
1662 name = L["Height"],
1663 order = 4,
1664 min = ((E.db.unitframe.thinBorders or E.PixelMode) and 3 or 7), max = 50, step = 1,
1665 },
1666 offset = {
1667 type = 'range',
1668 name = L["Offset"],
1669 desc = L["Offset of the powerbar to the healthbar, set to 0 to disable."],
1670 order = 5,
1671 min = 0, max = 20, step = 1,
1672 },
1673 configureButton = {
1674 order = 6,
1675 name = L["Coloring"],
1676 desc = L["This opens the UnitFrames Color settings. These settings affect all unitframes."],
1677 type = 'execute',
1678 func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup", "powerGroup") end,
1679 },
1680 reverseFill = {
1681 type = "toggle",
1682 order = 7,
1683 name = L["Reverse Fill"],
1684 },
1685 position = {
1686 type = 'select',
1687 order = 8,
1688 name = L["Text Position"],
1689 values = positionValues,
1690 },
1691 xOffset = {
1692 order = 9,
1693 type = 'range',
1694 name = L["Text xOffset"],
1695 desc = L["Offset position for text."],
1696 min = -300, max = 300, step = 1,
1697 },
1698 yOffset = {
1699 order = 10,
1700 type = 'range',
1701 name = L["Text yOffset"],
1702 desc = L["Offset position for text."],
1703 min = -300, max = 300, step = 1,
1704 },
1705 attachTextTo = {
1706 type = 'select',
1707 order = 11,
1708 name = L["Attach Text To"],
1709 values = attachToValues,
1710 },
1711 },
1712 }
1713
1714 if hasDetatchOption then
1715 config.args.detachFromFrame = {
1716 type = 'toggle',
1717 order = 11,
1718 name = L["Detach From Frame"],
1719 }
1720 config.args.detachedWidth = {
1721 type = 'range',
1722 order = 12,
1723 name = L["Detached Width"],
1724 disabled = function() return not E.db.unitframe.units[groupName].power.detachFromFrame end,
1725 min = 15, max = 1000, step = 1,
1726 }
1727 config.args.parent = {
1728 type = 'select',
1729 order = 13,
1730 name = L["Parent"],
1731 desc = L["Choose UIPARENT to prevent it from hiding with the unitframe."],
1732 disabled = function() return not E.db.unitframe.units[groupName].power.detachFromFrame end,
1733 values = {
1734 ["FRAME"] = "FRAME",
1735 ["UIPARENT"] = "UIPARENT",
1736 },
1737 }
1738 end
1739
1740 if hasStrataLevel then
1741 config.args.strataAndLevel = {
1742 order = 101,
1743 type = "group",
1744 name = L["Strata and Level"],
1745 get = function(info) return E.db.unitframe.units[groupName].power.strataAndLevel[info[#info]] end,
1746 set = function(info, value) E.db.unitframe.units[groupName].power.strataAndLevel[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1747 guiInline = true,
1748 args = {
1749 useCustomStrata = {
1750 order = 1,
1751 type = "toggle",
1752 name = L["Use Custom Strata"],
1753 },
1754 frameStrata = {
1755 order = 2,
1756 type = "select",
1757 name = L["Frame Strata"],
1758 values = {
1759 ["BACKGROUND"] = "BACKGROUND",
1760 ["LOW"] = "LOW",
1761 ["MEDIUM"] = "MEDIUM",
1762 ["HIGH"] = "HIGH",
1763 ["DIALOG"] = "DIALOG",
1764 ["TOOLTIP"] = "TOOLTIP",
1765 },
1766 },
1767 spacer = {
1768 order = 3,
1769 type = "description",
1770 name = "",
1771 },
1772 useCustomLevel = {
1773 order = 4,
1774 type = "toggle",
1775 name = L["Use Custom Level"],
1776 },
1777 frameLevel = {
1778 order = 5,
1779 type = "range",
1780 name = L["Frame Level"],
1781 min = 2, max = 128, step = 1,
1782 },
1783 },
1784 }
1785 end
1786
1787 return config
1788end
1789
1790local function GetOptionsTable_RaidIcon(updateFunc, groupName, numUnits)
1791 local config = {
1792 order = 5000,
1793 type = 'group',
1794 name = L["Raid Icon"],
1795 get = function(info) return E.db.unitframe.units[groupName].raidicon[info[#info]] end,
1796 set = function(info, value) E.db.unitframe.units[groupName].raidicon[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1797 args = {
1798 header = {
1799 order = 1,
1800 type = "header",
1801 name = L["Raid Icon"],
1802 },
1803 enable = {
1804 type = 'toggle',
1805 order = 2,
1806 name = L["Enable"],
1807 },
1808 attachTo = {
1809 type = 'select',
1810 order = 3,
1811 name = L["Position"],
1812 values = positionValues,
1813 },
1814 attachToObject = {
1815 type = 'select',
1816 order = 4,
1817 name = L["Attach To"],
1818 values = attachToValues,
1819 },
1820 size = {
1821 type = 'range',
1822 name = L["Size"],
1823 order = 4,
1824 min = 8, max = 60, step = 1,
1825 },
1826 xOffset = {
1827 order = 5,
1828 type = 'range',
1829 name = L["xOffset"],
1830 min = -300, max = 300, step = 1,
1831 },
1832 yOffset = {
1833 order = 6,
1834 type = 'range',
1835 name = L["yOffset"],
1836 min = -300, max = 300, step = 1,
1837 },
1838 },
1839 }
1840
1841 return config
1842end
1843
1844local function GetOptionsTable_ResurrectIcon(updateFunc, groupName, numUnits)
1845 local config = {
1846 order = 5001,
1847 type = 'group',
1848 name = L["Resurrect Icon"],
1849 get = function(info) return E.db.unitframe.units[groupName].resurrectIcon[info[#info]] end,
1850 set = function(info, value) E.db.unitframe.units[groupName].resurrectIcon[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1851 args = {
1852 header = {
1853 order = 1,
1854 type = "header",
1855 name = L["Resurrect Icon"],
1856 },
1857 enable = {
1858 type = 'toggle',
1859 order = 2,
1860 name = L["Enable"],
1861 },
1862 attachTo = {
1863 type = 'select',
1864 order = 3,
1865 name = L["Position"],
1866 values = positionValues,
1867 },
1868 attachToObject = {
1869 type = 'select',
1870 order = 4,
1871 name = L["Attach To"],
1872 values = attachToValues,
1873 },
1874 size = {
1875 order = 5,
1876 type = 'range',
1877 name = L["Size"],
1878 min = 8, max = 60, step = 1,
1879 },
1880 xOffset = {
1881 order = 6,
1882 type = 'range',
1883 name = L["xOffset"],
1884 min = -300, max = 300, step = 1,
1885 },
1886 yOffset = {
1887 order = 7,
1888 type = 'range',
1889 name = L["yOffset"],
1890 min = -300, max = 300, step = 1,
1891 },
1892 },
1893 }
1894
1895 return config
1896end
1897
1898local function GetOptionsTable_SummonIcon(updateFunc, groupName, numUnits)
1899 local config = {
1900 order = 5002,
1901 type = 'group',
1902 name = L["Summon Icon"],
1903 get = function(info) return E.db.unitframe.units[groupName].summonIcon[info[#info]] end,
1904 set = function(info, value) E.db.unitframe.units[groupName].summonIcon[info[#info]] = value; updateFunc(UF, groupName, numUnits) end,
1905 args = {
1906 header = {
1907 order = 1,
1908 type = "header",
1909 name = L["Summon Icon"],
1910 },
1911 enable = {
1912 type = 'toggle',
1913 order = 2,
1914 name = L["Enable"],
1915 },
1916 attachTo = {
1917 type = 'select',
1918 order = 3,
1919 name = L["Position"],
1920 values = positionValues,
1921 },
1922 attachToObject = {
1923 type = 'select',
1924 order = 4,
1925 name = L["Attach To"],
1926 values = attachToValues,
1927 },
1928 size = {
1929 order = 5,
1930 type = 'range',
1931 name = L["Size"],
1932 min = 8, max = 60, step = 1,
1933 },
1934 xOffset = {
1935 order = 6,
1936 type = 'range',
1937 name = L["xOffset"],
1938 min = -300, max = 300, step = 1,
1939 },
1940 yOffset = {
1941 order = 7,
1942 type = 'range',
1943 name = L["yOffset"],
1944 min = -300, max = 300, step = 1,
1945 },
1946 },
1947 }
1948
1949 return config
1950end
1951
1952local function GetOptionsTable_RaidDebuff(updateFunc, groupName)
1953 local config = {
1954 order = 800,
1955 type = 'group',
1956 name = L["RaidDebuff Indicator"],
1957 get = function(info) return E.db.unitframe.units[groupName].rdebuffs[info[#info]] end,
1958 set = function(info, value) E.db.unitframe.units[groupName].rdebuffs[info[#info]] = value; updateFunc(UF, groupName) end,
1959 args = {
1960 header = {
1961 order = 1,
1962 type = "header",
1963 name = L["RaidDebuff Indicator"],
1964 },
1965 enable = {
1966 order = 2,
1967 type = 'toggle',
1968 name = L["Enable"],
1969 },
1970 showDispellableDebuff = {
1971 order = 3,
1972 type = "toggle",
1973 name = L["Show Dispellable Debuffs"],
1974 },
1975 onlyMatchSpellID = {
1976 order = 4,
1977 type = "toggle",
1978 name = L["Only Match SpellID"],
1979 desc = L["When enabled it will only show spells that were added to the filter using a spell ID and not a name."],
1980 },
1981 size = {
1982 order = 4,
1983 type = 'range',
1984 name = L["Size"],
1985 min = 8, max = 100, step = 1,
1986 },
1987 font = {
1988 order = 5,
1989 type = "select", dialogControl = "LSM30_Font",
1990 name = L["Font"],
1991 values = _G.AceGUIWidgetLSMlists.font,
1992 },
1993 fontSize = {
1994 order = 6,
1995 type = 'range',
1996 name = L["FONT_SIZE"],
1997 min = 7, max = 212, step = 1,
1998 },
1999 fontOutline = {
2000 order = 7,
2001 type = "select",
2002 name = L["Font Outline"],
2003 values = C.Values.FontFlags,
2004 },
2005 xOffset = {
2006 order = 8,
2007 type = 'range',
2008 name = L["xOffset"],
2009 min = -300, max = 300, step = 1,
2010 },
2011 yOffset = {
2012 order = 9,
2013 type = 'range',
2014 name = L["yOffset"],
2015 min = -300, max = 300, step = 1,
2016 },
2017 configureButton = {
2018 order = 10,
2019 type = 'execute',
2020 name = L["Configure Auras"],
2021 func = function() E:SetToFilterConfig('RaidDebuffs') end,
2022 },
2023 duration = {
2024 order = 11,
2025 type = "group",
2026 guiInline = true,
2027 name = L["Duration Text"],
2028 get = function(info) return E.db.unitframe.units[groupName].rdebuffs.duration[info[#info]] end,
2029 set = function(info, value) E.db.unitframe.units[groupName].rdebuffs.duration[info[#info]] = value; updateFunc(UF, groupName) end,
2030 args = {
2031 position = {
2032 order = 1,
2033 type = "select",
2034 name = L["Position"],
2035 values = positionValues,
2036 },
2037 xOffset = {
2038 order = 2,
2039 type = "range",
2040 name = L["xOffset"],
2041 min = -10, max = 10, step = 1,
2042 },
2043 yOffset = {
2044 order = 3,
2045 type = "range",
2046 name = L["yOffset"],
2047 min = -10, max = 10, step = 1,
2048 },
2049 color = {
2050 order = 4,
2051 type = "color",
2052 name = L["COLOR"],
2053 hasAlpha = true,
2054 get = function(info)
2055 local c = E.db.unitframe.units.raid.rdebuffs.duration.color
2056 local d = P.unitframe.units.raid.rdebuffs.duration.color
2057 return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
2058 end,
2059 set = function(info, r, g, b, a)
2060 local c = E.db.unitframe.units.raid.rdebuffs.duration.color
2061 c.r, c.g, c.b, c.a = r, g, b, a
2062 UF:CreateAndUpdateHeaderGroup('raid')
2063 end,
2064 },
2065 },
2066 },
2067 stack = {
2068 order = 12,
2069 type = "group",
2070 guiInline = true,
2071 name = L["Stack Counter"],
2072 get = function(info) return E.db.unitframe.units[groupName].rdebuffs.stack[info[#info]] end,
2073 set = function(info, value) E.db.unitframe.units[groupName].rdebuffs.stack[info[#info]] = value; updateFunc(UF, groupName) end,
2074 args = {
2075 position = {
2076 order = 1,
2077 type = "select",
2078 name = L["Position"],
2079 values = positionValues,
2080 },
2081 xOffset = {
2082 order = 2,
2083 type = "range",
2084 name = L["xOffset"],
2085 min = -10, max = 10, step = 1,
2086 },
2087 yOffset = {
2088 order = 3,
2089 type = "range",
2090 name = L["yOffset"],
2091 min = -10, max = 10, step = 1,
2092 },
2093 color = {
2094 order = 4,
2095 type = "color",
2096 name = L["COLOR"],
2097 hasAlpha = true,
2098 get = function(info)
2099 local c = E.db.unitframe.units[groupName].rdebuffs.stack.color
2100 local d = P.unitframe.units[groupName].rdebuffs.stack.color
2101 return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
2102 end,
2103 set = function(info, r, g, b, a)
2104 local c = E.db.unitframe.units[groupName].rdebuffs.stack.color
2105 c.r, c.g, c.b, c.a = r, g, b, a
2106 updateFunc(UF, groupName)
2107 end,
2108 },
2109 },
2110 },
2111 },
2112 }
2113
2114 return config
2115end
2116
2117local function GetOptionsTable_ReadyCheckIcon(updateFunc, groupName)
2118 local config = {
2119 order = 900,
2120 type = "group",
2121 name = L["Ready Check Icon"],
2122 get = function(info) return E.db.unitframe.units[groupName].readycheckIcon[info[#info]] end,
2123 set = function(info, value) E.db.unitframe.units[groupName].readycheckIcon[info[#info]] = value; updateFunc(UF, groupName) end,
2124 args = {
2125 header = {
2126 order = 1,
2127 type = "header",
2128 name = L["Ready Check Icon"],
2129 },
2130 enable = {
2131 order = 2,
2132 type = "toggle",
2133 name = L["Enable"],
2134 },
2135 size = {
2136 order = 3,
2137 type = "range",
2138 name = L["Size"],
2139 min = 8, max = 60, step = 1,
2140 },
2141 attachTo = {
2142 order = 4,
2143 type = "select",
2144 name = L["Attach To"],
2145 values = attachToValues,
2146 },
2147 position = {
2148 order = 5,
2149 type = "select",
2150 name = L["Position"],
2151 values = positionValues,
2152 },
2153 xOffset = {
2154 order = 6,
2155 type = "range",
2156 name = L["xOffset"],
2157 min = -300, max = 300, step = 1,
2158 },
2159 yOffset = {
2160 order = 7,
2161 type = "range",
2162 name = L["yOffset"],
2163 min = -300, max = 300, step = 1,
2164 },
2165 },
2166 }
2167
2168 return config
2169end
2170
2171local function GetOptionsTable_HealPrediction(updateFunc, groupName, numGroup)
2172 local config = {
2173 order = 101,
2174 type = "group",
2175 name = L["Heal Prediction"],
2176 desc = L["Show an incoming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."],
2177 get = function(info) return E.db.unitframe.units[groupName].healPrediction[info[#info]] end,
2178 set = function(info, value) E.db.unitframe.units[groupName].healPrediction[info[#info]] = value; updateFunc(UF, groupName, numGroup) end,
2179 args = {
2180 header = {
2181 order = 0,
2182 type = "header",
2183 name = L["Heal Prediction"],
2184 },
2185 enable = {
2186 order = 1,
2187 type = "toggle",
2188 name = L["Enable"],
2189 },
2190 showOverAbsorbs = {
2191 order = 2,
2192 type = "toggle",
2193 name = L["Show Over Absorbs"],
2194 },
2195 showAbsorbAmount = {
2196 order = 3,
2197 type = "toggle",
2198 name = L["Show Absorb Amount"],
2199 disabled = function() return not E.db.unitframe.units[groupName].healPrediction.showOverAbsorbs end,
2200 },
2201 colors = {
2202 order = 4,
2203 type = "execute",
2204 name = L["COLORS"],
2205 buttonElvUI = true,
2206 func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup") end,
2207 disabled = function() return not E.UnitFrames.Initialized end,
2208 },
2209 },
2210 }
2211
2212 return config
2213end
2214
2215local function GetOptionsTable_Cutaway(updateFunc, groupName, numGroup)
2216 local config = {
2217 order = 1021,
2218 type = "group",
2219 childGroups = "tabs",
2220 name = L["Cutaway Bars"],
2221 args = {
2222 health = {
2223 order = 1,
2224 type = "group",
2225 guiInline = true,
2226 name = L["Health"],
2227 get = function(info) return E.db.unitframe.units[groupName].cutaway.health[info[#info]] end,
2228 set = function(info, value) E.db.unitframe.units[groupName].cutaway.health[info[#info]] = value; updateFunc(UF, groupName, numGroup) end,
2229 args = {
2230 enabled = {
2231 type = "toggle",
2232 order = 1,
2233 name = L["Enable"]
2234 },
2235 lengthBeforeFade = {
2236 type = "range",
2237 order = 2,
2238 name = L["Fade Out Delay"],
2239 desc = L["How much time before the cutaway health starts to fade."],
2240 min = 0.1,
2241 max = 1,
2242 step = 0.1,
2243 disabled = function()
2244 return not E.db.unitframe.units[groupName].cutaway.health.enabled
2245 end
2246 },
2247 fadeOutTime = {
2248 type = "range",
2249 order = 3,
2250 name = L["Fade Out"],
2251 desc = L["How long the cutaway health will take to fade out."],
2252 min = 0.1,
2253 max = 1,
2254 step = 0.1,
2255 disabled = function()
2256 return not E.db.unitframe.units[groupName].cutaway.health.enabled
2257 end
2258 }
2259 }
2260 }
2261 }
2262 }
2263 if E.db.unitframe.units[groupName].cutaway.power then
2264 config.args.power = {
2265 order = 2,
2266 type = "group",
2267 name = L["Power"],
2268 guiInline = true,
2269 get = function(info) return E.db.unitframe.units[groupName].cutaway.power[info[#info]] end,
2270 set = function(info, value) E.db.unitframe.units[groupName].cutaway.power[info[#info]] = value; updateFunc(UF, groupName, numGroup) end,
2271 args = {
2272 enabled = {
2273 type = "toggle",
2274 order = 1,
2275 name = L["Enable"]
2276 },
2277 lengthBeforeFade = {
2278 type = "range",
2279 order = 2,
2280 name = L["Fade Out Delay"],
2281 desc = L["How much time before the cutaway power starts to fade."],
2282 min = 0.1,
2283 max = 1,
2284 step = 0.1,
2285 disabled = function()
2286 return not E.db.unitframe.units[groupName].cutaway.power.enabled
2287 end
2288 },
2289 fadeOutTime = {
2290 type = "range",
2291 order = 3,
2292 name = L["Fade Out"],
2293 desc = L["How long the cutaway power will take to fade out."],
2294 min = 0.1,
2295 max = 1,
2296 step = 0.1,
2297 disabled = function()
2298 return not E.db.unitframe.units[groupName].cutaway.power.enabled
2299 end
2300 }
2301 }
2302 }
2303 end
2304
2305 return config
2306end
2307
2308E.Options.args.unitframe = {
2309 type = "group",
2310 name = L["UnitFrames"],
2311 childGroups = "tree",
2312 get = function(info) return E.db.unitframe[info[#info]] end,
2313 set = function(info, value) E.db.unitframe[info[#info]] = value end,
2314 args = {
2315 enable = {
2316 order = 0,
2317 type = "toggle",
2318 name = L["Enable"],
2319 get = function(info) return E.private.unitframe.enable end,
2320 set = function(info, value) E.private.unitframe.enable = value; E:StaticPopup_Show("PRIVATE_RL") end
2321 },
2322 intro = {
2323 order = 1,
2324 type = "description",
2325 name = L["UNITFRAME_DESC"],
2326 },
2327 header = {
2328 order = 2,
2329 type = "header",
2330 name = L["Shortcuts"],
2331 },
2332 spacer1 = {
2333 order = 3,
2334 type = "description",
2335 name = " ",
2336 },
2337 generalShortcut = {
2338 order = 4,
2339 type = "execute",
2340 name = L["General"],
2341 buttonElvUI = true,
2342 func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "generalGroup") end,
2343 disabled = function() return not E.UnitFrames.Initialized end,
2344 },
2345 frameGlowShortcut = {
2346 order = 5,
2347 type = "execute",
2348 name = L["Frame Glow"],
2349 buttonElvUI = true,
2350 func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "frameGlowGroup") end,
2351 disabled = function() return not E.UnitFrames.Initialized end,
2352 },
2353 cooldownShortcut = {
2354 order = 6,
2355 type = "execute",
2356 name = L["Cooldowns"],
2357 buttonElvUI = true,
2358 func = function() ACD:SelectGroup("ElvUI", "cooldown", "unitframe") end,
2359 disabled = function() return not E.UnitFrames.Initialized end,
2360 },
2361 spacer2 = {
2362 order = 7,
2363 type = "description",
2364 name = " ",
2365 },
2366 colorsShortcut = {
2367 order = 8,
2368 type = "execute",
2369 name = L["COLORS"],
2370 buttonElvUI = true,
2371 func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "allColorsGroup") end,
2372 disabled = function() return not E.UnitFrames.Initialized end,
2373 },
2374 blizzardShortcut = {
2375 order = 9,
2376 type = "execute",
2377 name = L["Disabled Blizzard Frames"],
2378 buttonElvUI = true,
2379 func = function() ACD:SelectGroup("ElvUI", "unitframe", "generalOptionsGroup", "disabledBlizzardFrames") end,
2380 disabled = function() return not E.UnitFrames.Initialized end,
2381 },
2382 playerShortcut = {
2383 order = 10,
2384 type = "execute",
2385 name = L["Player"],
2386 buttonElvUI = true,
2387 func = function() ACD:SelectGroup("ElvUI", "unitframe", "player") end,
2388 disabled = function() return not E.UnitFrames.Initialized end,
2389 },
2390 spacer3 = {
2391 order = 11,
2392 type = "description",
2393 name = " ",
2394 },
2395 targetShortcut = {
2396 order = 12,
2397 type = "execute",
2398 name = L["TARGET"],
2399 buttonElvUI = true,
2400 func = function() ACD:SelectGroup("ElvUI", "unitframe", "target") end,
2401 disabled = function() return not E.UnitFrames.Initialized end,
2402 },
2403 targettargetShortcut = {
2404 order = 13,
2405 type = "execute",
2406 name = L["TargetTarget"],
2407 buttonElvUI = true,
2408 func = function() ACD:SelectGroup("ElvUI", "unitframe", "targettarget") end,
2409 disabled = function() return not E.UnitFrames.Initialized end,
2410 },
2411 targettargettargetShortcut = {
2412 order = 14,
2413 type = "execute",
2414 name = L["TargetTargetTarget"],
2415 buttonElvUI = true,
2416 func = function() ACD:SelectGroup("ElvUI", "unitframe", "targettargettarget") end,
2417 disabled = function() return not E.UnitFrames.Initialized end,
2418 },
2419 spacer4 = {
2420 order = 15,
2421 type = "description",
2422 name = " ",
2423 },
2424 petShortcut = {
2425 order = 17,
2426 type = "execute",
2427 name = L["PET"],
2428 buttonElvUI = true,
2429 func = function() ACD:SelectGroup("ElvUI", "unitframe", "pet") end,
2430 disabled = function() return not E.UnitFrames.Initialized end,
2431 },
2432 pettargetShortcut = {
2433 order = 20,
2434 type = "execute",
2435 name = L["PetTarget"],
2436 buttonElvUI = true,
2437 func = function() ACD:SelectGroup("ElvUI", "unitframe", "pettarget") end,
2438 disabled = function() return not E.UnitFrames.Initialized end,
2439 },
2440 spacer6 = {
2441 order = 23,
2442 type = "description",
2443 name = " ",
2444 },
2445 partyShortcut = {
2446 order = 24,
2447 type = "execute",
2448 name = L["PARTY"],
2449 buttonElvUI = true,
2450 func = function() ACD:SelectGroup("ElvUI", "unitframe", "party") end,
2451 disabled = function() return not E.UnitFrames.Initialized end,
2452 },
2453 raidShortcut = {
2454 order = 25,
2455 type = "execute",
2456 name = L["Raid"],
2457 buttonElvUI = true,
2458 func = function() ACD:SelectGroup("ElvUI", "unitframe", "raid") end,
2459 disabled = function() return not E.UnitFrames.Initialized end,
2460 },
2461 raid40Shortcut = {
2462 order = 26,
2463 type = "execute",
2464 name = L["Raid-40"],
2465 buttonElvUI = true,
2466 func = function() ACD:SelectGroup("ElvUI", "unitframe", "raid40") end,
2467 disabled = function() return not E.UnitFrames.Initialized end,
2468 },
2469 spacer7 = {
2470 order = 27,
2471 type = "description",
2472 name = " ",
2473 },
2474 raidpetShortcut = {
2475 order = 28,
2476 type = "execute",
2477 name = L["Raid Pet"],
2478 buttonElvUI = true,
2479 func = function() ACD:SelectGroup("ElvUI", "unitframe", "raidpet") end,
2480 disabled = function() return not E.UnitFrames.Initialized end,
2481 },
2482 assistShortcut = {
2483 order = 29,
2484 type = "execute",
2485 name = L["Assist"],
2486 buttonElvUI = true,
2487 func = function() ACD:SelectGroup("ElvUI", "unitframe", "assist") end,
2488 disabled = function() return not E.UnitFrames.Initialized end,
2489 },
2490 tankShortcut = {
2491 order = 30,
2492 type = "execute",
2493 name = L["TANK"],
2494 buttonElvUI = true,
2495 func = function() ACD:SelectGroup("ElvUI", "unitframe", "tank") end,
2496 disabled = function() return not E.UnitFrames.Initialized end,
2497 },
2498 generalOptionsGroup = {
2499 order = 31,
2500 type = "group",
2501 name = L["General Options"],
2502 childGroups = "tab",
2503 disabled = function() return not E.UnitFrames.Initialized end,
2504 args = {
2505 generalGroup = {
2506 order = 1,
2507 type = 'group',
2508 name = L["General"],
2509 args = {
2510 header = {
2511 order = 0,
2512 type = "header",
2513 name = L["General"],
2514 },
2515 thinBorders = {
2516 order = 1,
2517 name = L["Thin Borders"],
2518 desc = L["Use thin borders on certain unitframe elements."],
2519 type = 'toggle',
2520 disabled = function() return E.private.general.pixelPerfect end,
2521 set = function(info, value) E.db.unitframe[info[#info]] = value; E:StaticPopup_Show("CONFIG_RL") end,
2522 },
2523 smartRaidFilter = {
2524 order = 4,
2525 name = L["Smart Raid Filter"],
2526 desc = L["Override any custom visibility setting in certain situations, EX: Only show groups 1 and 2 inside a 10 man instance."],
2527 type = 'toggle',
2528 set = function(info, value) E.db.unitframe[info[#info]] = value; UF:UpdateAllHeaders() end
2529 },
2530 targetOnMouseDown = {
2531 order = 5,
2532 name = L["Target On Mouse-Down"],
2533 desc = L["Target units on mouse down rather than mouse up. \n\n|cffFF0000Warning: If you are using the addon 'Clique' you may have to adjust your clique settings when changing this."],
2534 type = "toggle",
2535 },
2536 auraBlacklistModifier = {
2537 order = 6,
2538 type = "select",
2539 name = L["Blacklist Modifier"],
2540 desc = L["You need to hold this modifier down in order to blacklist an aura by right-clicking the icon. Set to None to disable the blacklist functionality."],
2541 values = {
2542 ['NONE'] = L["NONE"],
2543 ['SHIFT'] = L["SHIFT_KEY_TEXT"],
2544 ['ALT'] = L["ALT_KEY_TEXT"],
2545 ['CTRL'] = L["CTRL_KEY_TEXT"],
2546 },
2547 },
2548 resetFilters = {
2549 order = 7,
2550 name = L["Reset Aura Filters"],
2551 type = "execute",
2552 func = function(info)
2553 E:StaticPopup_Show("RESET_UF_AF") --reset unitframe aurafilters
2554 end,
2555 },
2556 barGroup = {
2557 order = 20,
2558 type = 'group',
2559 guiInline = true,
2560 name = L["Bars"],
2561 args = {
2562 smoothbars = {
2563 type = 'toggle',
2564 order = 2,
2565 name = L["Smooth Bars"],
2566 desc = L["Bars will transition smoothly."],
2567 set = function(info, value) E.db.unitframe[info[#info]] = value; UF:Update_AllFrames(); end,
2568 },
2569 statusbar = {
2570 type = "select", dialogControl = 'LSM30_Statusbar',
2571 order = 3,
2572 name = L["StatusBar Texture"],
2573 desc = L["Main statusbar texture."],
2574 values = _G.AceGUIWidgetLSMlists.statusbar,
2575 set = function(info, value) E.db.unitframe[info[#info]] = value; UF:Update_StatusBars() end,
2576 },
2577 },
2578 },
2579 fontGroup = {
2580 order = 30,
2581 type = 'group',
2582 guiInline = true,
2583 name = L["Fonts"],
2584 args = {
2585 font = {
2586 type = "select", dialogControl = 'LSM30_Font',
2587 order = 4,
2588 name = L["Default Font"],
2589 desc = L["The font that the unitframes will use."],
2590 values = _G.AceGUIWidgetLSMlists.font,
2591 set = function(info, value) E.db.unitframe[info[#info]] = value; UF:Update_FontStrings() end,
2592 },
2593 fontSize = {
2594 order = 5,
2595 name = L["FONT_SIZE"],
2596 desc = L["Set the font size for unitframes."],
2597 type = "range",
2598 min = 4, max = 212, step = 1,
2599 set = function(info, value) E.db.unitframe[info[#info]] = value; UF:Update_FontStrings() end,
2600 },
2601 fontOutline = {
2602 order = 6,
2603 name = L["Font Outline"],
2604 desc = L["Set the font outline."],
2605 type = "select",
2606 values = C.Values.FontFlags,
2607 set = function(info, value) E.db.unitframe[info[#info]] = value; UF:Update_FontStrings() end,
2608 },
2609 },
2610 },
2611 },
2612 },
2613 frameGlowGroup = {
2614 order = 2,
2615 type = 'group',
2616 childGroups = "tree",
2617 name = L["Frame Glow"],
2618 args = {
2619 header = {
2620 order = 0,
2621 type = "header",
2622 name = L["Frame Glow"],
2623 },
2624 mainGlow = {
2625 order = 1,
2626 type = 'group',
2627 guiInline = true,
2628 name = L["Mouseover Glow"],
2629 get = function(info)
2630 local t = E.db.unitframe.colors.frameGlow.mainGlow[info[#info]]
2631 if type(t) == "boolean" then return t end
2632 local d = P.unitframe.colors.frameGlow.mainGlow[info[#info]]
2633 return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a
2634 end,
2635 set = function(info, r, g, b, a)
2636 local t = E.db.unitframe.colors.frameGlow.mainGlow[info[#info]]
2637 if type(t) == "boolean" then
2638 E.db.unitframe.colors.frameGlow.mainGlow[info[#info]] = r
2639 else
2640 t.r, t.g, t.b, t.a = r, g, b, a
2641 end
2642 UF:FrameGlow_UpdateFrames();
2643 end,
2644 disabled = function() return not E.db.unitframe.colors.frameGlow.mainGlow.enable end,
2645 args = {
2646 enable = {
2647 order = 1,
2648 type = 'toggle',
2649 name = L["Enable"],
2650 disabled = false,
2651 },
2652 spacer = {
2653 order = 2,
2654 type = "description",
2655 name = "",
2656 },
2657 class = {
2658 order = 3,
2659 type = 'toggle',
2660 name = L["Use Class Color"],
2661 desc = L["Alpha channel is taken from the color option."],
2662 },
2663 color = {
2664 order = 4,
2665 name = L["COLOR"],
2666 type = 'color',
2667 hasAlpha = true,
2668 },
2669 }
2670 },
2671 targetGlow = {
2672 order = 3,
2673 type = 'group',
2674 guiInline = true,
2675 name = L["Targeted Glow"],
2676 get = function(info)
2677 local t = E.db.unitframe.colors.frameGlow.targetGlow[info[#info]]
2678 if type(t) == "boolean" then return t end
2679 local d = P.unitframe.colors.frameGlow.targetGlow[info[#info]]
2680 return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a
2681 end,
2682 set = function(info, r, g, b, a)
2683 local t = E.db.unitframe.colors.frameGlow.targetGlow[info[#info]]
2684 if type(t) == "boolean" then
2685 E.db.unitframe.colors.frameGlow.targetGlow[info[#info]] = r
2686 else
2687 t.r, t.g, t.b, t.a = r, g, b, a
2688 end
2689 UF:FrameGlow_UpdateFrames();
2690 end,
2691 disabled = function() return not E.db.unitframe.colors.frameGlow.targetGlow.enable end,
2692 args = {
2693 enable = {
2694 order = 1,
2695 type = 'toggle',
2696 name = L["Enable"],
2697 disabled = false,
2698 },
2699 spacer = {
2700 order = 2,
2701 type = "description",
2702 name = "",
2703 },
2704 class = {
2705 order = 3,
2706 type = 'toggle',
2707 name = L["Use Class Color"],
2708 desc = L["Alpha channel is taken from the color option."],
2709 },
2710 color = {
2711 order = 4,
2712 name = L["COLOR"],
2713 type = 'color',
2714 hasAlpha = true,
2715 },
2716 }
2717 },
2718 mouseoverGlow = {
2719 order = 5,
2720 type = 'group',
2721 guiInline = true,
2722 name = L["Mouseover Highlight"],
2723 get = function(info)
2724 local t = E.db.unitframe.colors.frameGlow.mouseoverGlow[info[#info]]
2725 if type(t) == "boolean" then return t end
2726 local d = P.unitframe.colors.frameGlow.mouseoverGlow[info[#info]]
2727 return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a
2728 end,
2729 set = function(info, r, g, b, a)
2730 local t = E.db.unitframe.colors.frameGlow.mouseoverGlow[info[#info]]
2731 if type(t) == "boolean" then
2732 E.db.unitframe.colors.frameGlow.mouseoverGlow[info[#info]] = r
2733 else
2734 t.r, t.g, t.b, t.a = r, g, b, a
2735 end
2736 UF:FrameGlow_UpdateFrames();
2737 end,
2738 disabled = function() return not E.db.unitframe.colors.frameGlow.mouseoverGlow.enable end,
2739 args = {
2740 enable = {
2741 order = 1,
2742 type = 'toggle',
2743 name = L["Enable"],
2744 disabled = false,
2745 },
2746 texture = {
2747 type = "select",
2748 dialogControl = 'LSM30_Statusbar',
2749 order = 2,
2750 name = L["Texture"],
2751 values = _G.AceGUIWidgetLSMlists.statusbar,
2752 get = function(info)
2753 return E.db.unitframe.colors.frameGlow.mouseoverGlow[info[#info]]
2754 end,
2755 set = function(info, value)
2756 E.db.unitframe.colors.frameGlow.mouseoverGlow[info[#info]] = value;
2757 UF:FrameGlow_UpdateFrames();
2758 end,
2759 },
2760 spacer = {
2761 order = 3,
2762 type = "description",
2763 name = "",
2764 },
2765 class = {
2766 order = 4,
2767 type = 'toggle',
2768 name = L["Use Class Color"],
2769 desc = L["Alpha channel is taken from the color option."],
2770 },
2771 color = {
2772 order = 5,
2773 name = L["COLOR"],
2774 type = 'color',
2775 hasAlpha = true,
2776 },
2777 }
2778 },
2779 }
2780 },
2781 allColorsGroup = {
2782 order = 3,
2783 type = 'group',
2784 childGroups = "tree",
2785 name = L["COLORS"],
2786 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2787 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2788 args = {
2789 header = {
2790 order = 0,
2791 type = "header",
2792 name = L["COLORS"],
2793 },
2794 borderColor = {
2795 order = 1,
2796 type = "color",
2797 name = L["Border Color"],
2798 get = function(info)
2799 local t = E.db.unitframe.colors.borderColor
2800 local d = P.unitframe.colors.borderColor
2801 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
2802 end,
2803 set = function(info, r, g, b)
2804 local t = E.db.unitframe.colors.borderColor
2805 t.r, t.g, t.b = r, g, b
2806 E:UpdateMedia()
2807 E:UpdateBorderColors()
2808 end,
2809 },
2810 healthGroup = {
2811 order = 2,
2812 type = 'group',
2813 name = L["HEALTH"],
2814 get = function(info)
2815 local t = E.db.unitframe.colors[info[#info]]
2816 local d = P.unitframe.colors[info[#info]]
2817 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
2818 end,
2819 set = function(info, r, g, b)
2820 local t = E.db.unitframe.colors[info[#info]]
2821 t.r, t.g, t.b = r, g, b
2822 UF:Update_AllFrames()
2823 end,
2824 args = {
2825 colorhealthbyvalue = {
2826 order = 1,
2827 type = 'toggle',
2828 name = L["Health By Value"],
2829 desc = L["Color health by amount remaining."],
2830 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2831 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2832 },
2833 healthselection = {
2834 order = 2,
2835 type = 'toggle',
2836 name = L["Selection Health"],
2837 desc = L["Color health by color selection."],
2838 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2839 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2840 },
2841 healthclass = {
2842 order = 3,
2843 type = 'toggle',
2844 name = L["Class Health"],
2845 desc = L["Color health by classcolor or reaction."],
2846 disabled = function() return E.db.unitframe.colors.healthselection end,
2847 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2848 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2849 },
2850 forcehealthreaction = {
2851 order = 4,
2852 type = 'toggle',
2853 name = L["Force Reaction Color"],
2854 desc = L["Forces reaction color instead of class color on units controlled by players."],
2855 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2856 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2857 disabled = function() return E.db.unitframe.colors.healthselection or not E.db.unitframe.colors.healthclass end,
2858 },
2859 transparentHealth = {
2860 order = 6,
2861 type = 'toggle',
2862 name = L["Transparent"],
2863 desc = L["Make textures transparent."],
2864 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2865 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2866 },
2867 useDeadBackdrop = {
2868 order = 7,
2869 type = "toggle",
2870 name = L["Use Dead Backdrop"],
2871 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2872 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2873 },
2874 classbackdrop = {
2875 order = 8,
2876 type = 'toggle',
2877 name = L["Class Backdrop"],
2878 desc = L["Color the health backdrop by class or reaction."],
2879 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2880 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2881 disabled = function() return E.db.unitframe.colors.customhealthbackdrop end
2882 },
2883 customhealthbackdrop = {
2884 order = 9,
2885 type = 'toggle',
2886 name = L["Custom Backdrop"],
2887 desc = L["Use the custom backdrop color instead of a multiple of the main color."],
2888 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2889 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2890 },
2891 healthMultiplier = {
2892 order = 10,
2893 name = L["Health Backdrop Multiplier"],
2894 type = 'range',
2895 min = 0, softMax = 0.75, max = 1, step = .01,
2896 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2897 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2898 disabled = function() return E.db.unitframe.colors.customhealthbackdrop end
2899 },
2900 health_backdrop = {
2901 order = 20,
2902 type = 'color',
2903 name = L["Health Backdrop"],
2904 disabled = function() return not E.db.unitframe.colors.customhealthbackdrop end
2905 },
2906 tapped = {
2907 order = 21,
2908 type = 'color',
2909 name = L["Tapped"],
2910 },
2911 health = {
2912 order = 22,
2913 type = 'color',
2914 name = L["Health"],
2915 },
2916 disconnected = {
2917 order = 23,
2918 type = 'color',
2919 name = L["Disconnected"],
2920 },
2921 health_backdrop_dead = {
2922 order = 24,
2923 type = "color",
2924 name = L["Custom Dead Backdrop"],
2925 desc = L["Use this backdrop color for units that are dead or ghosts."],
2926 customWidth = 250,
2927 },
2928 },
2929 },
2930 powerGroup = {
2931 order = 3,
2932 type = 'group',
2933 name = L["Powers"],
2934 get = function(info)
2935 local t = E.db.unitframe.colors.power[info[#info]]
2936 local d = P.unitframe.colors.power[info[#info]]
2937 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
2938 end,
2939 set = function(info, r, g, b)
2940 local t = E.db.unitframe.colors.power[info[#info]]
2941 t.r, t.g, t.b = r, g, b
2942 UF:Update_AllFrames()
2943 NP:ConfigureAll()
2944 end,
2945 args = {
2946 transparentPower = {
2947 order = 1,
2948 type = 'toggle',
2949 name = L["Transparent"],
2950 desc = L["Make textures transparent."],
2951 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2952 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2953 },
2954 invertPower = {
2955 order = 2,
2956 type = 'toggle',
2957 name = L["Invert Colors"],
2958 desc = L["Invert foreground and background colors."],
2959 disabled = function() return not E.db.unitframe.colors.transparentPower end,
2960 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2961 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2962 },
2963 powerselection = {
2964 order = 3,
2965 type = 'toggle',
2966 name = L["Selection Power"],
2967 desc = L["Color power by color selection."],
2968 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2969 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2970 },
2971 powerclass = {
2972 order = 4,
2973 type = 'toggle',
2974 name = L["Class Power"],
2975 desc = L["Color power by classcolor or reaction."],
2976 disabled = function() return E.db.unitframe.colors.powerselection end,
2977 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2978 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2979 },
2980 spacer2 = {
2981 order = 5,
2982 type = "description",
2983 name = " ",
2984 width = 'full'
2985 },
2986 custompowerbackdrop = {
2987 order = 6,
2988 type = 'toggle',
2989 name = L["Custom Backdrop"],
2990 desc = L["Use the custom backdrop color instead of a multiple of the main color."],
2991 get = function(info) return E.db.unitframe.colors[info[#info]] end,
2992 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
2993 },
2994 power_backdrop = {
2995 order = 7,
2996 type = 'color',
2997 name = L["Custom Backdrop"],
2998 desc = L["Use the custom backdrop color instead of a multiple of the main color."],
2999 disabled = function() return not E.db.unitframe.colors.custompowerbackdrop end,
3000 get = function(info)
3001 local t = E.db.unitframe.colors[info[#info]]
3002 local d = P.unitframe.colors[info[#info]]
3003 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
3004 end,
3005 set = function(info, r, g, b)
3006 local t = E.db.unitframe.colors[info[#info]]
3007 t.r, t.g, t.b = r, g, b
3008 UF:Update_AllFrames()
3009 end,
3010 },
3011 spacer3 = {
3012 order = 8,
3013 type = "description",
3014 name = " ",
3015 width = 'full'
3016 },
3017 MANA = {
3018 order = 20,
3019 name = L["MANA"],
3020 type = 'color',
3021 },
3022 RAGE = {
3023 order = 21,
3024 name = L["RAGE"],
3025 type = 'color',
3026 },
3027 FOCUS = {
3028 order = 22,
3029 name = L["FOCUS"],
3030 type = 'color',
3031 },
3032 ENERGY = {
3033 order = 23,
3034 name = L["ENERGY"],
3035 type = 'color',
3036 },
3037 RUNIC_POWER = {
3038 order = 24,
3039 name = L["RUNIC_POWER"],
3040 type = 'color',
3041 },
3042 PAIN = {
3043 order = 25,
3044 name = L["PAIN"],
3045 type = 'color',
3046 },
3047 FURY = {
3048 order = 26,
3049 name = L["FURY"],
3050 type = 'color',
3051 },
3052 LUNAR_POWER = {
3053 order = 27,
3054 name = L["LUNAR_POWER"],
3055 type = 'color'
3056 },
3057 INSANITY = {
3058 order = 28,
3059 name = L["INSANITY"],
3060 type = 'color'
3061 },
3062 MAELSTROM = {
3063 order = 29,
3064 name = L["MAELSTROM"],
3065 type = 'color'
3066 },
3067 },
3068 },
3069 castBars = {
3070 order = 4,
3071 type = 'group',
3072 name = L["Castbar"],
3073 get = function(info)
3074 local t = E.db.unitframe.colors[info[#info]]
3075 local d = P.unitframe.colors[info[#info]]
3076 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
3077 end,
3078 set = function(info, r, g, b)
3079 local t = E.db.unitframe.colors[info[#info]]
3080 t.r, t.g, t.b = r, g, b
3081 UF:Update_AllFrames()
3082 end,
3083 args = {
3084 transparentCastbar = {
3085 order = 1,
3086 type = 'toggle',
3087 name = L["Transparent"],
3088 desc = L["Make textures transparent."],
3089 get = function(info) return E.db.unitframe.colors[info[#info]] end,
3090 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
3091 },
3092 invertCastbar = {
3093 order = 2,
3094 type = 'toggle',
3095 name = L["Invert Colors"],
3096 desc = L["Invert foreground and background colors."],
3097 disabled = function() return not E.db.unitframe.colors.transparentCastbar end,
3098 get = function(info) return E.db.unitframe.colors[info[#info]] end,
3099 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
3100 },
3101 castClassColor = {
3102 order = 3,
3103 type = 'toggle',
3104 name = L["Class Castbars"],
3105 desc = L["Color castbars by the class of player units."],
3106 get = function(info) return E.db.unitframe.colors[info[#info]] end,
3107 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
3108 },
3109 castReactionColor = {
3110 order = 4,
3111 type = 'toggle',
3112 name = L["Reaction Castbars"],
3113 desc = L["Color castbars by the reaction type of non-player units."],
3114 get = function(info) return E.db.unitframe.colors[info[#info]] end,
3115 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
3116 },
3117 spacer1 = {
3118 order = 5,
3119 type = "description",
3120 name = " ",
3121 width = 'full'
3122 },
3123 customcastbarbackdrop = {
3124 order = 6,
3125 type = 'toggle',
3126 name = L["Custom Backdrop"],
3127 desc = L["Use the custom backdrop color instead of a multiple of the main color."],
3128 get = function(info) return E.db.unitframe.colors[info[#info]] end,
3129 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
3130 },
3131 castbar_backdrop = {
3132 order = 7,
3133 type = 'color',
3134 name = L["Custom Backdrop"],
3135 desc = L["Use the custom backdrop color instead of a multiple of the main color."],
3136 disabled = function() return not E.db.unitframe.colors.customcastbarbackdrop end
3137 },
3138 spacer2 = {
3139 order = 8,
3140 type = "description",
3141 name = " ",
3142 width = 'full'
3143 },
3144 castColor = {
3145 order = 9,
3146 name = L["Interruptable"],
3147 type = 'color',
3148 },
3149 castNoInterrupt = {
3150 order = 10,
3151 name = L["Non-Interruptable"],
3152 type = 'color',
3153 },
3154 },
3155 },
3156 auraBars = {
3157 order = 5,
3158 type = 'group',
3159 name = L["Aura Bars"],
3160 args = {
3161 transparentAurabars = {
3162 order = 1,
3163 type = 'toggle',
3164 name = L["Transparent"],
3165 desc = L["Make textures transparent."],
3166 get = function(info) return E.db.unitframe.colors[info[#info]] end,
3167 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
3168 },
3169 invertAurabars = {
3170 order = 2,
3171 type = 'toggle',
3172 name = L["Invert Colors"],
3173 desc = L["Invert foreground and background colors."],
3174 disabled = function() return not E.db.unitframe.colors.transparentAurabars end,
3175 get = function(info) return E.db.unitframe.colors[info[#info]] end,
3176 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
3177 },
3178 auraBarByType = {
3179 order = 3,
3180 name = L["By Type"],
3181 desc = L["Color aurabar debuffs by type."],
3182 type = 'toggle',
3183 },
3184 auraBarTurtle = {
3185 order = 4,
3186 name = L["Color Turtle Buffs"],
3187 desc = L["Color all buffs that reduce the unit's incoming damage."],
3188 type = 'toggle',
3189 },
3190 spacer1 = {
3191 order = 5,
3192 type = "description",
3193 name = " ",
3194 width = 'full'
3195 },
3196 customaurabarbackdrop = {
3197 order = 6,
3198 type = 'toggle',
3199 name = L["Custom Backdrop"],
3200 desc = L["Use the custom backdrop color instead of a multiple of the main color."],
3201 get = function(info) return E.db.unitframe.colors[info[#info]] end,
3202 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
3203 },
3204 aurabar_backdrop = {
3205 order = 7,
3206 type = 'color',
3207 name = L["Custom Backdrop"],
3208 desc = L["Use the custom backdrop color instead of a multiple of the main color."],
3209 disabled = function() return not E.db.unitframe.colors.customaurabarbackdrop end,
3210 get = function(info)
3211 local t = E.db.unitframe.colors[info[#info]]
3212 local d = P.unitframe.colors[info[#info]]
3213 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
3214 end,
3215 set = function(info, r, g, b)
3216 local t = E.db.unitframe.colors[info[#info]]
3217 t.r, t.g, t.b = r, g, b
3218 UF:Update_AllFrames()
3219 end,
3220 },
3221 spacer2 = {
3222 order = 8,
3223 type = "description",
3224 name = " ",
3225 width = 'full'
3226 },
3227 BUFFS = {
3228 order = 10,
3229 name = L["Buffs"],
3230 type = 'color',
3231 get = function(info)
3232 local t = E.db.unitframe.colors.auraBarBuff
3233 local d = P.unitframe.colors.auraBarBuff
3234 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
3235 end,
3236 set = function(info, r, g, b)
3237 if E:CheckClassColor(r, g, b) then
3238 local classColor = E.myclass == 'PRIEST' and E.PriestColors or (_G.CUSTOM_CLASS_COLORS and _G.CUSTOM_CLASS_COLORS[E.myclass] or _G.RAID_CLASS_COLORS[E.myclass])
3239 r, g, b = classColor.r, classColor.g, classColor.b
3240 end
3241
3242 local t = E.db.unitframe.colors.auraBarBuff
3243 t.r, t.g, t.b = r, g, b
3244
3245 UF:Update_AllFrames()
3246 end,
3247 },
3248 DEBUFFS = {
3249 order = 11,
3250 name = L["Debuffs"],
3251 type = 'color',
3252 get = function(info)
3253 local t = E.db.unitframe.colors.auraBarDebuff
3254 local d = P.unitframe.colors.auraBarDebuff
3255 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
3256 end,
3257 set = function(info, r, g, b)
3258 local t = E.db.unitframe.colors.auraBarDebuff
3259 t.r, t.g, t.b = r, g, b
3260 UF:Update_AllFrames()
3261 end,
3262 },
3263 auraBarTurtleColor = {
3264 order = 15,
3265 name = L["Turtle Color"],
3266 type = 'color',
3267 get = function(info)
3268 local t = E.db.unitframe.colors.auraBarTurtleColor
3269 local d = P.unitframe.colors.auraBarTurtleColor
3270 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
3271 end,
3272 set = function(info, r, g, b)
3273 local t = E.db.unitframe.colors.auraBarTurtleColor
3274 t.r, t.g, t.b = r, g, b
3275 UF:Update_AllFrames()
3276 end,
3277 },
3278 },
3279 },
3280 reactionGroup = {
3281 order = 6,
3282 type = 'group',
3283 name = L["Reactions"],
3284 get = function(info)
3285 local t = E.db.unitframe.colors.reaction[info[#info]]
3286 local d = P.unitframe.colors.reaction[info[#info]]
3287 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
3288 end,
3289 set = function(info, r, g, b)
3290 local t = E.db.unitframe.colors.reaction[info[#info]]
3291 t.r, t.g, t.b = r, g, b
3292 UF:Update_AllFrames()
3293 end,
3294 args = {
3295 BAD = {
3296 order = 1,
3297 name = L["Bad"],
3298 type = 'color',
3299 },
3300 NEUTRAL = {
3301 order = 2,
3302 name = L["Neutral"],
3303 type = 'color',
3304 },
3305 GOOD = {
3306 order = 3,
3307 name = L["Good"],
3308 type = 'color',
3309 },
3310 },
3311 },
3312 selectionGroup = {
3313 order = 7,
3314 type = 'group',
3315 name = L["Selection"],
3316 get = function(info)
3317 local n = tonumber(info[#info])
3318 local t = E.db.unitframe.colors.selection[n]
3319 local d = P.unitframe.colors.selection[n]
3320 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
3321 end,
3322 set = function(info, r, g, b)
3323 local n = tonumber(info[#info])
3324 local t = E.db.unitframe.colors.selection[n]
3325 t.r, t.g, t.b = r, g, b
3326 UF:Update_AllFrames()
3327 end,
3328 args = {
3329 ['0'] = {
3330 order = 0,
3331 name = L["Hostile"],
3332 type = 'color',
3333 },
3334 ['1'] = {
3335 order = 1,
3336 name = L["Unfriendly"],
3337 type = 'color',
3338 },
3339 ['2'] = {
3340 order = 2,
3341 name = L["Neutral"],
3342 type = 'color',
3343 },
3344 ['3'] = {
3345 order = 3,
3346 name = L["Friendly"],
3347 type = 'color',
3348 },
3349 --[[ LS- said to just use "Player Extended" as "Player" and don't use "Player Simple" at all
3350 ['4'] = {
3351 order = 4,
3352 name = L["Player Simple"],
3353 type = 'color',
3354 },
3355 ]]
3356 ['5'] = {
3357 order = 5,
3358 name = L["Player"], -- Player Extended
3359 type = 'color',
3360 },
3361 ['6'] = {
3362 order = 6,
3363 name = L["PARTY"],
3364 type = 'color',
3365 },
3366 ['7'] = {
3367 order = 7,
3368 name = L["Party PVP"],
3369 type = 'color',
3370 },
3371 ['8'] = {
3372 order = 8,
3373 name = L["Friend"],
3374 type = 'color',
3375 },
3376 ['9'] = {
3377 order = 9,
3378 name = L["Dead"],
3379 type = 'color',
3380 },
3381 --[[ disabled in oUF for now by LS-
3382 ['12'] = {
3383 order = 12,
3384 name = L["Self"],
3385 type = 'color',
3386 },
3387 ]]
3388 ['13'] = {
3389 order = 13,
3390 name = L["Battleground Friendly"],
3391 type = 'color',
3392 },
3393 },
3394 },
3395 healPrediction = {
3396 order = 9,
3397 name = L["Heal Prediction"],
3398 type = 'group',
3399 get = function(info)
3400 local t = E.db.unitframe.colors.healPrediction[info[#info]]
3401 local d = P.unitframe.colors.healPrediction[info[#info]]
3402 return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a
3403 end,
3404 set = function(info, r, g, b, a)
3405 local t = E.db.unitframe.colors.healPrediction[info[#info]]
3406 t.r, t.g, t.b, t.a = r, g, b, a
3407 UF:Update_AllFrames()
3408 end,
3409 args = {
3410 maxOverflow = {
3411 order = 1,
3412 type = "range",
3413 name = L["Max Overflow"],
3414 desc = L["Max amount of overflow allowed to extend past the end of the health bar."],
3415 isPercent = true,
3416 min = 0, max = 1, step = 0.01,
3417 get = function(info) return E.db.unitframe.colors.healPrediction.maxOverflow end,
3418 set = function(info, value) E.db.unitframe.colors.healPrediction.maxOverflow = value; UF:Update_AllFrames() end,
3419 },
3420 spacer1 = {
3421 order = 2,
3422 type = "description",
3423 name = " ",
3424 width = 'full'
3425 },
3426 personal = {
3427 order = 3,
3428 name = L["Personal"],
3429 type = 'color',
3430 hasAlpha = true,
3431 },
3432 others = {
3433 order = 4,
3434 name = L["Others"],
3435 type = 'color',
3436 hasAlpha = true,
3437 },
3438 absorbs = {
3439 order = 5,
3440 name = L["Absorbs"],
3441 type = 'color',
3442 hasAlpha = true,
3443 },
3444 healAbsorbs = {
3445 order = 6,
3446 name = L["Heal Absorbs"],
3447 type = 'color',
3448 hasAlpha = true,
3449 },
3450 overabsorbs = {
3451 order = 7,
3452 name = L["Over Absorbs"],
3453 type = 'color',
3454 hasAlpha = true,
3455 },
3456 overhealabsorbs = {
3457 order = 8,
3458 name = L["Over Heal Absorbs"],
3459 type = 'color',
3460 hasAlpha = true,
3461 },
3462 },
3463 },
3464 powerPrediction = {
3465 order = 10,
3466 name = L["Power Prediction"],
3467 type = 'group',
3468 get = function(info)
3469 local t = E.db.unitframe.colors.powerPrediction[info[#info]]
3470 local d = P.unitframe.colors.powerPrediction[info[#info]]
3471 return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a
3472 end,
3473 set = function(info, r, g, b, a)
3474 local t = E.db.unitframe.colors.powerPrediction[info[#info]]
3475 t.r, t.g, t.b, t.a = r, g, b, a
3476 UF:Update_AllFrames()
3477 end,
3478 args = {
3479 enable = {
3480 order = 15,
3481 type = 'toggle',
3482 customWidth = 250,
3483 name = L["Custom Power Prediction Color"],
3484 get = function(info) return E.db.unitframe.colors.powerPrediction[info[#info]] end,
3485 set = function(info, value) E.db.unitframe.colors.powerPrediction[info[#info]] = value; UF:Update_AllFrames() end,
3486 },
3487 spacer2 = {
3488 order = 16,
3489 type = "description",
3490 name = "",
3491 },
3492 color = {
3493 order = 17,
3494 name = L["Power Prediction Color"],
3495 type = 'color',
3496 hasAlpha = true,
3497 },
3498 additional = {
3499 order = 18,
3500 name = L["Additional Power Prediction Color"],
3501 type = 'color',
3502 hasAlpha = true,
3503 },
3504 },
3505 },
3506 debuffHighlight = {
3507 order = 11,
3508 name = L["Debuff Highlighting"],
3509 type = 'group',
3510 get = function(info)
3511 local t = E.db.unitframe.colors.debuffHighlight[info[#info]]
3512 local d = P.unitframe.colors.debuffHighlight[info[#info]]
3513 return t.r, t.g, t.b, t.a, d.r, d.g, d.b, d.a
3514 end,
3515 set = function(info, r, g, b, a)
3516 local t = E.db.unitframe.colors.debuffHighlight[info[#info]]
3517 t.r, t.g, t.b, t.a = r, g, b, a
3518 UF:Update_AllFrames()
3519 end,
3520 args = {
3521 debuffHighlighting = {
3522 order = 1,
3523 name = L["Debuff Highlighting"],
3524 desc = L["Color the unit healthbar if there is a debuff that can be dispelled by you."],
3525 type = 'select',
3526 get = function(info) return E.db.unitframe[info[#info]] end,
3527 set = function(info, value) E.db.unitframe[info[#info]] = value end,
3528 values = {
3529 ['NONE'] = NONE,
3530 ['GLOW'] = L["Glow"],
3531 ['FILL'] = L["Fill"]
3532 },
3533 },
3534 blendMode = {
3535 order = 2,
3536 name = L["Blend Mode"],
3537 type = 'select',
3538 values = blendModeValues,
3539 get = function(info) return E.db.unitframe.colors.debuffHighlight[info[#info]] end,
3540 set = function(info, value) E.db.unitframe.colors.debuffHighlight[info[#info]] = value; UF:Update_AllFrames(); end
3541 },
3542 spacer1 = {
3543 order = 3,
3544 type = "description",
3545 name = " ",
3546 width = 'full'
3547 },
3548 Magic = {
3549 order = 4,
3550 name = L["ENCOUNTER_JOURNAL_SECTION_FLAG7"],--Magic Effect
3551 type = 'color',
3552 hasAlpha = true,
3553 },
3554 Curse = {
3555 order = 5,
3556 name = L["ENCOUNTER_JOURNAL_SECTION_FLAG8"],--Curse Effect
3557 type = 'color',
3558 hasAlpha = true,
3559 },
3560 Disease = {
3561 order = 6,
3562 name = L["ENCOUNTER_JOURNAL_SECTION_FLAG10"],--Disease Effect
3563 type = 'color',
3564 hasAlpha = true,
3565 },
3566 Poison = {
3567 order = 7,
3568 name = L["ENCOUNTER_JOURNAL_SECTION_FLAG9"],--Poison Effect
3569 type = 'color',
3570 hasAlpha = true,
3571 },
3572 },
3573 },
3574 },
3575 },
3576 disabledBlizzardFrames = {
3577 order = 4,
3578 type = "group",
3579 name = L["Disabled Blizzard Frames"],
3580 get = function(info) return E.private.unitframe.disabledBlizzardFrames[info[#info]] end,
3581 set = function(info, value) E.private.unitframe.disabledBlizzardFrames[info[#info]] = value; E:StaticPopup_Show("PRIVATE_RL") end,
3582 args = {
3583 header = {
3584 order = 0,
3585 type = "header",
3586 name = L["Disabled Blizzard Frames"],
3587 },
3588 player = {
3589 order = 1,
3590 type = 'toggle',
3591 name = L["Player"],
3592 desc = L["Disables the player and pet unitframes."],
3593 },
3594 target = {
3595 order = 2,
3596 type = 'toggle',
3597 name = L["TARGET"],
3598 desc = L["Disables the target and target of target unitframes."],
3599 },
3600 party = {
3601 order = 6,
3602 type = 'toggle',
3603 name = L["PARTY"],
3604 },
3605 raid = {
3606 order = 7,
3607 type = 'toggle',
3608 name = L["Raid"],
3609 },
3610 },
3611 },
3612 raidDebuffIndicator = {
3613 order = 5,
3614 type = "group",
3615 name = L["RaidDebuff Indicator"],
3616 args = {
3617 header = {
3618 order = 1,
3619 type = "header",
3620 name = L["RaidDebuff Indicator"],
3621 },
3622 instanceFilter = {
3623 order = 2,
3624 type = "select",
3625 name = L["Dungeon & Raid Filter"],
3626 values = function()
3627 local filters = {}
3628 local list = E.global.unitframe.aurafilters
3629 if not list then return end
3630 for filter in pairs(list) do
3631 filters[filter] = filter
3632 end
3633
3634 return filters
3635 end,
3636 get = function(info) return E.global.unitframe.raidDebuffIndicator.instanceFilter end,
3637 set = function(info, value) E.global.unitframe.raidDebuffIndicator.instanceFilter = value; UF:UpdateAllHeaders() end,
3638 },
3639 otherFilter = {
3640 order = 3,
3641 type = "select",
3642 name = L["Other Filter"],
3643 values = function()
3644 local filters = {}
3645 local list = E.global.unitframe.aurafilters
3646 if not list then return end
3647 for filter in pairs(list) do
3648 filters[filter] = filter
3649 end
3650
3651 return filters
3652 end,
3653 get = function(info) return E.global.unitframe.raidDebuffIndicator.otherFilter end,
3654 set = function(info, value) E.global.unitframe.raidDebuffIndicator.otherFilter = value; UF:UpdateAllHeaders() end,
3655 },
3656 },
3657 },
3658 },
3659 },
3660 },
3661}
3662
3663--Player
3664E.Options.args.unitframe.args.player = {
3665 name = L["Player"],
3666 type = 'group',
3667 order = 300,
3668 childGroups = "tab",
3669 get = function(info) return E.db.unitframe.units.player[info[#info]] end,
3670 set = function(info, value) E.db.unitframe.units.player[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
3671 disabled = function() return not E.UnitFrames.Initialized end,
3672 args = {
3673 enable = {
3674 type = 'toggle',
3675 order = 1,
3676 name = L["Enable"],
3677 set = function(info, value)
3678 E.db.unitframe.units.player[info[#info]] = value;
3679 UF:CreateAndUpdateUF('player');
3680 end,
3681 },
3682 showAuras = {
3683 order = 2,
3684 type = 'execute',
3685 name = L["Show Auras"],
3686 func = function()
3687 local frame = ElvUF_Player
3688 if frame.forceShowAuras then
3689 frame.forceShowAuras = nil;
3690 else
3691 frame.forceShowAuras = true;
3692 end
3693
3694 UF:CreateAndUpdateUF('player')
3695 end,
3696 },
3697 resetSettings = {
3698 type = 'execute',
3699 order = 3,
3700 name = L["Restore Defaults"],
3701 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Player"], nil, {unit='player', mover='Player Frame'}) end,
3702 },
3703 copyFrom = {
3704 type = 'select',
3705 order = 4,
3706 name = L["Copy From"],
3707 desc = L["Select a unit to copy settings from."],
3708 values = UF.units,
3709 set = function(info, value) UF:MergeUnitSettings(value, 'player'); end,
3710 },
3711 generalGroup = {
3712 order = 5,
3713 type = "group",
3714 name = L["General"],
3715 args = {
3716 header = {
3717 order = 1,
3718 type = "header",
3719 name = L["General"],
3720 },
3721 width = {
3722 order = 3,
3723 name = L["Width"],
3724 type = 'range',
3725 min = 50, max = 1000, step = 1,
3726 set = function(info, value)
3727 if E.db.unitframe.units.player.castbar.width == E.db.unitframe.units.player[info[#info]] then
3728 E.db.unitframe.units.player.castbar.width = value;
3729 end
3730
3731 E.db.unitframe.units.player[info[#info]] = value;
3732 UF:CreateAndUpdateUF('player');
3733 end,
3734 },
3735 height = {
3736 order = 4,
3737 name = L["Height"],
3738 type = 'range',
3739 min = 10, max = 500, step = 1,
3740 },
3741 hideonnpc = {
3742 type = 'toggle',
3743 order = 6,
3744 name = L["Text Toggle On NPC"],
3745 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
3746 get = function(info) return E.db.unitframe.units.player.power.hideonnpc end,
3747 set = function(info, value) E.db.unitframe.units.player.power.hideonnpc = value; UF:CreateAndUpdateUF('player') end,
3748 },
3749 smartAuraPosition = {
3750 order = 8,
3751 type = "select",
3752 name = L["Smart Aura Position"],
3753 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
3754 values = smartAuraPositionValues,
3755 },
3756 orientation = {
3757 order = 9,
3758 type = "select",
3759 name = L["Frame Orientation"],
3760 desc = L["Set the orientation of the UnitFrame."],
3761 values = orientationValues,
3762 },
3763 colorOverride = {
3764 order = 10,
3765 name = L["Class Color Override"],
3766 desc = L["Override the default class color setting."],
3767 type = 'select',
3768 values = colorOverrideValues,
3769 },
3770 spacer = {
3771 order = 11,
3772 type = "description",
3773 name = "",
3774 },
3775 disableMouseoverGlow = {
3776 order = 12,
3777 type = "toggle",
3778 name = L["Block Mouseover Glow"],
3779 desc = L["Forces Mouseover Glow to be disabled for these frames"],
3780 },
3781 disableTargetGlow = {
3782 order = 13,
3783 type = "toggle",
3784 name = L["Block Target Glow"],
3785 desc = L["Forces Target Glow to be disabled for these frames"],
3786 },
3787 },
3788 },
3789 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateUF, 'player'),
3790 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'player'),
3791 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'player'),
3792 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'player'),
3793 power = GetOptionsTable_Power(true, UF.CreateAndUpdateUF, 'player', nil, true),
3794 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'player'),
3795 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'player'),
3796 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'player'),
3797 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'player'),
3798 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'player'),
3799 castbar = GetOptionsTable_Castbar(true, UF.CreateAndUpdateUF, 'player'),
3800 aurabar = GetOptionsTable_AuraBars(UF.CreateAndUpdateUF, 'player'),
3801 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, 'player'),
3802 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'player'),
3803 classbar = {
3804 order = 1000,
3805 type = 'group',
3806 name = L["Classbar"],
3807 get = function(info) return E.db.unitframe.units.player.classbar[info[#info]] end,
3808 set = function(info, value) E.db.unitframe.units.player.classbar[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
3809 args = {
3810 header = {
3811 order = 1,
3812 type = "header",
3813 name = L["Classbar"],
3814 },
3815 enable = {
3816 type = 'toggle',
3817 order = 2,
3818 name = L["Enable"],
3819 },
3820 height = {
3821 type = 'range',
3822 order = 3,
3823 name = L["Height"],
3824 min = ((E.db.unitframe.thinBorders or E.PixelMode) and 3 or 7),
3825 max = (E.db.unitframe.units.player.classbar.detachFromFrame and 300 or 30),
3826 step = 1,
3827 },
3828 fill = {
3829 type = 'select',
3830 order = 4,
3831 name = L["Fill"],
3832 values = {
3833 ['fill'] = L["Filled"],
3834 ['spaced'] = L["Spaced"],
3835 },
3836 },
3837 autoHide = {
3838 order = 5,
3839 type = 'toggle',
3840 name = L["Auto-Hide"],
3841 },
3842 additionalPowerText = {
3843 order = 6,
3844 type = "toggle",
3845 name = L["Additional Power Text"],
3846 },
3847 spacer = {
3848 order = 10,
3849 type = "description",
3850 name = "",
3851 },
3852 detachGroup = {
3853 order = 20,
3854 type = "group",
3855 name = L["Detach From Frame"],
3856 get = function(info) return E.db.unitframe.units.player.classbar[info[#info]] end,
3857 set = function(info, value) E.db.unitframe.units.player.classbar[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
3858 guiInline = true,
3859 args = {
3860 detachFromFrame = {
3861 type = 'toggle',
3862 order = 1,
3863 name = L["Enable"],
3864 width = 'full',
3865 set = function(info, value)
3866 if value == true then
3867 E.Options.args.unitframe.args.player.args.classbar.args.height.max = 300
3868 else
3869 E.Options.args.unitframe.args.player.args.classbar.args.height.max = 30
3870 end
3871 E.db.unitframe.units.player.classbar[info[#info]] = value;
3872 UF:CreateAndUpdateUF('player')
3873 end,
3874 },
3875 detachedWidth = {
3876 type = 'range',
3877 order = 2,
3878 name = L["Detached Width"],
3879 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3880 min = ((E.db.unitframe.thinBorders or E.PixelMode) and 3 or 7), max = 800, step = 1,
3881 },
3882 orientation = {
3883 type = 'select',
3884 order = 3,
3885 name = L["Frame Orientation"],
3886 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3887 values = {
3888 ['HORIZONTAL'] = L["Horizontal"],
3889 ['VERTICAL'] = L["Vertical"],
3890 },
3891 },
3892 verticalOrientation = {
3893 order = 4,
3894 type = "toggle",
3895 name = L["Vertical Fill Direction"],
3896 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3897 },
3898 spacing = {
3899 order = 5,
3900 type = "range",
3901 name = L["Spacing"],
3902 min = ((E.db.unitframe.thinBorders or E.PixelMode) and -1 or -4), max = 20, step = 1,
3903 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3904 },
3905 parent = {
3906 type = 'select',
3907 order = 6,
3908 name = L["Parent"],
3909 desc = L["Choose UIPARENT to prevent it from hiding with the unitframe."],
3910 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3911 values = {
3912 ["FRAME"] = "FRAME",
3913 ["UIPARENT"] = "UIPARENT",
3914 },
3915 },
3916 strataAndLevel = {
3917 order = 10,
3918 type = "group",
3919 name = L["Strata and Level"],
3920 get = function(info) return E.db.unitframe.units.player.classbar.strataAndLevel[info[#info]] end,
3921 set = function(info, value) E.db.unitframe.units.player.classbar.strataAndLevel[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
3922 guiInline = true,
3923 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3924 hidden = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3925 args = {
3926 useCustomStrata = {
3927 order = 1,
3928 type = "toggle",
3929 name = L["Use Custom Strata"],
3930 },
3931 frameStrata = {
3932 order = 2,
3933 type = "select",
3934 name = L["Frame Strata"],
3935 values = {
3936 ["BACKGROUND"] = "BACKGROUND",
3937 ["LOW"] = "LOW",
3938 ["MEDIUM"] = "MEDIUM",
3939 ["HIGH"] = "HIGH",
3940 ["DIALOG"] = "DIALOG",
3941 ["TOOLTIP"] = "TOOLTIP",
3942 },
3943 },
3944 spacer = {
3945 order = 3,
3946 type = "description",
3947 name = "",
3948 },
3949 useCustomLevel = {
3950 order = 4,
3951 type = "toggle",
3952 name = L["Use Custom Level"],
3953 },
3954 frameLevel = {
3955 order = 5,
3956 type = "range",
3957 name = L["Frame Level"],
3958 min = 2, max = 128, step = 1,
3959 },
3960 },
3961 },
3962 },
3963 },
3964 },
3965 },
3966 RestIcon = {
3967 order = 430,
3968 type = 'group',
3969 name = L["Rest Icon"],
3970 get = function(info) return E.db.unitframe.units.player.RestIcon[info[#info]] end,
3971 set = function(info, value) E.db.unitframe.units.player.RestIcon[info[#info]] = value; UF:CreateAndUpdateUF('player'); UF:TestingDisplay_RestingIndicator(ElvUF_Player); end,
3972 args = {
3973 header = {
3974 order = 1,
3975 type = "header",
3976 name = L["Rest Icon"],
3977 },
3978 enable = {
3979 order = 2,
3980 type = "toggle",
3981 name = L["Enable"],
3982 },
3983 defaultColor = {
3984 order = 3,
3985 type = "toggle",
3986 name = L["Default Color"],
3987 },
3988 color = {
3989 order = 4,
3990 type = "color",
3991 name = COLOR,
3992 hasAlpha = true,
3993 disabled = function()
3994 return E.db.unitframe.units.player.RestIcon.defaultColor
3995 end,
3996 get = function()
3997 local c = E.db.unitframe.units.player.RestIcon.color
3998 local d = P.unitframe.units.player.RestIcon.color
3999 return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
4000 end,
4001 set = function(_, r, g, b, a)
4002 local c = E.db.unitframe.units.player.RestIcon.color
4003 c.r, c.g, c.b, c.a = r, g, b, a
4004 UF:CreateAndUpdateUF('player');
4005 UF:TestingDisplay_RestingIndicator(ElvUF_Player);
4006 end,
4007 },
4008 size = {
4009 order = 5,
4010 type = "range",
4011 name = L["Size"],
4012 min = 10, max = 60, step = 1,
4013 },
4014 xOffset = {
4015 order = 6,
4016 type = "range",
4017 name = L["X-Offset"],
4018 min = -100, max = 100, step = 1,
4019 },
4020 yOffset = {
4021 order = 7,
4022 type = "range",
4023 name = L["Y-Offset"],
4024 min = -100, max = 100, step = 1,
4025 },
4026 spacer2 = {
4027 order = 8,
4028 type = "description",
4029 name = " ",
4030 },
4031 anchorPoint = {
4032 order = 9,
4033 type = "select",
4034 name = L["Anchor Point"],
4035 values = positionValues,
4036 },
4037 texture = {
4038 order = 10,
4039 type = "select",
4040 sortByValue = true,
4041 name = L["Texture"],
4042 values = {
4043 ["CUSTOM"] = L["CUSTOM"],
4044 ["DEFAULT"] = L["DEFAULT"],
4045 ["RESTING"] = E:TextureString(E.Media.Textures.Resting, ":14"),
4046 ["RESTING1"] = E:TextureString(E.Media.Textures.Resting1, ":14"),
4047 },
4048 },
4049 customTexture = {
4050 type = 'input',
4051 order = 11,
4052 customWidth = 250,
4053 name = L["Custom Texture"],
4054 disabled = function()
4055 return E.db.unitframe.units.player.RestIcon.texture ~= "CUSTOM"
4056 end,
4057 set = function(_, value)
4058 E.db.unitframe.units.player.RestIcon.customTexture = (value and (not value:match("^%s-$")) and value) or nil
4059 UF:CreateAndUpdateUF('player');
4060 UF:TestingDisplay_RestingIndicator(ElvUF_Player);
4061 end
4062 },
4063 },
4064 },
4065 CombatIcon = {
4066 order = 440,
4067 type = 'group',
4068 name = L["Combat Icon"],
4069 get = function(info) return E.db.unitframe.units.player.CombatIcon[info[#info]] end,
4070 set = function(info, value) E.db.unitframe.units.player.CombatIcon[info[#info]] = value; UF:CreateAndUpdateUF('player'); UF:TestingDisplay_CombatIndicator(ElvUF_Player); end,
4071 args = {
4072 header = {
4073 order = 1,
4074 type = "header",
4075 name = L["Combat Icon"],
4076 },
4077 enable = {
4078 order = 2,
4079 type = "toggle",
4080 name = L["Enable"],
4081 },
4082 defaultColor = {
4083 order = 3,
4084 type = "toggle",
4085 name = L["Default Color"],
4086 },
4087 color = {
4088 order = 4,
4089 type = "color",
4090 name = L["COLOR"],
4091 hasAlpha = true,
4092 disabled = function()
4093 return E.db.unitframe.units.player.CombatIcon.defaultColor
4094 end,
4095 get = function()
4096 local c = E.db.unitframe.units.player.CombatIcon.color
4097 local d = P.unitframe.units.player.CombatIcon.color
4098 return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
4099 end,
4100 set = function(_, r, g, b, a)
4101 local c = E.db.unitframe.units.player.CombatIcon.color
4102 c.r, c.g, c.b, c.a = r, g, b, a
4103 UF:CreateAndUpdateUF('player');
4104 UF:TestingDisplay_CombatIndicator(ElvUF_Player);
4105 end,
4106 },
4107 size = {
4108 order = 5,
4109 type = "range",
4110 name = L["Size"],
4111 min = 10, max = 60, step = 1,
4112 },
4113 xOffset = {
4114 order = 6,
4115 type = "range",
4116 name = L["X-Offset"],
4117 min = -100, max = 100, step = 1,
4118 },
4119 yOffset = {
4120 order = 7,
4121 type = "range",
4122 name = L["Y-Offset"],
4123 min = -100, max = 100, step = 1,
4124 },
4125 spacer2 = {
4126 order = 8,
4127 type = "description",
4128 name = " ",
4129 },
4130 anchorPoint = {
4131 order = 9,
4132 type = "select",
4133 name = L["Anchor Point"],
4134 values = positionValues,
4135 },
4136 texture = {
4137 order = 10,
4138 type = "select",
4139 sortByValue = true,
4140 name = L["Texture"],
4141 values = {
4142 ["CUSTOM"] = L["CUSTOM"],
4143 ["DEFAULT"] = L["DEFAULT"],
4144 ["COMBAT"] = E:TextureString(E.Media.Textures.Combat, ":14"),
4145 ["PLATINUM"] = [[|TInterface\Challenges\ChallengeMode_Medal_Platinum:14|t]],
4146 ["ATTACK"] = [[|TInterface\CURSOR\Attack:14|t]],
4147 ["ALERT"] = [[|TInterface\DialogFrame\UI-Dialog-Icon-AlertNew:14|t]],
4148 ["ALERT2"] = [[|TInterface\OptionsFrame\UI-OptionsFrame-NewFeatureIcon:14|t]],
4149 ["ARTHAS"] =[[|TInterface\LFGFRAME\UI-LFR-PORTRAIT:14|t]],
4150 ["SKULL"] = [[|TInterface\LootFrame\LootPanel-Icon:14|t]],
4151 },
4152 },
4153 customTexture = {
4154 type = 'input',
4155 order = 11,
4156 customWidth = 250,
4157 name = L["Custom Texture"],
4158 disabled = function()
4159 return E.db.unitframe.units.player.CombatIcon.texture ~= "CUSTOM"
4160 end,
4161 set = function(_, value)
4162 E.db.unitframe.units.player.CombatIcon.customTexture = (value and (not value:match("^%s-$")) and value) or nil
4163 UF:CreateAndUpdateUF('player');
4164 UF:TestingDisplay_CombatIndicator(ElvUF_Player);
4165 end
4166 },
4167 },
4168 },
4169 pvpIcon = {
4170 order = 450,
4171 type = 'group',
4172 name = L["PvP & Prestige Icon"],
4173 get = function(info) return E.db.unitframe.units.player.pvpIcon[info[#info]] end,
4174 set = function(info, value) E.db.unitframe.units.player.pvpIcon[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
4175 args = {
4176 header = {
4177 order = 1,
4178 type = "header",
4179 name = L["PvP & Prestige Icon"],
4180 },
4181 enable = {
4182 order = 2,
4183 type = "toggle",
4184 name = L["Enable"],
4185 },
4186 scale = {
4187 order = 3,
4188 type = "range",
4189 name = L["Scale"],
4190 isPercent = true,
4191 min = 0.1, max = 2, step = 0.01,
4192 },
4193 spacer = {
4194 order = 4,
4195 type = "description",
4196 name = " ",
4197 },
4198 anchorPoint = {
4199 order = 5,
4200 type = "select",
4201 name = L["Anchor Point"],
4202 values = positionValues,
4203 },
4204 xOffset = {
4205 order = 6,
4206 type = "range",
4207 name = L["X-Offset"],
4208 min = -100, max = 100, step = 1,
4209 },
4210 yOffset = {
4211 order = 7,
4212 type = "range",
4213 name = L["Y-Offset"],
4214 min = -100, max = 100, step = 1,
4215 },
4216 },
4217 },
4218 pvpText = {
4219 order = 460,
4220 type = 'group',
4221 name = L["PvP Text"],
4222 get = function(info) return E.db.unitframe.units.player.pvp[info[#info]] end,
4223 set = function(info, value) E.db.unitframe.units.player.pvp[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
4224 args = {
4225 header = {
4226 order = 1,
4227 type = "header",
4228 name =L["PvP Text"],
4229 },
4230 position = {
4231 type = 'select',
4232 order = 2,
4233 name = L["Position"],
4234 values = positionValues,
4235 },
4236 text_format = {
4237 order = 100,
4238 name = L["Text Format"],
4239 type = 'input',
4240 width = 'full',
4241 desc = L["TEXT_FORMAT_DESC"],
4242 },
4243 },
4244 },
4245 raidRoleIcons = {
4246 order = 703,
4247 type = 'group',
4248 name = L["RL Icon"],
4249 get = function(info) return E.db.unitframe.units.player.raidRoleIcons[info[#info]] end,
4250 set = function(info, value) E.db.unitframe.units.player.raidRoleIcons[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
4251 args = {
4252 header = {
4253 order = 1,
4254 type = "header",
4255 name = L["RL Icon"],
4256 },
4257 enable = {
4258 type = 'toggle',
4259 name = L["Enable"],
4260 order = 2,
4261 },
4262 position = {
4263 type = 'select',
4264 order = 3,
4265 name = L["Position"],
4266 values = {
4267 ['TOPLEFT'] = 'TOPLEFT',
4268 ['TOPRIGHT'] = 'TOPRIGHT',
4269 },
4270 },
4271 },
4272 },
4273 },
4274}
4275
4276--Target
4277E.Options.args.unitframe.args.target = {
4278 name = L["TARGET"],
4279 type = 'group',
4280 order = 400,
4281 childGroups = "tab",
4282 get = function(info) return E.db.unitframe.units.target[info[#info]] end,
4283 set = function(info, value) E.db.unitframe.units.target[info[#info]] = value; UF:CreateAndUpdateUF('target') end,
4284 disabled = function() return not E.UnitFrames.Initialized end,
4285 args = {
4286 enable = {
4287 type = 'toggle',
4288 order = 1,
4289 name = L["Enable"],
4290 },
4291 showAuras = {
4292 order = 2,
4293 type = 'execute',
4294 name = L["Show Auras"],
4295 func = function()
4296 local frame = ElvUF_Target
4297 if frame.forceShowAuras then
4298 frame.forceShowAuras = nil;
4299 else
4300 frame.forceShowAuras = true;
4301 end
4302
4303 UF:CreateAndUpdateUF('target')
4304 end,
4305 },
4306 resetSettings = {
4307 type = 'execute',
4308 order = 3,
4309 name = L["Restore Defaults"],
4310 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Target Frame"], nil, {unit='target', mover='Target Frame'}) end,
4311 },
4312 copyFrom = {
4313 type = 'select',
4314 order = 4,
4315 name = L["Copy From"],
4316 desc = L["Select a unit to copy settings from."],
4317 values = UF.units,
4318 set = function(info, value) UF:MergeUnitSettings(value, 'target'); end,
4319 },
4320 generalGroup = {
4321 order = 5,
4322 type = "group",
4323 name = L["General"],
4324 args = {
4325 header = {
4326 order = 1,
4327 type = "header",
4328 name = L["General"],
4329 },
4330 width = {
4331 order = 3,
4332 name = L["Width"],
4333 type = 'range',
4334 min = 50, max = 1000, step = 1,
4335 set = function(info, value)
4336 if E.db.unitframe.units.target.castbar.width == E.db.unitframe.units.target[info[#info]] then
4337 E.db.unitframe.units.target.castbar.width = value;
4338 end
4339
4340 E.db.unitframe.units.target[info[#info]] = value;
4341 UF:CreateAndUpdateUF('target');
4342 end,
4343 },
4344 height = {
4345 order = 4,
4346 name = L["Height"],
4347 type = 'range',
4348 min = 10, max = 500, step = 1,
4349 },
4350 hideonnpc = {
4351 type = 'toggle',
4352 order = 6,
4353 name = L["Text Toggle On NPC"],
4354 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4355 get = function(info) return E.db.unitframe.units.target.power.hideonnpc end,
4356 set = function(info, value) E.db.unitframe.units.target.power.hideonnpc = value; UF:CreateAndUpdateUF('target') end,
4357 },
4358 smartAuraPosition = {
4359 order = 9,
4360 type = "select",
4361 name = L["Smart Aura Position"],
4362 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
4363 values = smartAuraPositionValues,
4364 },
4365 orientation = {
4366 order = 10,
4367 type = "select",
4368 name = L["Frame Orientation"],
4369 desc = L["Set the orientation of the UnitFrame."],
4370 values = orientationValues,
4371 },
4372 colorOverride = {
4373 order = 11,
4374 name = L["Class Color Override"],
4375 desc = L["Override the default class color setting."],
4376 type = 'select',
4377 values = colorOverrideValues,
4378 },
4379 disableMouseoverGlow = {
4380 order = 12,
4381 type = "toggle",
4382 name = L["Block Mouseover Glow"],
4383 desc = L["Forces Mouseover Glow to be disabled for these frames"],
4384 },
4385 disableTargetGlow = {
4386 order = 13,
4387 type = "toggle",
4388 name = L["Block Target Glow"],
4389 desc = L["Forces Target Glow to be disabled for these frames"],
4390 },
4391 },
4392 },
4393 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateUF, 'target'),
4394 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'target'),
4395 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'target'),
4396 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'target'),
4397 power = GetOptionsTable_Power(true, UF.CreateAndUpdateUF, 'target', nil, true),
4398 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'target'),
4399 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'target'),
4400 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'target'),
4401 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'target'),
4402 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'target'),
4403 castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateUF, 'target'),
4404 aurabar = GetOptionsTable_AuraBars(UF.CreateAndUpdateUF, 'target'),
4405 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, 'target'),
4406 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'target'),
4407 pvpIcon = {
4408 order = 449,
4409 type = 'group',
4410 name = L["PvP & Prestige Icon"],
4411 get = function(info) return E.db.unitframe.units.target.pvpIcon[info[#info]] end,
4412 set = function(info, value) E.db.unitframe.units.target.pvpIcon[info[#info]] = value; UF:CreateAndUpdateUF('target') end,
4413 args = {
4414 header = {
4415 order = 1,
4416 type = "header",
4417 name = L["PvP & Prestige Icon"],
4418 },
4419 enable = {
4420 order = 2,
4421 type = "toggle",
4422 name = L["Enable"],
4423 },
4424 scale = {
4425 order = 3,
4426 type = "range",
4427 name = L["Scale"],
4428 isPercent = true,
4429 min = 0.1, max = 2, step = 0.01,
4430 },
4431 spacer = {
4432 order = 4,
4433 type = "description",
4434 name = " ",
4435 },
4436 anchorPoint = {
4437 order = 5,
4438 type = "select",
4439 name = L["Anchor Point"],
4440 values = positionValues,
4441 },
4442 xOffset = {
4443 order = 6,
4444 type = "range",
4445 name = L["X-Offset"],
4446 min = -100, max = 100, step = 1,
4447 },
4448 yOffset = {
4449 order = 7,
4450 type = "range",
4451 name = L["Y-Offset"],
4452 min = -100, max = 100, step = 1,
4453 },
4454 },
4455 },
4456 phaseIndicator = {
4457 order = 450,
4458 type = 'group',
4459 name = L["Phase Indicator"],
4460 get = function(info) return E.db.unitframe.units.target.phaseIndicator[info[#info]] end,
4461 set = function(info, value) E.db.unitframe.units.target.phaseIndicator[info[#info]] = value; UF:CreateAndUpdateUF('target') end,
4462 args = {
4463 header = {
4464 order = 1,
4465 type = "header",
4466 name = L["Phase Indicator"],
4467 },
4468 enable = {
4469 order = 2,
4470 type = "toggle",
4471 name = L["Enable"],
4472 },
4473 scale = {
4474 order = 3,
4475 type = "range",
4476 name = L["Scale"],
4477 isPercent = true,
4478 min = 0.5, max = 1.5, step = 0.01,
4479 },
4480 spacer = {
4481 order = 4,
4482 type = "description",
4483 name = " ",
4484 },
4485 anchorPoint = {
4486 order = 5,
4487 type = "select",
4488 name = L["Anchor Point"],
4489 values = positionValues,
4490 },
4491 xOffset = {
4492 order = 6,
4493 type = "range",
4494 name = L["X-Offset"],
4495 min = -100, max = 100, step = 1,
4496 },
4497 yOffset = {
4498 order = 7,
4499 type = "range",
4500 name = L["Y-Offset"],
4501 min = -100, max = 100, step = 1,
4502 },
4503 },
4504 },
4505 },
4506}
4507
4508--TargetTarget
4509E.Options.args.unitframe.args.targettarget = {
4510 name = L["TargetTarget"],
4511 type = 'group',
4512 order = 500,
4513 childGroups = "tab",
4514 get = function(info) return E.db.unitframe.units.targettarget[info[#info]] end,
4515 set = function(info, value) E.db.unitframe.units.targettarget[info[#info]] = value; UF:CreateAndUpdateUF('targettarget') end,
4516 disabled = function() return not E.UnitFrames.Initialized end,
4517 args = {
4518 enable = {
4519 type = 'toggle',
4520 order = 1,
4521 name = L["Enable"],
4522 },
4523 showAuras = {
4524 order = 2,
4525 type = 'execute',
4526 name = L["Show Auras"],
4527 func = function()
4528 local frame = ElvUF_TargetTarget
4529 if frame.forceShowAuras then
4530 frame.forceShowAuras = nil;
4531 else
4532 frame.forceShowAuras = true;
4533 end
4534
4535 UF:CreateAndUpdateUF('targettarget')
4536 end,
4537 },
4538 resetSettings = {
4539 type = 'execute',
4540 order = 3,
4541 name = L["Restore Defaults"],
4542 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["TargetTarget Frame"], nil, {unit='targettarget', mover='TargetTarget Frame'}) end,
4543 },
4544 copyFrom = {
4545 type = 'select',
4546 order = 4,
4547 name = L["Copy From"],
4548 desc = L["Select a unit to copy settings from."],
4549 values = UF.units,
4550 set = function(info, value) UF:MergeUnitSettings(value, 'targettarget'); end,
4551 },
4552 generalGroup = {
4553 order = 5,
4554 type = "group",
4555 name = L["General"],
4556 args = {
4557 header = {
4558 order = 1,
4559 type = "header",
4560 name = L["General"],
4561 },
4562 width = {
4563 order = 3,
4564 name = L["Width"],
4565 type = 'range',
4566 min = 50, max = 1000, step = 1,
4567 },
4568 height = {
4569 order = 4,
4570 name = L["Height"],
4571 type = 'range',
4572 min = 10, max = 500, step = 1,
4573 },
4574 hideonnpc = {
4575 type = 'toggle',
4576 order = 6,
4577 name = L["Text Toggle On NPC"],
4578 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4579 get = function(info) return E.db.unitframe.units.targettarget.power.hideonnpc end,
4580 set = function(info, value) E.db.unitframe.units.targettarget.power.hideonnpc = value; UF:CreateAndUpdateUF('targettarget') end,
4581 },
4582 smartAuraPosition = {
4583 order = 8,
4584 type = "select",
4585 name = L["Smart Aura Position"],
4586 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
4587 values = {
4588 ["DISABLED"] = L["DISABLE"],
4589 ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
4590 ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
4591 },
4592 },
4593 orientation = {
4594 order = 9,
4595 type = "select",
4596 name = L["Frame Orientation"],
4597 desc = L["Set the orientation of the UnitFrame."],
4598 values = orientationValues,
4599 },
4600 colorOverride = {
4601 order = 10,
4602 name = L["Class Color Override"],
4603 desc = L["Override the default class color setting."],
4604 type = 'select',
4605 values = colorOverrideValues,
4606 },
4607 spacer = {
4608 order = 11,
4609 type = "description",
4610 name = "",
4611 },
4612 disableMouseoverGlow = {
4613 order = 12,
4614 type = "toggle",
4615 name = L["Block Mouseover Glow"],
4616 desc = L["Forces Mouseover Glow to be disabled for these frames"],
4617 },
4618 disableTargetGlow = {
4619 order = 13,
4620 type = "toggle",
4621 name = L["Block Target Glow"],
4622 desc = L["Forces Target Glow to be disabled for these frames"],
4623 },
4624 },
4625 },
4626 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'targettarget'),
4627 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'targettarget'),
4628 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'targettarget'),
4629 power = GetOptionsTable_Power(nil, UF.CreateAndUpdateUF, 'targettarget'),
4630 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'targettarget'),
4631 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'targettarget'),
4632 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'targettarget'),
4633 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'targettarget'),
4634 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'targettarget'),
4635 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, 'targettarget'),
4636 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'targettarget'),
4637 },
4638}
4639
4640--TargetTargetTarget
4641E.Options.args.unitframe.args.targettargettarget = {
4642 name = L["TargetTargetTarget"],
4643 type = 'group',
4644 order = 500,
4645 childGroups = "tab",
4646 get = function(info) return E.db.unitframe.units.targettargettarget[info[#info]] end,
4647 set = function(info, value) E.db.unitframe.units.targettargettarget[info[#info]] = value; UF:CreateAndUpdateUF('targettargettarget') end,
4648 disabled = function() return not E.UnitFrames.Initialized end,
4649 args = {
4650 enable = {
4651 type = 'toggle',
4652 order = 1,
4653 name = L["Enable"],
4654 },
4655 showAuras = {
4656 order = 2,
4657 type = 'execute',
4658 name = L["Show Auras"],
4659 func = function()
4660 local frame = ElvUF_TargetTargetTarget
4661 if frame.forceShowAuras then
4662 frame.forceShowAuras = nil;
4663 else
4664 frame.forceShowAuras = true;
4665 end
4666
4667 UF:CreateAndUpdateUF('targettargettarget')
4668 end,
4669 },
4670 resetSettings = {
4671 type = 'execute',
4672 order = 3,
4673 name = L["Restore Defaults"],
4674 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["TargetTargetTarget Frame"], nil, {unit='targettargettarget', mover='TargetTargetTarget Frame'}) end,
4675 },
4676 copyFrom = {
4677 type = 'select',
4678 order = 4,
4679 name = L["Copy From"],
4680 desc = L["Select a unit to copy settings from."],
4681 values = UF.units,
4682 set = function(info, value) UF:MergeUnitSettings(value, 'targettargettarget'); end,
4683 },
4684 generalGroup = {
4685 order = 5,
4686 type = "group",
4687 name = L["General"],
4688 args = {
4689 header = {
4690 order = 1,
4691 type = "header",
4692 name = L["General"],
4693 },
4694 width = {
4695 order = 3,
4696 name = L["Width"],
4697 type = 'range',
4698 min = 50, max = 1000, step = 1,
4699 },
4700 height = {
4701 order = 4,
4702 name = L["Height"],
4703 type = 'range',
4704 min = 10, max = 500, step = 1,
4705 },
4706 hideonnpc = {
4707 type = 'toggle',
4708 order = 6,
4709 name = L["Text Toggle On NPC"],
4710 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4711 get = function(info) return E.db.unitframe.units.targettargettarget.power.hideonnpc end,
4712 set = function(info, value) E.db.unitframe.units.targettargettarget.power.hideonnpc = value; UF:CreateAndUpdateUF('targettargettarget') end,
4713 },
4714 smartAuraPosition = {
4715 order = 8,
4716 type = "select",
4717 name = L["Smart Aura Position"],
4718 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
4719 values = smartAuraPositionValues,
4720 },
4721 orientation = {
4722 order = 9,
4723 type = "select",
4724 name = L["Frame Orientation"],
4725 desc = L["Set the orientation of the UnitFrame."],
4726 values = orientationValues,
4727 },
4728 colorOverride = {
4729 order = 10,
4730 name = L["Class Color Override"],
4731 desc = L["Override the default class color setting."],
4732 type = 'select',
4733 values = colorOverrideValues,
4734 },
4735 spacer = {
4736 order = 11,
4737 type = "description",
4738 name = "",
4739 },
4740 disableMouseoverGlow = {
4741 order = 12,
4742 type = "toggle",
4743 name = L["Block Mouseover Glow"],
4744 desc = L["Forces Mouseover Glow to be disabled for these frames"],
4745 },
4746 disableTargetGlow = {
4747 order = 13,
4748 type = "toggle",
4749 name = L["Block Target Glow"],
4750 desc = L["Forces Target Glow to be disabled for these frames"],
4751 },
4752 },
4753 },
4754 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'targettargettarget'),
4755 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'targettargettarget'),
4756 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'targettargettarget'),
4757 power = GetOptionsTable_Power(nil, UF.CreateAndUpdateUF, 'targettargettarget'),
4758 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'targettargettarget'),
4759 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'targettargettarget'),
4760 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'targettargettarget'),
4761 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'targettargettarget'),
4762 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'targettargettarget'),
4763 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, 'targettargettarget'),
4764 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'targettargettarget'),
4765 },
4766}
4767
4768--Pet
4769E.Options.args.unitframe.args.pet = {
4770 name = L["PET"],
4771 type = 'group',
4772 order = 800,
4773 childGroups = "tab",
4774 get = function(info) return E.db.unitframe.units.pet[info[#info]] end,
4775 set = function(info, value) E.db.unitframe.units.pet[info[#info]] = value; UF:CreateAndUpdateUF('pet') end,
4776 disabled = function() return not E.UnitFrames.Initialized end,
4777 args = {
4778 enable = {
4779 type = 'toggle',
4780 order = 1,
4781 name = L["Enable"],
4782 },
4783 showAuras = {
4784 order = 2,
4785 type = 'execute',
4786 name = L["Show Auras"],
4787 func = function()
4788 local frame = ElvUF_Pet
4789 if frame.forceShowAuras then
4790 frame.forceShowAuras = nil;
4791 else
4792 frame.forceShowAuras = true;
4793 end
4794
4795 UF:CreateAndUpdateUF('pet')
4796 end,
4797 },
4798 resetSettings = {
4799 type = 'execute',
4800 order = 3,
4801 name = L["Restore Defaults"],
4802 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Pet Frame"], nil, {unit='pet', mover='Pet Frame'}) end,
4803 },
4804 copyFrom = {
4805 type = 'select',
4806 order = 4,
4807 name = L["Copy From"],
4808 desc = L["Select a unit to copy settings from."],
4809 values = UF.units,
4810 set = function(info, value) UF:MergeUnitSettings(value, 'pet'); end,
4811 },
4812 generalGroup = {
4813 order = 5,
4814 type = "group",
4815 name = L["General"],
4816 args = {
4817 header = {
4818 order = 1,
4819 type = "header",
4820 name = L["General"],
4821 },
4822 width = {
4823 order = 3,
4824 name = L["Width"],
4825 type = 'range',
4826 min = 50, max = 1000, step = 1,
4827 },
4828 height = {
4829 order = 4,
4830 name = L["Height"],
4831 type = 'range',
4832 min = 10, max = 500, step = 1,
4833 },
4834 hideonnpc = {
4835 type = 'toggle',
4836 order = 6,
4837 name = L["Text Toggle On NPC"],
4838 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4839 get = function(info) return E.db.unitframe.units.pet.power.hideonnpc end,
4840 set = function(info, value) E.db.unitframe.units.pet.power.hideonnpc = value; UF:CreateAndUpdateUF('pet') end,
4841 },
4842 smartAuraPosition = {
4843 order = 8,
4844 type = "select",
4845 name = L["Smart Aura Position"],
4846 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
4847 values = smartAuraPositionValues,
4848 },
4849 orientation = {
4850 order = 9,
4851 type = "select",
4852 name = L["Frame Orientation"],
4853 desc = L["Set the orientation of the UnitFrame."],
4854 values = orientationValues,
4855 },
4856 colorOverride = {
4857 order = 10,
4858 name = L["Class Color Override"],
4859 desc = L["Override the default class color setting."],
4860 type = 'select',
4861 values = colorOverrideValues,
4862 },
4863 disableMouseoverGlow = {
4864 order = 11,
4865 type = "toggle",
4866 name = L["Block Mouseover Glow"],
4867 desc = L["Forces Mouseover Glow to be disabled for these frames"],
4868 },
4869 disableTargetGlow = {
4870 order = 12,
4871 type = "toggle",
4872 name = L["Block Target Glow"],
4873 desc = L["Forces Target Glow to be disabled for these frames"],
4874 },
4875 },
4876 },
4877 buffIndicator = {
4878 order = 600,
4879 type = 'group',
4880 name = L["Buff Indicator"],
4881 get = function(info) return E.db.unitframe.units.pet.buffIndicator[info[#info]] end,
4882 set = function(info, value) E.db.unitframe.units.pet.buffIndicator[info[#info]] = value; UF:CreateAndUpdateUF('pet') end,
4883 args = {
4884 header = {
4885 order = 1,
4886 type = "header",
4887 name = L["Buff Indicator"],
4888 },
4889 enable = {
4890 type = 'toggle',
4891 name = L["Enable"],
4892 order = 2,
4893 },
4894 size = {
4895 type = 'range',
4896 name = L["Size"],
4897 desc = L["Size of the indicator icon."],
4898 order = 3,
4899 min = 4, max = 50, step = 1,
4900 },
4901 fontSize = {
4902 type = 'range',
4903 name = L["FONT_SIZE"],
4904 order = 4,
4905 min = 7, max = 212, step = 1,
4906 },
4907 },
4908 },
4909 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateUF, 'pet'),
4910 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'pet'),
4911 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'pet'),
4912 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'pet'),
4913 power = GetOptionsTable_Power(false, UF.CreateAndUpdateUF, 'pet'),
4914 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'pet'),
4915 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'pet'),
4916 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'pet'),
4917 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'pet'),
4918 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'pet'),
4919 castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateUF, 'pet'),
4920 aurabar = GetOptionsTable_AuraBars(UF.CreateAndUpdateUF, 'pet'),
4921 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'pet'),
4922 },
4923}
4924
4925--Pet Target
4926E.Options.args.unitframe.args.pettarget = {
4927 name = L["PetTarget"],
4928 type = 'group',
4929 order = 900,
4930 childGroups = "tab",
4931 get = function(info) return E.db.unitframe.units.pettarget[info[#info]] end,
4932 set = function(info, value) E.db.unitframe.units.pettarget[info[#info]] = value; UF:CreateAndUpdateUF('pettarget') end,
4933 disabled = function() return not E.UnitFrames.Initialized end,
4934 args = {
4935 enable = {
4936 type = 'toggle',
4937 order = 1,
4938 name = L["Enable"],
4939 },
4940 showAuras = {
4941 order = 2,
4942 type = 'execute',
4943 name = L["Show Auras"],
4944 func = function()
4945 local frame = ElvUF_PetTarget
4946 if frame.forceShowAuras then
4947 frame.forceShowAuras = nil;
4948 else
4949 frame.forceShowAuras = true;
4950 end
4951
4952 UF:CreateAndUpdateUF('pettarget')
4953 end,
4954 },
4955 resetSettings = {
4956 type = 'execute',
4957 order = 3,
4958 name = L["Restore Defaults"],
4959 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["PetTarget Frame"], nil, {unit='pettarget', mover='PetTarget Frame'}) end,
4960 },
4961 copyFrom = {
4962 type = 'select',
4963 order = 4,
4964 name = L["Copy From"],
4965 desc = L["Select a unit to copy settings from."],
4966 values = UF.units,
4967 set = function(info, value) UF:MergeUnitSettings(value, 'pettarget'); end,
4968 },
4969 generalGroup = {
4970 order = 5,
4971 type = "group",
4972 name = L["General"],
4973 args = {
4974 header = {
4975 order = 1,
4976 type = "header",
4977 name = L["General"],
4978 },
4979 width = {
4980 order = 3,
4981 name = L["Width"],
4982 type = 'range',
4983 min = 50, max = 1000, step = 1,
4984 },
4985 height = {
4986 order = 4,
4987 name = L["Height"],
4988 type = 'range',
4989 min = 10, max = 500, step = 1,
4990 },
4991 hideonnpc = {
4992 type = 'toggle',
4993 order = 6,
4994 name = L["Text Toggle On NPC"],
4995 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4996 get = function(info) return E.db.unitframe.units.pettarget.power.hideonnpc end,
4997 set = function(info, value) E.db.unitframe.units.pettarget.power.hideonnpc = value; UF:CreateAndUpdateUF('pettarget') end,
4998 },
4999 smartAuraPosition = {
5000 order = 8,
5001 type = "select",
5002 name = L["Smart Aura Position"],
5003 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
5004 values = smartAuraPositionValues,
5005 },
5006 orientation = {
5007 order = 9,
5008 type = "select",
5009 name = L["Frame Orientation"],
5010 desc = L["Set the orientation of the UnitFrame."],
5011 values = orientationValues,
5012 },
5013 colorOverride = {
5014 order = 10,
5015 name = L["Class Color Override"],
5016 desc = L["Override the default class color setting."],
5017 type = 'select',
5018 values = colorOverrideValues,
5019 },
5020 spacer = {
5021 order = 11,
5022 type = "description",
5023 name = "",
5024 },
5025 disableMouseoverGlow = {
5026 order = 12,
5027 type = "toggle",
5028 name = L["Block Mouseover Glow"],
5029 desc = L["Forces Mouseover Glow to be disabled for these frames"],
5030 },
5031 disableTargetGlow = {
5032 order = 13,
5033 type = "toggle",
5034 name = L["Block Target Glow"],
5035 desc = L["Forces Target Glow to be disabled for these frames"],
5036 },
5037 },
5038 },
5039 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'pettarget'),
5040 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'pettarget'),
5041 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'pettarget'),
5042 power = GetOptionsTable_Power(false, UF.CreateAndUpdateUF, 'pettarget'),
5043 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'pettarget'),
5044 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'pettarget'),
5045 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'pettarget'),
5046 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'pettarget'),
5047 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'pettarget'),
5048 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'pettarget')
5049 },
5050}
5051
5052--Party Frames
5053E.Options.args.unitframe.args.party = {
5054 name = L["PARTY"],
5055 type = 'group',
5056 order = 1100,
5057 childGroups = "tab",
5058 get = function(info) return E.db.unitframe.units.party[info[#info]] end,
5059 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5060 disabled = function() return not E.UnitFrames.Initialized end,
5061 args = {
5062 enable = {
5063 type = 'toggle',
5064 order = 1,
5065 name = L["Enable"],
5066 },
5067 configureToggle = {
5068 order = 2,
5069 type = 'execute',
5070 name = L["Display Frames"],
5071 func = function()
5072 UF:HeaderConfig(ElvUF_Party, ElvUF_Party.forceShow ~= true or nil)
5073 end,
5074 },
5075 resetSettings = {
5076 type = 'execute',
5077 order = 3,
5078 name = L["Restore Defaults"],
5079 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Party Frames"], nil, {unit='party', mover='Party Frames'}) end,
5080 },
5081 copyFrom = {
5082 type = 'select',
5083 order = 4,
5084 name = L["Copy From"],
5085 desc = L["Select a unit to copy settings from."],
5086 values = {
5087 ['raid'] = L["Raid Frames"],
5088 ['raid40'] = L["Raid40 Frames"],
5089 },
5090 set = function(info, value) UF:MergeUnitSettings(value, 'party', true); end,
5091 },
5092 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateHeaderGroup, 'party'),
5093 generalGroup = {
5094 order = 6,
5095 type = 'group',
5096 name = L["General"],
5097 args = {
5098 header = {
5099 order = 1,
5100 type = "header",
5101 name = L["General"],
5102 },
5103 hideonnpc = {
5104 type = 'toggle',
5105 order = 3,
5106 name = L["Text Toggle On NPC"],
5107 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
5108 get = function(info) return E.db.unitframe.units.party.power.hideonnpc end,
5109 set = function(info, value) E.db.unitframe.units.party.power.hideonnpc = value; UF:CreateAndUpdateHeaderGroup('party'); end,
5110 },
5111 colorOverride = {
5112 order = 7,
5113 name = L["Class Color Override"],
5114 desc = L["Override the default class color setting."],
5115 type = 'select',
5116 values = colorOverrideValues,
5117 },
5118 orientation = {
5119 order = 8,
5120 type = "select",
5121 name = L["Frame Orientation"],
5122 desc = L["Set the orientation of the UnitFrame."],
5123 values = orientationValues,
5124 },
5125 disableMouseoverGlow = {
5126 order = 9,
5127 type = "toggle",
5128 name = L["Block Mouseover Glow"],
5129 desc = L["Forces Mouseover Glow to be disabled for these frames"],
5130 },
5131 disableTargetGlow = {
5132 order = 10,
5133 type = "toggle",
5134 name = L["Block Target Glow"],
5135 desc = L["Forces Target Glow to be disabled for these frames"],
5136 },
5137 positionsGroup = {
5138 order = 100,
5139 name = L["Size and Positions"],
5140 type = 'group',
5141 guiInline = true,
5142 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party', nil, nil, true) end,
5143 args = {
5144 width = {
5145 order = 1,
5146 name = L["Width"],
5147 type = 'range',
5148 min = 10, max = 500, step = 1,
5149 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5150 },
5151 height = {
5152 order = 2,
5153 name = L["Height"],
5154 type = 'range',
5155 min = 10, max = 500, step = 1,
5156 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5157 },
5158 spacer = {
5159 order = 3,
5160 name = '',
5161 type = 'description',
5162 width = 'full',
5163 },
5164 growthDirection = {
5165 order = 4,
5166 name = L["Growth Direction"],
5167 desc = L["Growth direction from the first unitframe."],
5168 type = 'select',
5169 values = growthDirectionValues,
5170 },
5171 numGroups = {
5172 order = 7,
5173 type = 'range',
5174 name = L["Number of Groups"],
5175 min = 1, max = 8, step = 1,
5176 set = function(info, value)
5177 E.db.unitframe.units.party[info[#info]] = value;
5178 UF:CreateAndUpdateHeaderGroup('party')
5179 if ElvUF_Party.isForced then
5180 UF:HeaderConfig(ElvUF_Party)
5181 UF:HeaderConfig(ElvUF_Party, true)
5182 end
5183 end,
5184 },
5185 groupsPerRowCol = {
5186 order = 8,
5187 type = 'range',
5188 name = L["Groups Per Row/Column"],
5189 min = 1, max = 8, step = 1,
5190 set = function(info, value)
5191 E.db.unitframe.units.party[info[#info]] = value;
5192 UF:CreateAndUpdateHeaderGroup('party')
5193 if ElvUF_Party.isForced then
5194 UF:HeaderConfig(ElvUF_Party)
5195 UF:HeaderConfig(ElvUF_Party, true)
5196 end
5197 end,
5198 },
5199 horizontalSpacing = {
5200 order = 9,
5201 type = 'range',
5202 name = L["Horizontal Spacing"],
5203 min = -1, max = 50, step = 1,
5204 },
5205 verticalSpacing = {
5206 order = 10,
5207 type = 'range',
5208 name = L["Vertical Spacing"],
5209 min = -1, max = 50, step = 1,
5210 },
5211 groupSpacing = {
5212 order = 11,
5213 type = "range",
5214 name = L["Group Spacing"],
5215 desc = L["Additional spacing between each individual group."],
5216 min = 0, softMax = 50, step = 1,
5217 },
5218 },
5219 },
5220 visibilityGroup = {
5221 order = 200,
5222 name = L["Visibility"],
5223 type = 'group',
5224 guiInline = true,
5225 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party', nil, nil, true) end,
5226 args = {
5227 showPlayer = {
5228 order = 1,
5229 type = 'toggle',
5230 name = L["Display Player"],
5231 desc = L["When true, the header includes the player when not in a raid."],
5232 },
5233 visibility = {
5234 order = 2,
5235 type = 'input',
5236 name = L["Visibility"],
5237 desc = L["The following macro must be true in order for the group to be shown, in addition to any filter that may already be set."],
5238 width = 'full',
5239 },
5240 },
5241 },
5242 sortingGroup = {
5243 order = 300,
5244 type = 'group',
5245 guiInline = true,
5246 name = L["Grouping & Sorting"],
5247 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party', nil, nil, true) end,
5248 args = {
5249 groupBy = {
5250 order = 1,
5251 name = L["Group By"],
5252 desc = L["Set the order that the group will sort."],
5253 type = 'select',
5254 values = {
5255 ['CLASS'] = L["CLASS"],
5256 ['CLASSROLE'] = L["CLASS"]..' & '..L["ROLE"],
5257 ['ROLE'] = L["Role: Tank, Healer, Damage"],
5258 ['ROLE2'] = L["Role: Tank, Damage, Healer"],
5259 ['NAME'] = L["NAME"],
5260 ['MTMA'] = L["Main Tanks / Main Assist"],
5261 ['GROUP'] = L["GROUP"],
5262 },
5263 },
5264 sortDir = {
5265 order = 2,
5266 name = L["Sort Direction"],
5267 desc = L["Defines the sort order of the selected sort method."],
5268 type = 'select',
5269 values = {
5270 ['ASC'] = L["Ascending"],
5271 ['DESC'] = L["Descending"]
5272 },
5273 },
5274 spacer = {
5275 order = 3,
5276 type = 'description',
5277 width = 'full',
5278 name = ' '
5279 },
5280 raidWideSorting = {
5281 order = 4,
5282 name = L["Raid-Wide Sorting"],
5283 desc = L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."],
5284 type = 'toggle',
5285 },
5286 invertGroupingOrder = {
5287 order = 5,
5288 name = L["Invert Grouping Order"],
5289 desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."],
5290 disabled = function() return not E.db.unitframe.units.party.raidWideSorting end,
5291 type = 'toggle',
5292 },
5293 startFromCenter = {
5294 order = 6,
5295 name = L["Start Near Center"],
5296 desc = L["The initial group will start near the center and grow out."],
5297 disabled = function() return not E.db.unitframe.units.party.raidWideSorting end,
5298 type = 'toggle',
5299 },
5300 },
5301 },
5302 },
5303 },
5304 buffIndicator = {
5305 order = 701,
5306 type = 'group',
5307 name = L["Buff Indicator"],
5308 get = function(info) return E.db.unitframe.units.party.buffIndicator[info[#info]] end,
5309 set = function(info, value) E.db.unitframe.units.party.buffIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5310 args = {
5311 header = {
5312 order = 1,
5313 type = "header",
5314 name = L["Buff Indicator"],
5315 },
5316 enable = {
5317 type = 'toggle',
5318 name = L["Enable"],
5319 order = 2,
5320 },
5321 size = {
5322 type = 'range',
5323 name = L["Size"],
5324 desc = L["Size of the indicator icon."],
5325 order = 3,
5326 min = 4, max = 50, step = 1,
5327 },
5328 fontSize = {
5329 type = 'range',
5330 name = L["FONT_SIZE"],
5331 order = 4,
5332 min = 7, max = 212, step = 1,
5333 },
5334 profileSpecific = {
5335 type = 'toggle',
5336 name = L["Profile Specific"],
5337 desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
5338 order = 5,
5339 },
5340 configureButton = {
5341 type = 'execute',
5342 name = L["Configure Auras"],
5343 func = function()
5344 if E.db.unitframe.units.party.buffIndicator.profileSpecific then
5345 E:SetToFilterConfig('Buff Indicator (Profile)')
5346 else
5347 E:SetToFilterConfig('Buff Indicator')
5348 end
5349 end,
5350 order = 6
5351 },
5352 },
5353 },
5354 raidRoleIcons = {
5355 order = 703,
5356 type = 'group',
5357 name = L["RL Icon"],
5358 get = function(info) return E.db.unitframe.units.party.raidRoleIcons[info[#info]] end,
5359 set = function(info, value) E.db.unitframe.units.party.raidRoleIcons[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5360 args = {
5361 header = {
5362 order = 1,
5363 type = "header",
5364 name = L["RL Icon"],
5365 },
5366 enable = {
5367 type = 'toggle',
5368 name = L["Enable"],
5369 order = 2,
5370 },
5371 position = {
5372 type = 'select',
5373 order = 3,
5374 name = L["Position"],
5375 values = {
5376 ['TOPLEFT'] = 'TOPLEFT',
5377 ['TOPRIGHT'] = 'TOPRIGHT',
5378 },
5379 },
5380 },
5381 },
5382 health = GetOptionsTable_Health(true, UF.CreateAndUpdateHeaderGroup, 'party'),
5383 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateHeaderGroup, 'party'),
5384 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateHeaderGroup, 'party'),
5385 power = GetOptionsTable_Power(false, UF.CreateAndUpdateHeaderGroup, 'party'),
5386 name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, 'party'),
5387 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateHeaderGroup, 'party'),
5388 fader = GetOptionsTable_Fader(UF.CreateAndUpdateHeaderGroup, 'party'),
5389 buffs = GetOptionsTable_Auras('buffs', true, UF.CreateAndUpdateHeaderGroup, 'party'),
5390 debuffs = GetOptionsTable_Auras('debuffs', true, UF.CreateAndUpdateHeaderGroup, 'party'),
5391 rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, 'party'),
5392 castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateHeaderGroup, 'party', 5),
5393 petsGroup = {
5394 order = 850,
5395 type = 'group',
5396 name = L["Party Pets"],
5397 get = function(info) return E.db.unitframe.units.party.petsGroup[info[#info]] end,
5398 set = function(info, value) E.db.unitframe.units.party.petsGroup[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5399 args = {
5400 header = {
5401 order = 1,
5402 type = "header",
5403 name = L["Party Pets"],
5404 },
5405 enable = {
5406 type = 'toggle',
5407 name = L["Enable"],
5408 order = 2,
5409 },
5410 width = {
5411 order = 3,
5412 name = L["Width"],
5413 type = 'range',
5414 min = 10, max = 500, step = 1,
5415 },
5416 height = {
5417 order = 4,
5418 name = L["Height"],
5419 type = 'range',
5420 min = 10, max = 500, step = 1,
5421 },
5422 anchorPoint = {
5423 type = 'select',
5424 order = 5,
5425 name = L["Anchor Point"],
5426 desc = L["What point to anchor to the frame you set to attach to."],
5427 values = petAnchors,
5428 },
5429 xOffset = {
5430 order = 6,
5431 type = 'range',
5432 name = L["xOffset"],
5433 desc = L["An X offset (in pixels) to be used when anchoring new frames."],
5434 min = -500, max = 500, step = 1,
5435 },
5436 yOffset = {
5437 order = 7,
5438 type = 'range',
5439 name = L["yOffset"],
5440 desc = L["An Y offset (in pixels) to be used when anchoring new frames."],
5441 min = -500, max = 500, step = 1,
5442 },
5443 name = {
5444 order = 8,
5445 type = 'group',
5446 guiInline = true,
5447 get = function(info) return E.db.unitframe.units.party.petsGroup.name[info[#info]] end,
5448 set = function(info, value) E.db.unitframe.units.party.petsGroup.name[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5449 name = L["Name"],
5450 args = {
5451 position = {
5452 type = 'select',
5453 order = 1,
5454 name = L["Text Position"],
5455 values = positionValues,
5456 },
5457 xOffset = {
5458 order = 2,
5459 type = 'range',
5460 name = L["Text xOffset"],
5461 desc = L["Offset position for text."],
5462 min = -300, max = 300, step = 1,
5463 },
5464 yOffset = {
5465 order = 3,
5466 type = 'range',
5467 name = L["Text yOffset"],
5468 desc = L["Offset position for text."],
5469 min = -300, max = 300, step = 1,
5470 },
5471 text_format = {
5472 order = 100,
5473 name = L["Text Format"],
5474 type = 'input',
5475 width = 'full',
5476 desc = L["TEXT_FORMAT_DESC"],
5477 },
5478 },
5479 },
5480 },
5481 },
5482 targetsGroup = {
5483 order = 900,
5484 type = 'group',
5485 name = L["Party Targets"],
5486 get = function(info) return E.db.unitframe.units.party.targetsGroup[info[#info]] end,
5487 set = function(info, value) E.db.unitframe.units.party.targetsGroup[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5488 args = {
5489 header = {
5490 order = 1,
5491 type = "header",
5492 name = L["Party Targets"],
5493 },
5494 enable = {
5495 type = 'toggle',
5496 name = L["Enable"],
5497 order = 2,
5498 },
5499 width = {
5500 order = 3,
5501 name = L["Width"],
5502 type = 'range',
5503 min = 10, max = 500, step = 1,
5504 },
5505 height = {
5506 order = 4,
5507 name = L["Height"],
5508 type = 'range',
5509 min = 10, max = 500, step = 1,
5510 },
5511 anchorPoint = {
5512 type = 'select',
5513 order = 5,
5514 name = L["Anchor Point"],
5515 desc = L["What point to anchor to the frame you set to attach to."],
5516 values = petAnchors,
5517 },
5518 xOffset = {
5519 order = 6,
5520 type = 'range',
5521 name = L["xOffset"],
5522 desc = L["An X offset (in pixels) to be used when anchoring new frames."],
5523 min = -500, max = 500, step = 1,
5524 },
5525 yOffset = {
5526 order = 7,
5527 type = 'range',
5528 name = L["yOffset"],
5529 desc = L["An Y offset (in pixels) to be used when anchoring new frames."],
5530 min = -500, max = 500, step = 1,
5531 },
5532 name = {
5533 order = 8,
5534 type = 'group',
5535 guiInline = true,
5536 get = function(info) return E.db.unitframe.units.party.targetsGroup.name[info[#info]] end,
5537 set = function(info, value) E.db.unitframe.units.party.targetsGroup.name[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5538 name = L["Name"],
5539 args = {
5540 position = {
5541 type = 'select',
5542 order = 1,
5543 name = L["Text Position"],
5544 values = positionValues,
5545 },
5546 xOffset = {
5547 order = 2,
5548 type = 'range',
5549 name = L["Text xOffset"],
5550 desc = L["Offset position for text."],
5551 min = -300, max = 300, step = 1,
5552 },
5553 yOffset = {
5554 order = 3,
5555 type = 'range',
5556 name = L["Text yOffset"],
5557 desc = L["Offset position for text."],
5558 min = -300, max = 300, step = 1,
5559 },
5560 text_format = {
5561 order = 100,
5562 name = L["Text Format"],
5563 type = 'input',
5564 width = 'full',
5565 desc = L["TEXT_FORMAT_DESC"],
5566 },
5567 },
5568 },
5569 },
5570 },
5571 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateHeaderGroup, 'party'),
5572 readycheckIcon = GetOptionsTable_ReadyCheckIcon(UF.CreateAndUpdateHeaderGroup, 'party'),
5573 --resurrectIcon = GetOptionsTable_ResurrectIcon(UF.CreateAndUpdateHeaderGroup, 'party'),
5574 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateHeaderGroup, 'party'),
5575 phaseIndicator = {
5576 order = 5005,
5577 type = 'group',
5578 name = L["Phase Indicator"],
5579 get = function(info) return E.db.unitframe.units.party.phaseIndicator[info[#info]] end,
5580 set = function(info, value) E.db.unitframe.units.party.phaseIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5581 args = {
5582 header = {
5583 order = 1,
5584 type = "header",
5585 name = L["Phase Indicator"],
5586 },
5587 enable = {
5588 order = 2,
5589 type = "toggle",
5590 name = L["Enable"],
5591 },
5592 scale = {
5593 order = 3,
5594 type = "range",
5595 name = L["Scale"],
5596 isPercent = true,
5597 min = 0.5, max = 1.5, step = 0.01,
5598 },
5599 spacer = {
5600 order = 4,
5601 type = "description",
5602 name = " ",
5603 },
5604 anchorPoint = {
5605 order = 5,
5606 type = "select",
5607 name = L["Anchor Point"],
5608 values = positionValues,
5609 },
5610 xOffset = {
5611 order = 6,
5612 type = "range",
5613 name = L["X-Offset"],
5614 min = -100, max = 100, step = 1,
5615 },
5616 yOffset = {
5617 order = 7,
5618 type = "range",
5619 name = L["Y-Offset"],
5620 min = -100, max = 100, step = 1,
5621 },
5622 },
5623 },
5624 },
5625}
5626
5627--Raid Frames
5628E.Options.args.unitframe.args.raid = {
5629 name = L["Raid"],
5630 type = 'group',
5631 order = 1100,
5632 childGroups = "tab",
5633 get = function(info) return E.db.unitframe.units.raid[info[#info]] end,
5634 set = function(info, value) E.db.unitframe.units.raid[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid') end,
5635 disabled = function() return not E.UnitFrames.Initialized end,
5636 args = {
5637 enable = {
5638 type = 'toggle',
5639 order = 1,
5640 name = L["Enable"],
5641 },
5642 configureToggle = {
5643 order = 2,
5644 type = 'execute',
5645 name = L["Display Frames"],
5646 func = function()
5647 UF:HeaderConfig(_G.ElvUF_Raid, _G.ElvUF_Raid.forceShow ~= true or nil)
5648 end,
5649 },
5650 resetSettings = {
5651 type = 'execute',
5652 order = 3,
5653 name = L["Restore Defaults"],
5654 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Raid Frames"], nil, {unit='raid', mover='Raid Frames'}) end,
5655 },
5656 copyFrom = {
5657 type = 'select',
5658 order = 4,
5659 name = L["Copy From"],
5660 desc = L["Select a unit to copy settings from."],
5661 values = {
5662 ['party'] = L["Party Frames"],
5663 ['raid40'] = L["Raid40 Frames"],
5664 },
5665 set = function(info, value) UF:MergeUnitSettings(value, 'raid', true); end,
5666 },
5667 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateHeaderGroup, 'raid'),
5668 generalGroup = {
5669 order = 6,
5670 type = 'group',
5671 name = L["General"],
5672 args = {
5673 header = {
5674 order = 1,
5675 type = "header",
5676 name = L["General"],
5677 },
5678 hideonnpc = {
5679 type = 'toggle',
5680 order = 3,
5681 name = L["Text Toggle On NPC"],
5682 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
5683 get = function(info) return E.db.unitframe.units.raid.power.hideonnpc end,
5684 set = function(info, value) E.db.unitframe.units.raid.power.hideonnpc = value; UF:CreateAndUpdateHeaderGroup('raid'); end,
5685 },
5686 colorOverride = {
5687 order = 7,
5688 name = L["Class Color Override"],
5689 desc = L["Override the default class color setting."],
5690 type = 'select',
5691 values = colorOverrideValues,
5692 },
5693 orientation = {
5694 order = 8,
5695 type = "select",
5696 name = L["Frame Orientation"],
5697 desc = L["Set the orientation of the UnitFrame."],
5698 values = orientationValues,
5699 },
5700 disableMouseoverGlow = {
5701 order = 9,
5702 type = "toggle",
5703 name = L["Block Mouseover Glow"],
5704 desc = L["Forces Mouseover Glow to be disabled for these frames"],
5705 },
5706 disableTargetGlow = {
5707 order = 10,
5708 type = "toggle",
5709 name = L["Block Target Glow"],
5710 desc = L["Forces Target Glow to be disabled for these frames"],
5711 },
5712 positionsGroup = {
5713 order = 100,
5714 name = L["Size and Positions"],
5715 type = 'group',
5716 guiInline = true,
5717 set = function(info, value) E.db.unitframe.units.raid[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid', nil, nil, true) end,
5718 args = {
5719 width = {
5720 order = 1,
5721 name = L["Width"],
5722 type = 'range',
5723 min = 10, max = 500, step = 1,
5724 set = function(info, value) E.db.unitframe.units.raid[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid') end,
5725 },
5726 height = {
5727 order = 2,
5728 name = L["Height"],
5729 type = 'range',
5730 min = 10, max = 500, step = 1,
5731 set = function(info, value) E.db.unitframe.units.raid[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid') end,
5732 },
5733 spacer = {
5734 order = 3,
5735 name = '',
5736 type = 'description',
5737 width = 'full',
5738 },
5739 growthDirection = {
5740 order = 4,
5741 name = L["Growth Direction"],
5742 desc = L["Growth direction from the first unitframe."],
5743 type = 'select',
5744 values = growthDirectionValues,
5745 },
5746 numGroups = {
5747 order = 7,
5748 type = 'range',
5749 name = L["Number of Groups"],
5750 min = 1, max = 8, step = 1,
5751 set = function(info, value)
5752 E.db.unitframe.units.raid[info[#info]] = value;
5753 UF:CreateAndUpdateHeaderGroup('raid')
5754 if _G.ElvUF_Raid.isForced then
5755 UF:HeaderConfig(_G.ElvUF_Raid)
5756 UF:HeaderConfig(_G.ElvUF_Raid, true)
5757 end
5758 end,
5759 },
5760 groupsPerRowCol = {
5761 order = 8,
5762 type = 'range',
5763 name = L["Groups Per Row/Column"],
5764 min = 1, max = 8, step = 1,
5765 set = function(info, value)
5766 E.db.unitframe.units.raid[info[#info]] = value;
5767 UF:CreateAndUpdateHeaderGroup('raid')
5768 if _G.ElvUF_Raid.isForced then
5769 UF:HeaderConfig(_G.ElvUF_Raid)
5770 UF:HeaderConfig(_G.ElvUF_Raid, true)
5771 end
5772 end,
5773 },
5774 horizontalSpacing = {
5775 order = 9,
5776 type = 'range',
5777 name = L["Horizontal Spacing"],
5778 min = -1, max = 50, step = 1,
5779 },
5780 verticalSpacing = {
5781 order = 10,
5782 type = 'range',
5783 name = L["Vertical Spacing"],
5784 min = -1, max = 50, step = 1,
5785 },
5786 groupSpacing = {
5787 order = 11,
5788 type = "range",
5789 name = L["Group Spacing"],
5790 desc = L["Additional spacing between each individual group."],
5791 min = 0, softMax = 50, step = 1,
5792 },
5793 },
5794 },
5795 visibilityGroup = {
5796 order = 200,
5797 name = L["Visibility"],
5798 type = 'group',
5799 guiInline = true,
5800 set = function(info, value) E.db.unitframe.units.raid[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid', nil, nil, true) end,
5801 args = {
5802 showPlayer = {
5803 order = 1,
5804 type = 'toggle',
5805 name = L["Display Player"],
5806 desc = L["When true, the header includes the player when not in a raid."],
5807 },
5808 visibility = {
5809 order = 2,
5810 type = 'input',
5811 name = L["Visibility"],
5812 desc = L["The following macro must be true in order for the group to be shown, in addition to any filter that may already be set."],
5813 width = 'full',
5814 },
5815 },
5816 },
5817 sortingGroup = {
5818 order = 300,
5819 type = 'group',
5820 guiInline = true,
5821 name = L["Grouping & Sorting"],
5822 set = function(info, value) E.db.unitframe.units.raid[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid', nil, nil, true) end,
5823 args = {
5824 groupBy = {
5825 order = 1,
5826 name = L["Group By"],
5827 desc = L["Set the order that the group will sort."],
5828 customWidth = 250,
5829 type = 'select',
5830 values = {
5831 ['CLASS'] = L["CLASS"],
5832 ['CLASSROLE'] = L["CLASS"]..' & '..L["ROLE"],
5833 ['ROLE'] = L["Role: Tank, Healer, Damage"],
5834 ['ROLE2'] = L["Role: Tank, Damage, Healer"],
5835 ['NAME'] = L["NAME"],
5836 ['MTMA'] = L["Main Tanks / Main Assist"],
5837 ['GROUP'] = L["GROUP"],
5838 },
5839 },
5840 sortDir = {
5841 order = 2,
5842 name = L["Sort Direction"],
5843 desc = L["Defines the sort order of the selected sort method."],
5844 type = 'select',
5845 values = {
5846 ['ASC'] = L["Ascending"],
5847 ['DESC'] = L["Descending"]
5848 },
5849 },
5850 spacer = {
5851 order = 3,
5852 type = 'description',
5853 width = 'full',
5854 name = ' '
5855 },
5856 raidWideSorting = {
5857 order = 4,
5858 name = L["Raid-Wide Sorting"],
5859 desc = L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."],
5860 type = 'toggle',
5861 },
5862 invertGroupingOrder = {
5863 order = 5,
5864 name = L["Invert Grouping Order"],
5865 desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."],
5866 disabled = function() return not E.db.unitframe.units.raid.raidWideSorting end,
5867 type = 'toggle',
5868 },
5869 startFromCenter = {
5870 order = 6,
5871 name = L["Start Near Center"],
5872 desc = L["The initial group will start near the center and grow out."],
5873 disabled = function() return not E.db.unitframe.units.raid.raidWideSorting end,
5874 type = 'toggle',
5875 },
5876 },
5877 },
5878 },
5879 },
5880 health = GetOptionsTable_Health(true, UF.CreateAndUpdateHeaderGroup, 'raid'),
5881 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateHeaderGroup, 'raid'),
5882 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateHeaderGroup, 'raid'),
5883 power = GetOptionsTable_Power(false, UF.CreateAndUpdateHeaderGroup, 'raid'),
5884 name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, 'raid'),
5885 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateHeaderGroup, 'raid'),
5886 fader = GetOptionsTable_Fader(UF.CreateAndUpdateHeaderGroup, 'raid'),
5887 buffs = GetOptionsTable_Auras('buffs', true, UF.CreateAndUpdateHeaderGroup, 'raid'),
5888 debuffs = GetOptionsTable_Auras('debuffs', true, UF.CreateAndUpdateHeaderGroup, 'raid'),
5889 buffIndicator = {
5890 order = 701,
5891 type = 'group',
5892 name = L["Buff Indicator"],
5893 get = function(info) return E.db.unitframe.units.raid.buffIndicator[info[#info]] end,
5894 set = function(info, value) E.db.unitframe.units.raid.buffIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid') end,
5895 args = {
5896 header = {
5897 order = 1,
5898 type = "header",
5899 name = L["Buff Indicator"],
5900 },
5901 enable = {
5902 type = 'toggle',
5903 name = L["Enable"],
5904 order = 2,
5905 },
5906 size = {
5907 type = 'range',
5908 name = L["Size"],
5909 desc = L["Size of the indicator icon."],
5910 order = 3,
5911 min = 4, max = 50, step = 1,
5912 },
5913 fontSize = {
5914 type = 'range',
5915 name = L["FONT_SIZE"],
5916 order = 4,
5917 min = 7, max = 212, step = 1,
5918 },
5919 profileSpecific = {
5920 type = 'toggle',
5921 name = L["Profile Specific"],
5922 desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
5923 order = 5,
5924 },
5925 configureButton = {
5926 type = 'execute',
5927 name = L["Configure Auras"],
5928 func = function()
5929 if E.db.unitframe.units.raid.buffIndicator.profileSpecific then
5930 E:SetToFilterConfig('Buff Indicator (Profile)')
5931 else
5932 E:SetToFilterConfig('Buff Indicator')
5933 end
5934 end,
5935 order = 6
5936 },
5937 },
5938 },
5939 raidRoleIcons = {
5940 order = 703,
5941 type = 'group',
5942 name = L["RL Icon"],
5943 get = function(info) return E.db.unitframe.units.raid.raidRoleIcons[info[#info]] end,
5944 set = function(info, value) E.db.unitframe.units.raid.raidRoleIcons[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid') end,
5945 args = {
5946 header = {
5947 order = 1,
5948 type = "header",
5949 name = L["RL Icon"],
5950 },
5951 enable = {
5952 type = 'toggle',
5953 name = L["Enable"],
5954 order = 2,
5955 },
5956 position = {
5957 type = 'select',
5958 order = 3,
5959 name = L["Position"],
5960 values = {
5961 ['TOPLEFT'] = 'TOPLEFT',
5962 ['TOPRIGHT'] = 'TOPRIGHT',
5963 },
5964 },
5965 },
5966 },
5967 phaseIndicator = {
5968 order = 5006,
5969 type = 'group',
5970 name = L["Phase Indicator"],
5971 get = function(info) return E.db.unitframe.units.raid.phaseIndicator[info[#info]] end,
5972 set = function(info, value) E.db.unitframe.units.raid.phaseIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid') end,
5973 args = {
5974 header = {
5975 order = 1,
5976 type = "header",
5977 name = L["Phase Indicator"],
5978 },
5979 enable = {
5980 order = 2,
5981 type = "toggle",
5982 name = L["Enable"],
5983 },
5984 scale = {
5985 order = 3,
5986 type = "range",
5987 name = L["Scale"],
5988 isPercent = true,
5989 min = 0.5, max = 1.5, step = 0.01,
5990 },
5991 spacer = {
5992 order = 4,
5993 type = "description",
5994 name = " ",
5995 },
5996 anchorPoint = {
5997 order = 5,
5998 type = "select",
5999 name = L["Anchor Point"],
6000 values = positionValues,
6001 },
6002 xOffset = {
6003 order = 6,
6004 type = "range",
6005 name = L["X-Offset"],
6006 min = -100, max = 100, step = 1,
6007 },
6008 yOffset = {
6009 order = 7,
6010 type = "range",
6011 name = L["Y-Offset"],
6012 min = -100, max = 100, step = 1,
6013 },
6014 },
6015 },
6016 rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, 'raid'),
6017 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateHeaderGroup, 'raid'),
6018 readycheckIcon = GetOptionsTable_ReadyCheckIcon(UF.CreateAndUpdateHeaderGroup, 'raid'),
6019 --resurrectIcon = GetOptionsTable_ResurrectIcon(UF.CreateAndUpdateHeaderGroup, 'raid'),
6020 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateHeaderGroup, 'raid'),
6021 },
6022}
6023
6024--Raid-40 Frames
6025E.Options.args.unitframe.args.raid40 = {
6026 name = L["Raid-40"],
6027 type = 'group',
6028 order = 1100,
6029 childGroups = "tab",
6030 get = function(info) return E.db.unitframe.units.raid40[info[#info]] end,
6031 set = function(info, value) E.db.unitframe.units.raid40[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40') end,
6032 disabled = function() return not E.UnitFrames.Initialized end,
6033 args = {
6034 enable = {
6035 type = 'toggle',
6036 order = 1,
6037 name = L["Enable"],
6038 },
6039 configureToggle = {
6040 order = 2,
6041 type = 'execute',
6042 name = L["Display Frames"],
6043 func = function()
6044 UF:HeaderConfig(_G.ElvUF_Raid40, _G.ElvUF_Raid40.forceShow ~= true or nil)
6045 end,
6046 },
6047 resetSettings = {
6048 type = 'execute',
6049 order = 3,
6050 name = L["Restore Defaults"],
6051 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Raid-40 Frames"], nil, {unit='raid40', mover='Raid Frames'}) end,
6052 },
6053 copyFrom = {
6054 type = 'select',
6055 order = 4,
6056 name = L["Copy From"],
6057 desc = L["Select a unit to copy settings from."],
6058 values = {
6059 ['party'] = L["Party Frames"],
6060 ['raid'] = L["Raid Frames"],
6061 },
6062 set = function(info, value) UF:MergeUnitSettings(value, 'raid40', true); end,
6063 },
6064 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6065 generalGroup = {
6066 order = 6,
6067 type = 'group',
6068 name = L["General"],
6069 args = {
6070 header = {
6071 order = 1,
6072 type = "header",
6073 name = L["General"],
6074 },
6075 hideonnpc = {
6076 type = 'toggle',
6077 order = 3,
6078 name = L["Text Toggle On NPC"],
6079 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
6080 get = function(info) return E.db.unitframe.units.raid40.power.hideonnpc end,
6081 set = function(info, value) E.db.unitframe.units.raid40.power.hideonnpc = value; UF:CreateAndUpdateHeaderGroup('raid40'); end,
6082 },
6083 colorOverride = {
6084 order = 7,
6085 name = L["Class Color Override"],
6086 desc = L["Override the default class color setting."],
6087 type = 'select',
6088 values = colorOverrideValues,
6089 },
6090 orientation = {
6091 order = 8,
6092 type = "select",
6093 name = L["Frame Orientation"],
6094 desc = L["Set the orientation of the UnitFrame."],
6095 values = orientationValues,
6096 },
6097 disableMouseoverGlow = {
6098 order = 9,
6099 type = "toggle",
6100 name = L["Block Mouseover Glow"],
6101 desc = L["Forces Mouseover Glow to be disabled for these frames"],
6102 },
6103 disableTargetGlow = {
6104 order = 10,
6105 type = "toggle",
6106 name = L["Block Target Glow"],
6107 desc = L["Forces Target Glow to be disabled for these frames"],
6108 },
6109 positionsGroup = {
6110 order = 100,
6111 name = L["Size and Positions"],
6112 type = 'group',
6113 guiInline = true,
6114 set = function(info, value) E.db.unitframe.units.raid40[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40', nil, nil, true) end,
6115 args = {
6116 width = {
6117 order = 1,
6118 name = L["Width"],
6119 type = 'range',
6120 min = 10, max = 500, step = 1,
6121 set = function(info, value) E.db.unitframe.units.raid40[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40') end,
6122 },
6123 height = {
6124 order = 2,
6125 name = L["Height"],
6126 type = 'range',
6127 min = 10, max = 500, step = 1,
6128 set = function(info, value) E.db.unitframe.units.raid40[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40') end,
6129 },
6130 spacer = {
6131 order = 3,
6132 name = '',
6133 type = 'description',
6134 width = 'full',
6135 },
6136 growthDirection = {
6137 order = 4,
6138 name = L["Growth Direction"],
6139 desc = L["Growth direction from the first unitframe."],
6140 type = 'select',
6141 values = growthDirectionValues,
6142 },
6143 numGroups = {
6144 order = 7,
6145 type = 'range',
6146 name = L["Number of Groups"],
6147 min = 1, max = 8, step = 1,
6148 set = function(info, value)
6149 E.db.unitframe.units.raid40[info[#info]] = value;
6150 UF:CreateAndUpdateHeaderGroup('raid40')
6151 if _G.ElvUF_Raid.isForced then
6152 UF:HeaderConfig(_G.ElvUF_Raid40)
6153 UF:HeaderConfig(_G.ElvUF_Raid40, true)
6154 end
6155 end,
6156 },
6157 groupsPerRowCol = {
6158 order = 8,
6159 type = 'range',
6160 name = L["Groups Per Row/Column"],
6161 min = 1, max = 8, step = 1,
6162 set = function(info, value)
6163 E.db.unitframe.units.raid40[info[#info]] = value;
6164 UF:CreateAndUpdateHeaderGroup('raid40')
6165 if _G.ElvUF_Raid.isForced then
6166 UF:HeaderConfig(_G.ElvUF_Raid40)
6167 UF:HeaderConfig(_G.ElvUF_Raid40, true)
6168 end
6169 end,
6170 },
6171 horizontalSpacing = {
6172 order = 9,
6173 type = 'range',
6174 name = L["Horizontal Spacing"],
6175 min = -1, max = 50, step = 1,
6176 },
6177 verticalSpacing = {
6178 order = 10,
6179 type = 'range',
6180 name = L["Vertical Spacing"],
6181 min = -1, max = 50, step = 1,
6182 },
6183 groupSpacing = {
6184 order = 11,
6185 type = "range",
6186 name = L["Group Spacing"],
6187 desc = L["Additional spacing between each individual group."],
6188 min = 0, softMax = 50, step = 1,
6189 },
6190 },
6191 },
6192 visibilityGroup = {
6193 order = 200,
6194 name = L["Visibility"],
6195 type = 'group',
6196 guiInline = true,
6197 set = function(info, value) E.db.unitframe.units.raid40[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40', nil, nil, true) end,
6198 args = {
6199 showPlayer = {
6200 order = 1,
6201 type = 'toggle',
6202 name = L["Display Player"],
6203 desc = L["When true, the header includes the player when not in a raid."],
6204 },
6205 visibility = {
6206 order = 2,
6207 type = 'input',
6208 name = L["Visibility"],
6209 desc = L["The following macro must be true in order for the group to be shown, in addition to any filter that may already be set."],
6210 width = 'full',
6211 },
6212 },
6213 },
6214 sortingGroup = {
6215 order = 300,
6216 type = 'group',
6217 guiInline = true,
6218 name = L["Grouping & Sorting"],
6219 set = function(info, value) E.db.unitframe.units.raid40[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40', nil, nil, true) end,
6220 args = {
6221 groupBy = {
6222 order = 1,
6223 name = L["Group By"],
6224 desc = L["Set the order that the group will sort."],
6225 customWidth = 250,
6226 type = 'select',
6227 values = {
6228 ['CLASS'] = L["CLASS"],
6229 ['CLASSROLE'] = L["CLASS"]..' & '..L["ROLE"],
6230 ['ROLE'] = L["Role: Tank, Healer, Damage"],
6231 ['ROLE2'] = L["Role: Tank, Damage, Healer"],
6232 ['NAME'] = L["NAME"],
6233 ['MTMA'] = L["Main Tanks / Main Assist"],
6234 ['GROUP'] = L["GROUP"],
6235 },
6236 },
6237 sortDir = {
6238 order = 2,
6239 name = L["Sort Direction"],
6240 desc = L["Defines the sort order of the selected sort method."],
6241 type = 'select',
6242 values = {
6243 ['ASC'] = L["Ascending"],
6244 ['DESC'] = L["Descending"]
6245 },
6246 },
6247 spacer = {
6248 order = 3,
6249 type = 'description',
6250 width = 'full',
6251 name = ' '
6252 },
6253 raidWideSorting = {
6254 order = 4,
6255 name = L["Raid-Wide Sorting"],
6256 desc = L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."],
6257 type = 'toggle',
6258 },
6259 invertGroupingOrder = {
6260 order = 5,
6261 name = L["Invert Grouping Order"],
6262 desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."],
6263 disabled = function() return not E.db.unitframe.units.raid40.raidWideSorting end,
6264 type = 'toggle',
6265 },
6266 startFromCenter = {
6267 order = 6,
6268 name = L["Start Near Center"],
6269 desc = L["The initial group will start near the center and grow out."],
6270 disabled = function() return not E.db.unitframe.units.raid40.raidWideSorting end,
6271 type = 'toggle',
6272 },
6273 },
6274 },
6275 },
6276 },
6277 health = GetOptionsTable_Health(true, UF.CreateAndUpdateHeaderGroup, 'raid40'),
6278 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6279 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6280 power = GetOptionsTable_Power(false, UF.CreateAndUpdateHeaderGroup, 'raid40'),
6281 name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6282 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6283 fader = GetOptionsTable_Fader(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6284 buffs = GetOptionsTable_Auras('buffs', true, UF.CreateAndUpdateHeaderGroup, 'raid40'),
6285 debuffs = GetOptionsTable_Auras('debuffs', true, UF.CreateAndUpdateHeaderGroup, 'raid40'),
6286 buffIndicator = {
6287 order = 701,
6288 type = 'group',
6289 name = L["Buff Indicator"],
6290 get = function(info) return E.db.unitframe.units.raid40.buffIndicator[info[#info]] end,
6291 set = function(info, value) E.db.unitframe.units.raid40.buffIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40') end,
6292 args = {
6293 header = {
6294 order = 1,
6295 type = "header",
6296 name = L["Buff Indicator"],
6297 },
6298 enable = {
6299 type = 'toggle',
6300 name = L["Enable"],
6301 order = 2,
6302 },
6303 size = {
6304 type = 'range',
6305 name = L["Size"],
6306 desc = L["Size of the indicator icon."],
6307 order = 3,
6308 min = 4, max = 50, step = 1,
6309 },
6310 fontSize = {
6311 type = 'range',
6312 name = L["FONT_SIZE"],
6313 order = 4,
6314 min = 7, max = 212, step = 1,
6315 },
6316 profileSpecific = {
6317 type = 'toggle',
6318 name = L["Profile Specific"],
6319 desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
6320 order = 5,
6321 },
6322 configureButton = {
6323 type = 'execute',
6324 name = L["Configure Auras"],
6325 func = function()
6326 if E.db.unitframe.units.raid40.buffIndicator.profileSpecific then
6327 E:SetToFilterConfig('Buff Indicator (Profile)')
6328 else
6329 E:SetToFilterConfig('Buff Indicator')
6330 end
6331 end,
6332 order = 6
6333 },
6334 },
6335 },
6336 roleIcon = {
6337 order = 702,
6338 type = 'group',
6339 name = L["Role Icon"],
6340 get = function(info) return E.db.unitframe.units.raid40.roleIcon[info[#info]] end,
6341 set = function(info, value) E.db.unitframe.units.raid40.roleIcon[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40') end,
6342 args = {
6343 header = {
6344 order = 1,
6345 type = "header",
6346 name = L["Role Icon"],
6347 },
6348 enable = {
6349 type = 'toggle',
6350 name = L["Enable"],
6351 order = 2,
6352 },
6353 position = {
6354 type = 'select',
6355 order = 3,
6356 name = L["Position"],
6357 values = positionValues,
6358 },
6359 attachTo = {
6360 type = 'select',
6361 order = 4,
6362 name = L["Attach To"],
6363 values = attachToValues,
6364 },
6365 xOffset = {
6366 order = 5,
6367 type = 'range',
6368 name = L["xOffset"],
6369 min = -300, max = 300, step = 1,
6370 },
6371 yOffset = {
6372 order = 6,
6373 type = 'range',
6374 name = L["yOffset"],
6375 min = -300, max = 300, step = 1,
6376 },
6377 size = {
6378 type = 'range',
6379 order = 7,
6380 name = L["Size"],
6381 min = 4, max = 100, step = 1,
6382 },
6383 tank = {
6384 order = 8,
6385 type = "toggle",
6386 name = L["Show For Tanks"],
6387 },
6388 healer = {
6389 order = 9,
6390 type = "toggle",
6391 name = L["Show For Healers"],
6392 },
6393 damager = {
6394 order = 10,
6395 type = "toggle",
6396 name = L["Show For DPS"],
6397 },
6398 combatHide = {
6399 order = 11,
6400 type = "toggle",
6401 name = L["Hide In Combat"],
6402 },
6403 },
6404 },
6405 raidRoleIcons = {
6406 order = 703,
6407 type = 'group',
6408 name = L["RL Icon"],
6409 get = function(info) return E.db.unitframe.units.raid40.raidRoleIcons[info[#info]] end,
6410 set = function(info, value) E.db.unitframe.units.raid40.raidRoleIcons[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40') end,
6411 args = {
6412 header = {
6413 order = 1,
6414 type = "header",
6415 name = L["RL Icon"],
6416 },
6417 enable = {
6418 type = 'toggle',
6419 name = L["Enable"],
6420 order = 2,
6421 },
6422 position = {
6423 type = 'select',
6424 order = 3,
6425 name = L["Position"],
6426 values = {
6427 ['TOPLEFT'] = 'TOPLEFT',
6428 ['TOPRIGHT'] = 'TOPRIGHT',
6429 },
6430 },
6431 },
6432 },
6433 phaseIndicator = {
6434 order = 5007,
6435 type = 'group',
6436 name = L["Phase Indicator"],
6437 get = function(info) return E.db.unitframe.units.raid40.phaseIndicator[info[#info]] end,
6438 set = function(info, value) E.db.unitframe.units.raid40.phaseIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raid40') end,
6439 args = {
6440 header = {
6441 order = 1,
6442 type = "header",
6443 name = L["Phase Indicator"],
6444 },
6445 enable = {
6446 order = 2,
6447 type = "toggle",
6448 name = L["Enable"],
6449 },
6450 scale = {
6451 order = 3,
6452 type = "range",
6453 name = L["Scale"],
6454 isPercent = true,
6455 min = 0.5, max = 1.5, step = 0.01,
6456 },
6457 spacer = {
6458 order = 4,
6459 type = "description",
6460 name = " ",
6461 },
6462 anchorPoint = {
6463 order = 5,
6464 type = "select",
6465 name = L["Anchor Point"],
6466 values = positionValues,
6467 },
6468 xOffset = {
6469 order = 6,
6470 type = "range",
6471 name = L["X-Offset"],
6472 min = -100, max = 100, step = 1,
6473 },
6474 yOffset = {
6475 order = 7,
6476 type = "range",
6477 name = L["Y-Offset"],
6478 min = -100, max = 100, step = 1,
6479 },
6480 },
6481 },
6482 rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6483 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6484 readycheckIcon = GetOptionsTable_ReadyCheckIcon(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6485 --resurrectIcon = GetOptionsTable_ResurrectIcon(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6486 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateHeaderGroup, 'raid40'),
6487 },
6488}
6489
6490--Raid Pet Frames
6491E.Options.args.unitframe.args.raidpet = {
6492 order = 1200,
6493 type = 'group',
6494 name = L["Raid Pet"],
6495 childGroups = "tab",
6496 get = function(info) return E.db.unitframe.units.raidpet[info[#info]] end,
6497 set = function(info, value) E.db.unitframe.units.raidpet[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raidpet') end,
6498 disabled = function() return not E.UnitFrames.Initialized end,
6499 args = {
6500 enable = {
6501 type = 'toggle',
6502 order = 1,
6503 name = L["Enable"],
6504 },
6505 configureToggle = {
6506 order = 2,
6507 type = 'execute',
6508 name = L["Display Frames"],
6509 func = function()
6510 UF:HeaderConfig(ElvUF_Raidpet, ElvUF_Raidpet.forceShow ~= true or nil)
6511 end,
6512 },
6513 resetSettings = {
6514 type = 'execute',
6515 order = 3,
6516 name = L["Restore Defaults"],
6517 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Raid Pet Frames"], nil, {unit='raidpet', mover='Raid Pet Frames'}) end,
6518 },
6519 copyFrom = {
6520 type = 'select',
6521 order = 4,
6522 name = L["Copy From"],
6523 desc = L["Select a unit to copy settings from."],
6524 values = {
6525 ['party'] = L["Party Frames"],
6526 ['raid'] = L["Raid Frames"],
6527 },
6528 set = function(info, value) UF:MergeUnitSettings(value, 'raidpet', true); end,
6529 },
6530 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6531 generalGroup = {
6532 order = 6,
6533 type = 'group',
6534 name = L["General"],
6535 args = {
6536 header = {
6537 order = 1,
6538 type = "header",
6539 name = L["General"],
6540 },
6541 colorOverride = {
6542 order = 6,
6543 name = L["Class Color Override"],
6544 desc = L["Override the default class color setting."],
6545 type = 'select',
6546 values = colorOverrideValues,
6547 },
6548 orientation = {
6549 order = 7,
6550 type = "select",
6551 name = L["Frame Orientation"],
6552 desc = L["Set the orientation of the UnitFrame."],
6553 values = orientationValues,
6554 },
6555 disableMouseoverGlow = {
6556 order = 8,
6557 type = "toggle",
6558 name = L["Block Mouseover Glow"],
6559 desc = L["Forces Mouseover Glow to be disabled for these frames"],
6560 },
6561 disableTargetGlow = {
6562 order = 9,
6563 type = "toggle",
6564 name = L["Block Target Glow"],
6565 desc = L["Forces Target Glow to be disabled for these frames"],
6566 },
6567 positionsGroup = {
6568 order = 100,
6569 name = L["Size and Positions"],
6570 type = 'group',
6571 guiInline = true,
6572 set = function(info, value) E.db.unitframe.units.raidpet[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raidpet', nil, nil, true) end,
6573 args = {
6574 width = {
6575 order = 1,
6576 name = L["Width"],
6577 type = 'range',
6578 min = 10, max = 500, step = 1,
6579 set = function(info, value) E.db.unitframe.units.raidpet[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raidpet') end,
6580 },
6581 height = {
6582 order = 2,
6583 name = L["Height"],
6584 type = 'range',
6585 min = 10, max = 500, step = 1,
6586 set = function(info, value) E.db.unitframe.units.raidpet[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raidpet') end,
6587 },
6588 spacer = {
6589 order = 3,
6590 name = '',
6591 type = 'description',
6592 width = 'full',
6593 },
6594 growthDirection = {
6595 order = 4,
6596 name = L["Growth Direction"],
6597 desc = L["Growth direction from the first unitframe."],
6598 type = 'select',
6599 values = growthDirectionValues,
6600 },
6601 numGroups = {
6602 order = 7,
6603 type = 'range',
6604 name = L["Number of Groups"],
6605 min = 1, max = 8, step = 1,
6606 set = function(info, value)
6607 E.db.unitframe.units.raidpet[info[#info]] = value;
6608 UF:CreateAndUpdateHeaderGroup('raidpet')
6609 if ElvUF_Raidpet.isForced then
6610 UF:HeaderConfig(ElvUF_Raidpet)
6611 UF:HeaderConfig(ElvUF_Raidpet, true)
6612 end
6613 end,
6614 },
6615 groupsPerRowCol = {
6616 order = 8,
6617 type = 'range',
6618 name = L["Groups Per Row/Column"],
6619 min = 1, max = 8, step = 1,
6620 set = function(info, value)
6621 E.db.unitframe.units.raidpet[info[#info]] = value;
6622 UF:CreateAndUpdateHeaderGroup('raidpet')
6623 if ElvUF_Raidpet.isForced then
6624 UF:HeaderConfig(ElvUF_Raidpet)
6625 UF:HeaderConfig(ElvUF_Raidpet, true)
6626 end
6627 end,
6628 },
6629 horizontalSpacing = {
6630 order = 9,
6631 type = 'range',
6632 name = L["Horizontal Spacing"],
6633 min = -1, max = 50, step = 1,
6634 },
6635 verticalSpacing = {
6636 order = 10,
6637 type = 'range',
6638 name = L["Vertical Spacing"],
6639 min = -1, max = 50, step = 1,
6640 },
6641 groupSpacing = {
6642 order = 11,
6643 type = "range",
6644 name = L["Group Spacing"],
6645 desc = L["Additional spacing between each individual group."],
6646 min = 0, softMax = 50, step = 1,
6647 },
6648 },
6649 },
6650 visibilityGroup = {
6651 order = 200,
6652 name = L["Visibility"],
6653 type = 'group',
6654 guiInline = true,
6655 set = function(info, value) E.db.unitframe.units.raidpet[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raidpet', nil, nil, true) end,
6656 args = {
6657 visibility = {
6658 order = 2,
6659 type = 'input',
6660 name = L["Visibility"],
6661 desc = L["The following macro must be true in order for the group to be shown, in addition to any filter that may already be set."],
6662 width = 'full',
6663 },
6664 },
6665 },
6666 sortingGroup = {
6667 order = 300,
6668 type = 'group',
6669 guiInline = true,
6670 name = L["Grouping & Sorting"],
6671 set = function(info, value) E.db.unitframe.units.raidpet[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raidpet', nil, nil, true) end,
6672 args = {
6673 groupBy = {
6674 order = 1,
6675 name = L["Group By"],
6676 desc = L["Set the order that the group will sort."],
6677 type = 'select',
6678 values = {
6679 ['NAME'] = L["Owners Name"],
6680 ['PETNAME'] = L["Pet Name"],
6681 ['GROUP'] = L["GROUP"],
6682 },
6683 },
6684 sortDir = {
6685 order = 2,
6686 name = L["Sort Direction"],
6687 desc = L["Defines the sort order of the selected sort method."],
6688 type = 'select',
6689 values = {
6690 ['ASC'] = L["Ascending"],
6691 ['DESC'] = L["Descending"]
6692 },
6693 },
6694 spacer = {
6695 order = 3,
6696 type = 'description',
6697 width = 'full',
6698 name = ' '
6699 },
6700 raidWideSorting = {
6701 order = 4,
6702 name = L["Raid-Wide Sorting"],
6703 desc = L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."],
6704 type = 'toggle',
6705 },
6706 invertGroupingOrder = {
6707 order = 5,
6708 name = L["Invert Grouping Order"],
6709 desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."],
6710 disabled = function() return not E.db.unitframe.units.raidpet.raidWideSorting end,
6711 type = 'toggle',
6712 },
6713 startFromCenter = {
6714 order = 6,
6715 name = L["Start Near Center"],
6716 desc = L["The initial group will start near the center and grow out."],
6717 disabled = function() return not E.db.unitframe.units.raidpet.raidWideSorting end,
6718 type = 'toggle',
6719 },
6720 },
6721 },
6722 },
6723 },
6724 health = GetOptionsTable_Health(true, UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6725 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6726 name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6727 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6728 fader = GetOptionsTable_Fader(UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6729 buffs = GetOptionsTable_Auras('buffs', true, UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6730 debuffs = GetOptionsTable_Auras('debuffs', true, UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6731 rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6732 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6733 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateHeaderGroup, 'raidpet'),
6734 buffIndicator = {
6735 order = 701,
6736 type = 'group',
6737 name = L["Buff Indicator"],
6738 get = function(info) return E.db.unitframe.units.raidpet.buffIndicator[info[#info]] end,
6739 set = function(info, value) E.db.unitframe.units.raidpet.buffIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('raidpet') end,
6740 args = {
6741 header = {
6742 order = 1,
6743 type = "header",
6744 name = L["Buff Indicator"],
6745 },
6746 enable = {
6747 type = 'toggle',
6748 name = L["Enable"],
6749 order = 2,
6750 },
6751 size = {
6752 type = 'range',
6753 name = L["Size"],
6754 desc = L["Size of the indicator icon."],
6755 order = 3,
6756 min = 4, max = 50, step = 1,
6757 },
6758 fontSize = {
6759 type = 'range',
6760 name = L["FONT_SIZE"],
6761 order = 4,
6762 min = 7, max = 212, step = 1,
6763 },
6764 configureButton = {
6765 type = 'execute',
6766 name = L["Configure Auras"],
6767 func = function() E:SetToFilterConfig('Buff Indicator') end,
6768 order = 5
6769 },
6770 },
6771 },
6772 },
6773}
6774
6775--Tank Frames
6776E.Options.args.unitframe.args.tank = {
6777 name = L["TANK"],
6778 type = 'group',
6779 order = 1300,
6780 childGroups = "tab",
6781 get = function(info) return E.db.unitframe.units.tank[info[#info]] end,
6782 set = function(info, value) E.db.unitframe.units.tank[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('tank') end,
6783 disabled = function() return not E.UnitFrames.Initialized end,
6784 args = {
6785 enable = {
6786 type = 'toggle',
6787 order = 1,
6788 name = L["Enable"],
6789 },
6790 resetSettings = {
6791 type = 'execute',
6792 order = 2,
6793 name = L["Restore Defaults"],
6794 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Tank Frames"], nil, {unit='tank'}) end,
6795 },
6796 generalGroup = {
6797 order = 3,
6798 type = 'group',
6799 name = L["General"],
6800 args = {
6801 header = {
6802 order = 1,
6803 type = "header",
6804 name = L["General"],
6805 },
6806 width = {
6807 order = 3,
6808 name = L["Width"],
6809 type = 'range',
6810 min = 50, max = 1000, step = 1,
6811 },
6812 height = {
6813 order = 4,
6814 name = L["Height"],
6815 type = 'range',
6816 min = 10, max = 500, step = 1,
6817 },
6818 verticalSpacing = {
6819 order = 5,
6820 type = "range",
6821 name = L["Vertical Spacing"],
6822 min = 0, max = 100, step = 1,
6823 },
6824 disableDebuffHighlight = {
6825 order = 6,
6826 type = "toggle",
6827 name = L["Disable Debuff Highlight"],
6828 desc = L["Forces Debuff Highlight to be disabled for these frames"],
6829 disabled = function() return E.db.unitframe.debuffHighlighting == "NONE" end,
6830 },
6831 orientation = {
6832 order = 7,
6833 type = "select",
6834 name = L["Frame Orientation"],
6835 desc = L["Set the orientation of the UnitFrame."],
6836 values = orientationValues,
6837 },
6838 colorOverride = {
6839 order = 8,
6840 name = L["Class Color Override"],
6841 desc = L["Override the default class color setting."],
6842 type = 'select',
6843 values = colorOverrideValues,
6844 },
6845 disableMouseoverGlow = {
6846 order = 9,
6847 type = "toggle",
6848 name = L["Block Mouseover Glow"],
6849 desc = L["Forces Mouseover Glow to be disabled for these frames"],
6850 },
6851 disableTargetGlow = {
6852 order = 10,
6853 type = "toggle",
6854 name = L["Block Target Glow"],
6855 desc = L["Forces Target Glow to be disabled for these frames"],
6856 },
6857 },
6858 },
6859 targetsGroup = {
6860 order = 700,
6861 type = 'group',
6862 name = L["Tank Target"],
6863 get = function(info) return E.db.unitframe.units.tank.targetsGroup[info[#info]] end,
6864 set = function(info, value) E.db.unitframe.units.tank.targetsGroup[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('tank') end,
6865 args = {
6866 header = {
6867 order = 1,
6868 type = "header",
6869 name = L["Tank Target"],
6870 },
6871 enable = {
6872 type = 'toggle',
6873 name = L["Enable"],
6874 order = 2,
6875 },
6876 width = {
6877 order = 3,
6878 name = L["Width"],
6879 type = 'range',
6880 min = 10, max = 500, step = 1,
6881 },
6882 height = {
6883 order = 4,
6884 name = L["Height"],
6885 type = 'range',
6886 min = 10, max = 500, step = 1,
6887 },
6888 anchorPoint = {
6889 type = 'select',
6890 order = 5,
6891 name = L["Anchor Point"],
6892 desc = L["What point to anchor to the frame you set to attach to."],
6893 values = petAnchors,
6894 },
6895 xOffset = {
6896 order = 6,
6897 type = 'range',
6898 name = L["xOffset"],
6899 desc = L["An X offset (in pixels) to be used when anchoring new frames."],
6900 min = -500, max = 500, step = 1,
6901 },
6902 yOffset = {
6903 order = 7,
6904 type = 'range',
6905 name = L["yOffset"],
6906 desc = L["An Y offset (in pixels) to be used when anchoring new frames."],
6907 min = -500, max = 500, step = 1,
6908 },
6909 colorOverride = {
6910 order = 8,
6911 name = L["Class Color Override"],
6912 desc = L["Override the default class color setting."],
6913 type = 'select',
6914 values = colorOverrideValues,
6915 },
6916 name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, 'tank'),
6917 },
6918 },
6919 name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, 'tank'),
6920 fader = GetOptionsTable_Fader(UF.CreateAndUpdateHeaderGroup, 'tank'),
6921 buffs = GetOptionsTable_Auras('buffs', true, UF.CreateAndUpdateHeaderGroup, 'tank'),
6922 debuffs = GetOptionsTable_Auras('debuffs', true, UF.CreateAndUpdateHeaderGroup, 'tank'),
6923 rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, 'tank'),
6924 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateHeaderGroup, 'tank'),
6925 buffIndicator = {
6926 order = 701,
6927 type = 'group',
6928 name = L["Buff Indicator"],
6929 get = function(info) return E.db.unitframe.units.tank.buffIndicator[info[#info]] end,
6930 set = function(info, value) E.db.unitframe.units.tank.buffIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('tank') end,
6931 args = {
6932 header = {
6933 order = 1,
6934 type = "header",
6935 name = L["Buff Indicator"],
6936 },
6937 enable = {
6938 type = 'toggle',
6939 name = L["Enable"],
6940 order = 2,
6941 },
6942 size = {
6943 type = 'range',
6944 name = L["Size"],
6945 desc = L["Size of the indicator icon."],
6946 order = 3,
6947 min = 4, max = 50, step = 1,
6948 },
6949 fontSize = {
6950 type = 'range',
6951 name = L["FONT_SIZE"],
6952 order = 4,
6953 min = 7, max = 212, step = 1,
6954 },
6955 profileSpecific = {
6956 type = 'toggle',
6957 name = L["Profile Specific"],
6958 desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
6959 order = 5,
6960 },
6961 configureButton = {
6962 type = 'execute',
6963 name = L["Configure Auras"],
6964 func = function()
6965 if E.db.unitframe.units.tank.buffIndicator.profileSpecific then
6966 E:SetToFilterConfig('Buff Indicator (Profile)')
6967 else
6968 E:SetToFilterConfig('Buff Indicator')
6969 end
6970 end,
6971 order = 6
6972 },
6973 },
6974 },
6975 },
6976}
6977E.Options.args.unitframe.args.tank.args.name.args.attachTextTo.values = { ["Health"] = L["Health"], ["Frame"] = L["Frame"] }
6978E.Options.args.unitframe.args.tank.args.targetsGroup.args.name.args.attachTextTo.values = { ["Health"] = L["Health"], ["Frame"] = L["Frame"] }
6979E.Options.args.unitframe.args.tank.args.targetsGroup.args.name.get = function(info) return E.db.unitframe.units.tank.targetsGroup.name[info[#info]] end
6980E.Options.args.unitframe.args.tank.args.targetsGroup.args.name.set = function(info, value) E.db.unitframe.units.tank.targetsGroup.name[info[#info]] = value; UF.CreateAndUpdateHeaderGroup(UF, 'tank') end
6981
6982--Assist Frames
6983E.Options.args.unitframe.args.assist = {
6984 name = L["Assist"],
6985 type = 'group',
6986 order = 1300,
6987 childGroups = "tab",
6988 get = function(info) return E.db.unitframe.units.assist[info[#info]] end,
6989 set = function(info, value) E.db.unitframe.units.assist[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('assist') end,
6990 disabled = function() return not E.UnitFrames.Initialized end,
6991 args = {
6992 enable = {
6993 type = 'toggle',
6994 order = 1,
6995 name = L["Enable"],
6996 },
6997 resetSettings = {
6998 type = 'execute',
6999 order = 2,
7000 name = L["Restore Defaults"],
7001 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Assist Frames"], nil, {unit='assist'}) end,
7002 },
7003 generalGroup = {
7004 order = 3,
7005 type = 'group',
7006 name = L["General"],
7007 args = {
7008 header = {
7009 order = 1,
7010 type = "header",
7011 name = L["General"],
7012 },
7013 width = {
7014 order = 3,
7015 name = L["Width"],
7016 type = 'range',
7017 min = 50, max = 1000, step = 1,
7018 },
7019 height = {
7020 order = 4,
7021 name = L["Height"],
7022 type = 'range',
7023 min = 10, max = 500, step = 1,
7024 },
7025 verticalSpacing = {
7026 order = 5,
7027 type = "range",
7028 name = L["Vertical Spacing"],
7029 min = 0, max = 100, step = 1,
7030 },
7031 disableDebuffHighlight = {
7032 order = 6,
7033 type = "toggle",
7034 name = L["Disable Debuff Highlight"],
7035 desc = L["Forces Debuff Highlight to be disabled for these frames"],
7036 disabled = function() return E.db.unitframe.debuffHighlighting == "NONE" end,
7037 },
7038 orientation = {
7039 order = 7,
7040 type = "select",
7041 name = L["Frame Orientation"],
7042 desc = L["Set the orientation of the UnitFrame."],
7043 values = orientationValues,
7044 },
7045 colorOverride = {
7046 order = 8,
7047 name = L["Class Color Override"],
7048 desc = L["Override the default class color setting."],
7049 type = 'select',
7050 values = colorOverrideValues,
7051 },
7052 disableMouseoverGlow = {
7053 order = 9,
7054 type = "toggle",
7055 name = L["Block Mouseover Glow"],
7056 desc = L["Forces Mouseover Glow to be disabled for these frames"],
7057 },
7058 disableTargetGlow = {
7059 order = 10,
7060 type = "toggle",
7061 name = L["Block Target Glow"],
7062 desc = L["Forces Target Glow to be disabled for these frames"],
7063 },
7064 },
7065 },
7066 targetsGroup = {
7067 order = 701,
7068 type = 'group',
7069 name = L["Assist Target"],
7070 get = function(info) return E.db.unitframe.units.assist.targetsGroup[info[#info]] end,
7071 set = function(info, value) E.db.unitframe.units.assist.targetsGroup[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('assist') end,
7072 args = {
7073 header = {
7074 order = 1,
7075 type = "header",
7076 name = L["Assist Target"],
7077 },
7078 enable = {
7079 type = 'toggle',
7080 name = L["Enable"],
7081 order = 2,
7082 },
7083 width = {
7084 order = 3,
7085 name = L["Width"],
7086 type = 'range',
7087 min = 10, max = 500, step = 1,
7088 },
7089 height = {
7090 order = 4,
7091 name = L["Height"],
7092 type = 'range',
7093 min = 10, max = 500, step = 1,
7094 },
7095 anchorPoint = {
7096 type = 'select',
7097 order = 5,
7098 name = L["Anchor Point"],
7099 desc = L["What point to anchor to the frame you set to attach to."],
7100 values = petAnchors,
7101 },
7102 xOffset = {
7103 order = 6,
7104 type = 'range',
7105 name = L["xOffset"],
7106 desc = L["An X offset (in pixels) to be used when anchoring new frames."],
7107 min = -500, max = 500, step = 1,
7108 },
7109 yOffset = {
7110 order = 7,
7111 type = 'range',
7112 name = L["yOffset"],
7113 desc = L["An Y offset (in pixels) to be used when anchoring new frames."],
7114 min = -500, max = 500, step = 1,
7115 },
7116 colorOverride = {
7117 order = 8,
7118 name = L["Class Color Override"],
7119 desc = L["Override the default class color setting."],
7120 type = 'select',
7121 values = colorOverrideValues,
7122 },
7123 name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, 'assist'),
7124 },
7125 },
7126 name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, 'assist'),
7127 fader = GetOptionsTable_Fader(UF.CreateAndUpdateHeaderGroup, 'assist'),
7128 buffs = GetOptionsTable_Auras('buffs', true, UF.CreateAndUpdateHeaderGroup, 'assist'),
7129 debuffs = GetOptionsTable_Auras('debuffs', true, UF.CreateAndUpdateHeaderGroup, 'assist'),
7130 rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, 'assist'),
7131 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateHeaderGroup, 'assist'),
7132 buffIndicator = {
7133 order = 702,
7134 type = 'group',
7135 name = L["Buff Indicator"],
7136 get = function(info) return E.db.unitframe.units.assist.buffIndicator[info[#info]] end,
7137 set = function(info, value) E.db.unitframe.units.assist.buffIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('assist') end,
7138 args = {
7139 header = {
7140 order = 0,
7141 type = "header",
7142 name = L["Buff Indicator"],
7143 },
7144 enable = {
7145 type = 'toggle',
7146 name = L["Enable"],
7147 order = 1,
7148 },
7149 size = {
7150 type = 'range',
7151 name = L["Size"],
7152 desc = L["Size of the indicator icon."],
7153 order = 3,
7154 min = 4, max = 50, step = 1,
7155 },
7156 fontSize = {
7157 type = 'range',
7158 name = L["FONT_SIZE"],
7159 order = 4,
7160 min = 7, max = 212, step = 1,
7161 },
7162 profileSpecific = {
7163 type = 'toggle',
7164 name = L["Profile Specific"],
7165 desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
7166 order = 5,
7167 },
7168 configureButton = {
7169 type = 'execute',
7170 name = L["Configure Auras"],
7171 func = function()
7172 if E.db.unitframe.units.assist.buffIndicator.profileSpecific then
7173 E:SetToFilterConfig('Buff Indicator (Profile)')
7174 else
7175 E:SetToFilterConfig('Buff Indicator')
7176 end
7177 end,
7178 order = 6
7179 },
7180 },
7181 },
7182 },
7183}
7184E.Options.args.unitframe.args.assist.args.name.args.attachTextTo.values = { ["Health"] = L["Health"], ["Frame"] = L["Frame"] }
7185E.Options.args.unitframe.args.assist.args.targetsGroup.args.name.args.attachTextTo.values = { ["Health"] = L["Health"], ["Frame"] = L["Frame"] }
7186E.Options.args.unitframe.args.assist.args.targetsGroup.args.name.get = function(info) return E.db.unitframe.units.assist.targetsGroup.name[info[#info]] end
7187E.Options.args.unitframe.args.assist.args.targetsGroup.args.name.set = function(info, value) E.db.unitframe.units.assist.targetsGroup.name[info[#info]] = value; UF.CreateAndUpdateHeaderGroup(UF, 'assist') end
7188
7189--MORE COLORING STUFF YAY
7190E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup = {
7191 order = -10,
7192 type = 'group',
7193 name = L["Class Resources"],
7194 get = function(info)
7195 local t = E.db.unitframe.colors.classResources[info[#info]]
7196 local d = P.unitframe.colors.classResources[info[#info]]
7197 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
7198 end,
7199 set = function(info, r, g, b)
7200 local t = E.db.unitframe.colors.classResources[info[#info]]
7201 t.r, t.g, t.b = r, g, b
7202 UF:Update_AllFrames()
7203 end,
7204 args = {
7205 --[=[transparentClasspower = {
7206 order = 1,
7207 type = 'toggle',
7208 name = L["Transparent"],
7209 desc = L["Make textures transparent."],
7210 get = function(info) return E.db.unitframe.colors[info[#info]] end,
7211 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
7212 },
7213 invertClasspower = {
7214 order = 2,
7215 type = 'toggle',
7216 name = L["Invert Colors"],
7217 desc = L["Invert foreground and background colors."],
7218 disabled = function() return not E.db.unitframe.colors.transparentClasspower end,
7219 get = function(info) return E.db.unitframe.colors[info[#info]] end,
7220 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
7221 },
7222 spacer1 = {
7223 order = 3,
7224 type = "description",
7225 name = " ",
7226 width = 'full'
7227 },]=]
7228 customclasspowerbackdrop = {
7229 order = 4,
7230 type = 'toggle',
7231 name = L["Custom Backdrop"],
7232 desc = L["Use the custom backdrop color instead of a multiple of the main color."],
7233 get = function(info) return E.db.unitframe.colors[info[#info]] end,
7234 set = function(info, value) E.db.unitframe.colors[info[#info]] = value; UF:Update_AllFrames() end,
7235 },
7236 classpower_backdrop = {
7237 order = 5,
7238 type = 'color',
7239 name = L["Custom Backdrop"],
7240 desc = L["Use the custom backdrop color instead of a multiple of the main color."],
7241 disabled = function() return not E.db.unitframe.colors.customclasspowerbackdrop end,
7242 get = function(info)
7243 local t = E.db.unitframe.colors[info[#info]]
7244 local d = P.unitframe.colors[info[#info]]
7245 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
7246 end,
7247 set = function(info, r, g, b)
7248 local t = E.db.unitframe.colors[info[#info]]
7249 t.r, t.g, t.b = r, g, b
7250 UF:Update_AllFrames()
7251 end,
7252 },
7253 spacer2 = {
7254 order = 6,
7255 type = "description",
7256 name = " ",
7257 width = 'full'
7258 },
7259 }
7260}
7261
7262for i = 1, 3 do
7263 E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup.args['combo'..i] = {
7264 order = i+10,
7265 type = 'color',
7266 name = L["Combo Point"]..' #'..i,
7267 get = function(info)
7268 local t = E.db.unitframe.colors.classResources.comboPoints[i]
7269 local d = P.unitframe.colors.classResources.comboPoints[i]
7270 return t.r, t.g, t.b, t.a, d.r, d.g, d.b
7271 end,
7272 set = function(info, r, g, b)
7273 local t = E.db.unitframe.colors.classResources.comboPoints[i]
7274 t.r, t.g, t.b = r, g, b
7275 UF:Update_AllFrames()
7276 end,
7277 }
7278end
7279
7280
7281if P.unitframe.colors.classResources[E.myclass] then
7282 E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup.args.spacer5 = {
7283 order = 20,
7284 name = ' ',
7285 type = 'description',
7286 width = 'full',
7287 }
7288
7289 local ORDER = 30
7290 if E.myclass == 'PALADIN' then
7291 E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup.args[E.myclass] = {
7292 type = 'color',
7293 name = L["HOLY_POWER"],
7294 order = ORDER,
7295 }
7296 elseif E.myclass == 'MAGE' then
7297 E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup.args[E.myclass] = {
7298 type = 'color',
7299 name = L["POWER_TYPE_ARCANE_CHARGES"],
7300 order = ORDER,
7301 }
7302 elseif E.myclass == 'WARLOCK' then
7303 E.Options.args.unitframe.args.generalOptionsGroup.args.allColorsGroup.args.classResourceGroup.args[E.myclass] = {
7304 type = 'color',
7305 name = L["SOUL_SHARDS"],
7306 order = ORDER,
7307 }
7308 end
7309end
7310
7311--Custom Texts
7312function E:RefreshCustomTextsConfigs()
7313 --Hide any custom texts that don't belong to current profile
7314 for _, customText in pairs(CUSTOMTEXT_CONFIGS) do
7315 customText.hidden = true
7316 end
7317 wipe(CUSTOMTEXT_CONFIGS)
7318
7319 for unit in pairs(E.db.unitframe.units) do
7320 if E.db.unitframe.units[unit].customTexts then
7321 for objectName in pairs(E.db.unitframe.units[unit].customTexts) do
7322 CreateCustomTextGroup(unit, objectName)
7323 end
7324 end
7325 end
7326end
7327E:RefreshCustomTextsConfigs()