· 6 years ago · Sep 30, 2019, 10:14 AM
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 castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateHeaderGroup, 'party', 5),
3801 aurabar = GetOptionsTable_AuraBars(UF.CreateAndUpdateUF, 'player'),
3802 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, 'player'),
3803 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'player'),
3804 classbar = {
3805 order = 1000,
3806 type = 'group',
3807 name = L["Classbar"],
3808 get = function(info) return E.db.unitframe.units.player.classbar[info[#info]] end,
3809 set = function(info, value) E.db.unitframe.units.player.classbar[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
3810 args = {
3811 header = {
3812 order = 1,
3813 type = "header",
3814 name = L["Classbar"],
3815 },
3816 enable = {
3817 type = 'toggle',
3818 order = 2,
3819 name = L["Enable"],
3820 },
3821 height = {
3822 type = 'range',
3823 order = 3,
3824 name = L["Height"],
3825 min = ((E.db.unitframe.thinBorders or E.PixelMode) and 3 or 7),
3826 max = (E.db.unitframe.units.player.classbar.detachFromFrame and 300 or 30),
3827 step = 1,
3828 },
3829 fill = {
3830 type = 'select',
3831 order = 4,
3832 name = L["Fill"],
3833 values = {
3834 ['fill'] = L["Filled"],
3835 ['spaced'] = L["Spaced"],
3836 },
3837 },
3838 autoHide = {
3839 order = 5,
3840 type = 'toggle',
3841 name = L["Auto-Hide"],
3842 },
3843 additionalPowerText = {
3844 order = 6,
3845 type = "toggle",
3846 name = L["Additional Power Text"],
3847 },
3848 spacer = {
3849 order = 10,
3850 type = "description",
3851 name = "",
3852 },
3853 detachGroup = {
3854 order = 20,
3855 type = "group",
3856 name = L["Detach From Frame"],
3857 get = function(info) return E.db.unitframe.units.player.classbar[info[#info]] end,
3858 set = function(info, value) E.db.unitframe.units.player.classbar[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
3859 guiInline = true,
3860 args = {
3861 detachFromFrame = {
3862 type = 'toggle',
3863 order = 1,
3864 name = L["Enable"],
3865 width = 'full',
3866 set = function(info, value)
3867 if value == true then
3868 E.Options.args.unitframe.args.player.args.classbar.args.height.max = 300
3869 else
3870 E.Options.args.unitframe.args.player.args.classbar.args.height.max = 30
3871 end
3872 E.db.unitframe.units.player.classbar[info[#info]] = value;
3873 UF:CreateAndUpdateUF('player')
3874 end,
3875 },
3876 detachedWidth = {
3877 type = 'range',
3878 order = 2,
3879 name = L["Detached Width"],
3880 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3881 min = ((E.db.unitframe.thinBorders or E.PixelMode) and 3 or 7), max = 800, step = 1,
3882 },
3883 orientation = {
3884 type = 'select',
3885 order = 3,
3886 name = L["Frame Orientation"],
3887 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3888 values = {
3889 ['HORIZONTAL'] = L["Horizontal"],
3890 ['VERTICAL'] = L["Vertical"],
3891 },
3892 },
3893 verticalOrientation = {
3894 order = 4,
3895 type = "toggle",
3896 name = L["Vertical Fill Direction"],
3897 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3898 },
3899 spacing = {
3900 order = 5,
3901 type = "range",
3902 name = L["Spacing"],
3903 min = ((E.db.unitframe.thinBorders or E.PixelMode) and -1 or -4), max = 20, step = 1,
3904 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3905 },
3906 parent = {
3907 type = 'select',
3908 order = 6,
3909 name = L["Parent"],
3910 desc = L["Choose UIPARENT to prevent it from hiding with the unitframe."],
3911 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3912 values = {
3913 ["FRAME"] = "FRAME",
3914 ["UIPARENT"] = "UIPARENT",
3915 },
3916 },
3917 strataAndLevel = {
3918 order = 10,
3919 type = "group",
3920 name = L["Strata and Level"],
3921 get = function(info) return E.db.unitframe.units.player.classbar.strataAndLevel[info[#info]] end,
3922 set = function(info, value) E.db.unitframe.units.player.classbar.strataAndLevel[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
3923 guiInline = true,
3924 disabled = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3925 hidden = function() return not E.db.unitframe.units.player.classbar.detachFromFrame end,
3926 args = {
3927 useCustomStrata = {
3928 order = 1,
3929 type = "toggle",
3930 name = L["Use Custom Strata"],
3931 },
3932 frameStrata = {
3933 order = 2,
3934 type = "select",
3935 name = L["Frame Strata"],
3936 values = {
3937 ["BACKGROUND"] = "BACKGROUND",
3938 ["LOW"] = "LOW",
3939 ["MEDIUM"] = "MEDIUM",
3940 ["HIGH"] = "HIGH",
3941 ["DIALOG"] = "DIALOG",
3942 ["TOOLTIP"] = "TOOLTIP",
3943 },
3944 },
3945 spacer = {
3946 order = 3,
3947 type = "description",
3948 name = "",
3949 },
3950 useCustomLevel = {
3951 order = 4,
3952 type = "toggle",
3953 name = L["Use Custom Level"],
3954 },
3955 frameLevel = {
3956 order = 5,
3957 type = "range",
3958 name = L["Frame Level"],
3959 min = 2, max = 128, step = 1,
3960 },
3961 },
3962 },
3963 },
3964 },
3965 },
3966 },
3967 RestIcon = {
3968 order = 430,
3969 type = 'group',
3970 name = L["Rest Icon"],
3971 get = function(info) return E.db.unitframe.units.player.RestIcon[info[#info]] end,
3972 set = function(info, value) E.db.unitframe.units.player.RestIcon[info[#info]] = value; UF:CreateAndUpdateUF('player'); UF:TestingDisplay_RestingIndicator(ElvUF_Player); end,
3973 args = {
3974 header = {
3975 order = 1,
3976 type = "header",
3977 name = L["Rest Icon"],
3978 },
3979 enable = {
3980 order = 2,
3981 type = "toggle",
3982 name = L["Enable"],
3983 },
3984 defaultColor = {
3985 order = 3,
3986 type = "toggle",
3987 name = L["Default Color"],
3988 },
3989 color = {
3990 order = 4,
3991 type = "color",
3992 name = COLOR,
3993 hasAlpha = true,
3994 disabled = function()
3995 return E.db.unitframe.units.player.RestIcon.defaultColor
3996 end,
3997 get = function()
3998 local c = E.db.unitframe.units.player.RestIcon.color
3999 local d = P.unitframe.units.player.RestIcon.color
4000 return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
4001 end,
4002 set = function(_, r, g, b, a)
4003 local c = E.db.unitframe.units.player.RestIcon.color
4004 c.r, c.g, c.b, c.a = r, g, b, a
4005 UF:CreateAndUpdateUF('player');
4006 UF:TestingDisplay_RestingIndicator(ElvUF_Player);
4007 end,
4008 },
4009 size = {
4010 order = 5,
4011 type = "range",
4012 name = L["Size"],
4013 min = 10, max = 60, step = 1,
4014 },
4015 xOffset = {
4016 order = 6,
4017 type = "range",
4018 name = L["X-Offset"],
4019 min = -100, max = 100, step = 1,
4020 },
4021 yOffset = {
4022 order = 7,
4023 type = "range",
4024 name = L["Y-Offset"],
4025 min = -100, max = 100, step = 1,
4026 },
4027 spacer2 = {
4028 order = 8,
4029 type = "description",
4030 name = " ",
4031 },
4032 anchorPoint = {
4033 order = 9,
4034 type = "select",
4035 name = L["Anchor Point"],
4036 values = positionValues,
4037 },
4038 texture = {
4039 order = 10,
4040 type = "select",
4041 sortByValue = true,
4042 name = L["Texture"],
4043 values = {
4044 ["CUSTOM"] = L["CUSTOM"],
4045 ["DEFAULT"] = L["DEFAULT"],
4046 ["RESTING"] = E:TextureString(E.Media.Textures.Resting, ":14"),
4047 ["RESTING1"] = E:TextureString(E.Media.Textures.Resting1, ":14"),
4048 },
4049 },
4050 customTexture = {
4051 type = 'input',
4052 order = 11,
4053 customWidth = 250,
4054 name = L["Custom Texture"],
4055 disabled = function()
4056 return E.db.unitframe.units.player.RestIcon.texture ~= "CUSTOM"
4057 end,
4058 set = function(_, value)
4059 E.db.unitframe.units.player.RestIcon.customTexture = (value and (not value:match("^%s-$")) and value) or nil
4060 UF:CreateAndUpdateUF('player');
4061 UF:TestingDisplay_RestingIndicator(ElvUF_Player);
4062 end
4063 },
4064 },
4065 },
4066 CombatIcon = {
4067 order = 440,
4068 type = 'group',
4069 name = L["Combat Icon"],
4070 get = function(info) return E.db.unitframe.units.player.CombatIcon[info[#info]] end,
4071 set = function(info, value) E.db.unitframe.units.player.CombatIcon[info[#info]] = value; UF:CreateAndUpdateUF('player'); UF:TestingDisplay_CombatIndicator(ElvUF_Player); end,
4072 args = {
4073 header = {
4074 order = 1,
4075 type = "header",
4076 name = L["Combat Icon"],
4077 },
4078 enable = {
4079 order = 2,
4080 type = "toggle",
4081 name = L["Enable"],
4082 },
4083 defaultColor = {
4084 order = 3,
4085 type = "toggle",
4086 name = L["Default Color"],
4087 },
4088 color = {
4089 order = 4,
4090 type = "color",
4091 name = L["COLOR"],
4092 hasAlpha = true,
4093 disabled = function()
4094 return E.db.unitframe.units.player.CombatIcon.defaultColor
4095 end,
4096 get = function()
4097 local c = E.db.unitframe.units.player.CombatIcon.color
4098 local d = P.unitframe.units.player.CombatIcon.color
4099 return c.r, c.g, c.b, c.a, d.r, d.g, d.b, d.a
4100 end,
4101 set = function(_, r, g, b, a)
4102 local c = E.db.unitframe.units.player.CombatIcon.color
4103 c.r, c.g, c.b, c.a = r, g, b, a
4104 UF:CreateAndUpdateUF('player');
4105 UF:TestingDisplay_CombatIndicator(ElvUF_Player);
4106 end,
4107 },
4108 size = {
4109 order = 5,
4110 type = "range",
4111 name = L["Size"],
4112 min = 10, max = 60, step = 1,
4113 },
4114 xOffset = {
4115 order = 6,
4116 type = "range",
4117 name = L["X-Offset"],
4118 min = -100, max = 100, step = 1,
4119 },
4120 yOffset = {
4121 order = 7,
4122 type = "range",
4123 name = L["Y-Offset"],
4124 min = -100, max = 100, step = 1,
4125 },
4126 spacer2 = {
4127 order = 8,
4128 type = "description",
4129 name = " ",
4130 },
4131 anchorPoint = {
4132 order = 9,
4133 type = "select",
4134 name = L["Anchor Point"],
4135 values = positionValues,
4136 },
4137 texture = {
4138 order = 10,
4139 type = "select",
4140 sortByValue = true,
4141 name = L["Texture"],
4142 values = {
4143 ["CUSTOM"] = L["CUSTOM"],
4144 ["DEFAULT"] = L["DEFAULT"],
4145 ["COMBAT"] = E:TextureString(E.Media.Textures.Combat, ":14"),
4146 ["PLATINUM"] = [[|TInterface\Challenges\ChallengeMode_Medal_Platinum:14|t]],
4147 ["ATTACK"] = [[|TInterface\CURSOR\Attack:14|t]],
4148 ["ALERT"] = [[|TInterface\DialogFrame\UI-Dialog-Icon-AlertNew:14|t]],
4149 ["ALERT2"] = [[|TInterface\OptionsFrame\UI-OptionsFrame-NewFeatureIcon:14|t]],
4150 ["ARTHAS"] =[[|TInterface\LFGFRAME\UI-LFR-PORTRAIT:14|t]],
4151 ["SKULL"] = [[|TInterface\LootFrame\LootPanel-Icon:14|t]],
4152 },
4153 },
4154 customTexture = {
4155 type = 'input',
4156 order = 11,
4157 customWidth = 250,
4158 name = L["Custom Texture"],
4159 disabled = function()
4160 return E.db.unitframe.units.player.CombatIcon.texture ~= "CUSTOM"
4161 end,
4162 set = function(_, value)
4163 E.db.unitframe.units.player.CombatIcon.customTexture = (value and (not value:match("^%s-$")) and value) or nil
4164 UF:CreateAndUpdateUF('player');
4165 UF:TestingDisplay_CombatIndicator(ElvUF_Player);
4166 end
4167 },
4168 },
4169 },
4170 pvpIcon = {
4171 order = 450,
4172 type = 'group',
4173 name = L["PvP & Prestige Icon"],
4174 get = function(info) return E.db.unitframe.units.player.pvpIcon[info[#info]] end,
4175 set = function(info, value) E.db.unitframe.units.player.pvpIcon[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
4176 args = {
4177 header = {
4178 order = 1,
4179 type = "header",
4180 name = L["PvP & Prestige Icon"],
4181 },
4182 enable = {
4183 order = 2,
4184 type = "toggle",
4185 name = L["Enable"],
4186 },
4187 scale = {
4188 order = 3,
4189 type = "range",
4190 name = L["Scale"],
4191 isPercent = true,
4192 min = 0.1, max = 2, step = 0.01,
4193 },
4194 spacer = {
4195 order = 4,
4196 type = "description",
4197 name = " ",
4198 },
4199 anchorPoint = {
4200 order = 5,
4201 type = "select",
4202 name = L["Anchor Point"],
4203 values = positionValues,
4204 },
4205 xOffset = {
4206 order = 6,
4207 type = "range",
4208 name = L["X-Offset"],
4209 min = -100, max = 100, step = 1,
4210 },
4211 yOffset = {
4212 order = 7,
4213 type = "range",
4214 name = L["Y-Offset"],
4215 min = -100, max = 100, step = 1,
4216 },
4217 },
4218 },
4219 pvpText = {
4220 order = 460,
4221 type = 'group',
4222 name = L["PvP Text"],
4223 get = function(info) return E.db.unitframe.units.player.pvp[info[#info]] end,
4224 set = function(info, value) E.db.unitframe.units.player.pvp[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
4225 args = {
4226 header = {
4227 order = 1,
4228 type = "header",
4229 name =L["PvP Text"],
4230 },
4231 position = {
4232 type = 'select',
4233 order = 2,
4234 name = L["Position"],
4235 values = positionValues,
4236 },
4237 text_format = {
4238 order = 100,
4239 name = L["Text Format"],
4240 type = 'input',
4241 width = 'full',
4242 desc = L["TEXT_FORMAT_DESC"],
4243 },
4244 },
4245 },
4246 raidRoleIcons = {
4247 order = 703,
4248 type = 'group',
4249 name = L["RL Icon"],
4250 get = function(info) return E.db.unitframe.units.player.raidRoleIcons[info[#info]] end,
4251 set = function(info, value) E.db.unitframe.units.player.raidRoleIcons[info[#info]] = value; UF:CreateAndUpdateUF('player') end,
4252 args = {
4253 header = {
4254 order = 1,
4255 type = "header",
4256 name = L["RL Icon"],
4257 },
4258 enable = {
4259 type = 'toggle',
4260 name = L["Enable"],
4261 order = 2,
4262 },
4263 position = {
4264 type = 'select',
4265 order = 3,
4266 name = L["Position"],
4267 values = {
4268 ['TOPLEFT'] = 'TOPLEFT',
4269 ['TOPRIGHT'] = 'TOPRIGHT',
4270 },
4271 },
4272 },
4273 },
4274 },
4275}
4276
4277--Target
4278E.Options.args.unitframe.args.target = {
4279 name = L["TARGET"],
4280 type = 'group',
4281 order = 400,
4282 childGroups = "tab",
4283 get = function(info) return E.db.unitframe.units.target[info[#info]] end,
4284 set = function(info, value) E.db.unitframe.units.target[info[#info]] = value; UF:CreateAndUpdateUF('target') end,
4285 disabled = function() return not E.UnitFrames.Initialized end,
4286 args = {
4287 enable = {
4288 type = 'toggle',
4289 order = 1,
4290 name = L["Enable"],
4291 },
4292 showAuras = {
4293 order = 2,
4294 type = 'execute',
4295 name = L["Show Auras"],
4296 func = function()
4297 local frame = ElvUF_Target
4298 if frame.forceShowAuras then
4299 frame.forceShowAuras = nil;
4300 else
4301 frame.forceShowAuras = true;
4302 end
4303
4304 UF:CreateAndUpdateUF('target')
4305 end,
4306 },
4307 resetSettings = {
4308 type = 'execute',
4309 order = 3,
4310 name = L["Restore Defaults"],
4311 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Target Frame"], nil, {unit='target', mover='Target Frame'}) end,
4312 },
4313 copyFrom = {
4314 type = 'select',
4315 order = 4,
4316 name = L["Copy From"],
4317 desc = L["Select a unit to copy settings from."],
4318 values = UF.units,
4319 set = function(info, value) UF:MergeUnitSettings(value, 'target'); end,
4320 },
4321 generalGroup = {
4322 order = 5,
4323 type = "group",
4324 name = L["General"],
4325 args = {
4326 header = {
4327 order = 1,
4328 type = "header",
4329 name = L["General"],
4330 },
4331 width = {
4332 order = 3,
4333 name = L["Width"],
4334 type = 'range',
4335 min = 50, max = 1000, step = 1,
4336 set = function(info, value)
4337 if E.db.unitframe.units.target.castbar.width == E.db.unitframe.units.target[info[#info]] then
4338 E.db.unitframe.units.target.castbar.width = value;
4339 end
4340
4341 E.db.unitframe.units.target[info[#info]] = value;
4342 UF:CreateAndUpdateUF('target');
4343 end,
4344 },
4345 height = {
4346 order = 4,
4347 name = L["Height"],
4348 type = 'range',
4349 min = 10, max = 500, step = 1,
4350 },
4351 hideonnpc = {
4352 type = 'toggle',
4353 order = 6,
4354 name = L["Text Toggle On NPC"],
4355 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4356 get = function(info) return E.db.unitframe.units.target.power.hideonnpc end,
4357 set = function(info, value) E.db.unitframe.units.target.power.hideonnpc = value; UF:CreateAndUpdateUF('target') end,
4358 },
4359 smartAuraPosition = {
4360 order = 9,
4361 type = "select",
4362 name = L["Smart Aura Position"],
4363 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
4364 values = smartAuraPositionValues,
4365 },
4366 orientation = {
4367 order = 10,
4368 type = "select",
4369 name = L["Frame Orientation"],
4370 desc = L["Set the orientation of the UnitFrame."],
4371 values = orientationValues,
4372 },
4373 colorOverride = {
4374 order = 11,
4375 name = L["Class Color Override"],
4376 desc = L["Override the default class color setting."],
4377 type = 'select',
4378 values = colorOverrideValues,
4379 },
4380 disableMouseoverGlow = {
4381 order = 12,
4382 type = "toggle",
4383 name = L["Block Mouseover Glow"],
4384 desc = L["Forces Mouseover Glow to be disabled for these frames"],
4385 },
4386 disableTargetGlow = {
4387 order = 13,
4388 type = "toggle",
4389 name = L["Block Target Glow"],
4390 desc = L["Forces Target Glow to be disabled for these frames"],
4391 },
4392 },
4393 },
4394 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateUF, 'target'),
4395 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'target'),
4396 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'target'),
4397 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'target'),
4398 power = GetOptionsTable_Power(true, UF.CreateAndUpdateUF, 'target', nil, true),
4399 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'target'),
4400 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'target'),
4401 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'target'),
4402 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'target'),
4403 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'target'),
4404 castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateUF, 'target'),
4405 aurabar = GetOptionsTable_AuraBars(UF.CreateAndUpdateUF, 'target'),
4406 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, 'target'),
4407 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'target'),
4408 pvpIcon = {
4409 order = 449,
4410 type = 'group',
4411 name = L["PvP & Prestige Icon"],
4412 get = function(info) return E.db.unitframe.units.target.pvpIcon[info[#info]] end,
4413 set = function(info, value) E.db.unitframe.units.target.pvpIcon[info[#info]] = value; UF:CreateAndUpdateUF('target') end,
4414 args = {
4415 header = {
4416 order = 1,
4417 type = "header",
4418 name = L["PvP & Prestige Icon"],
4419 },
4420 enable = {
4421 order = 2,
4422 type = "toggle",
4423 name = L["Enable"],
4424 },
4425 scale = {
4426 order = 3,
4427 type = "range",
4428 name = L["Scale"],
4429 isPercent = true,
4430 min = 0.1, max = 2, step = 0.01,
4431 },
4432 spacer = {
4433 order = 4,
4434 type = "description",
4435 name = " ",
4436 },
4437 anchorPoint = {
4438 order = 5,
4439 type = "select",
4440 name = L["Anchor Point"],
4441 values = positionValues,
4442 },
4443 xOffset = {
4444 order = 6,
4445 type = "range",
4446 name = L["X-Offset"],
4447 min = -100, max = 100, step = 1,
4448 },
4449 yOffset = {
4450 order = 7,
4451 type = "range",
4452 name = L["Y-Offset"],
4453 min = -100, max = 100, step = 1,
4454 },
4455 },
4456 },
4457 phaseIndicator = {
4458 order = 450,
4459 type = 'group',
4460 name = L["Phase Indicator"],
4461 get = function(info) return E.db.unitframe.units.target.phaseIndicator[info[#info]] end,
4462 set = function(info, value) E.db.unitframe.units.target.phaseIndicator[info[#info]] = value; UF:CreateAndUpdateUF('target') end,
4463 args = {
4464 header = {
4465 order = 1,
4466 type = "header",
4467 name = L["Phase Indicator"],
4468 },
4469 enable = {
4470 order = 2,
4471 type = "toggle",
4472 name = L["Enable"],
4473 },
4474 scale = {
4475 order = 3,
4476 type = "range",
4477 name = L["Scale"],
4478 isPercent = true,
4479 min = 0.5, max = 1.5, step = 0.01,
4480 },
4481 spacer = {
4482 order = 4,
4483 type = "description",
4484 name = " ",
4485 },
4486 anchorPoint = {
4487 order = 5,
4488 type = "select",
4489 name = L["Anchor Point"],
4490 values = positionValues,
4491 },
4492 xOffset = {
4493 order = 6,
4494 type = "range",
4495 name = L["X-Offset"],
4496 min = -100, max = 100, step = 1,
4497 },
4498 yOffset = {
4499 order = 7,
4500 type = "range",
4501 name = L["Y-Offset"],
4502 min = -100, max = 100, step = 1,
4503 },
4504 },
4505 },
4506 },
4507}
4508
4509--TargetTarget
4510E.Options.args.unitframe.args.targettarget = {
4511 name = L["TargetTarget"],
4512 type = 'group',
4513 order = 500,
4514 childGroups = "tab",
4515 get = function(info) return E.db.unitframe.units.targettarget[info[#info]] end,
4516 set = function(info, value) E.db.unitframe.units.targettarget[info[#info]] = value; UF:CreateAndUpdateUF('targettarget') end,
4517 disabled = function() return not E.UnitFrames.Initialized end,
4518 args = {
4519 enable = {
4520 type = 'toggle',
4521 order = 1,
4522 name = L["Enable"],
4523 },
4524 showAuras = {
4525 order = 2,
4526 type = 'execute',
4527 name = L["Show Auras"],
4528 func = function()
4529 local frame = ElvUF_TargetTarget
4530 if frame.forceShowAuras then
4531 frame.forceShowAuras = nil;
4532 else
4533 frame.forceShowAuras = true;
4534 end
4535
4536 UF:CreateAndUpdateUF('targettarget')
4537 end,
4538 },
4539 resetSettings = {
4540 type = 'execute',
4541 order = 3,
4542 name = L["Restore Defaults"],
4543 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["TargetTarget Frame"], nil, {unit='targettarget', mover='TargetTarget Frame'}) end,
4544 },
4545 copyFrom = {
4546 type = 'select',
4547 order = 4,
4548 name = L["Copy From"],
4549 desc = L["Select a unit to copy settings from."],
4550 values = UF.units,
4551 set = function(info, value) UF:MergeUnitSettings(value, 'targettarget'); end,
4552 },
4553 generalGroup = {
4554 order = 5,
4555 type = "group",
4556 name = L["General"],
4557 args = {
4558 header = {
4559 order = 1,
4560 type = "header",
4561 name = L["General"],
4562 },
4563 width = {
4564 order = 3,
4565 name = L["Width"],
4566 type = 'range',
4567 min = 50, max = 1000, step = 1,
4568 },
4569 height = {
4570 order = 4,
4571 name = L["Height"],
4572 type = 'range',
4573 min = 10, max = 500, step = 1,
4574 },
4575 hideonnpc = {
4576 type = 'toggle',
4577 order = 6,
4578 name = L["Text Toggle On NPC"],
4579 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4580 get = function(info) return E.db.unitframe.units.targettarget.power.hideonnpc end,
4581 set = function(info, value) E.db.unitframe.units.targettarget.power.hideonnpc = value; UF:CreateAndUpdateUF('targettarget') end,
4582 },
4583 smartAuraPosition = {
4584 order = 8,
4585 type = "select",
4586 name = L["Smart Aura Position"],
4587 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
4588 values = {
4589 ["DISABLED"] = L["DISABLE"],
4590 ["BUFFS_ON_DEBUFFS"] = L["Position Buffs on Debuffs"],
4591 ["DEBUFFS_ON_BUFFS"] = L["Position Debuffs on Buffs"],
4592 },
4593 },
4594 orientation = {
4595 order = 9,
4596 type = "select",
4597 name = L["Frame Orientation"],
4598 desc = L["Set the orientation of the UnitFrame."],
4599 values = orientationValues,
4600 },
4601 colorOverride = {
4602 order = 10,
4603 name = L["Class Color Override"],
4604 desc = L["Override the default class color setting."],
4605 type = 'select',
4606 values = colorOverrideValues,
4607 },
4608 spacer = {
4609 order = 11,
4610 type = "description",
4611 name = "",
4612 },
4613 disableMouseoverGlow = {
4614 order = 12,
4615 type = "toggle",
4616 name = L["Block Mouseover Glow"],
4617 desc = L["Forces Mouseover Glow to be disabled for these frames"],
4618 },
4619 disableTargetGlow = {
4620 order = 13,
4621 type = "toggle",
4622 name = L["Block Target Glow"],
4623 desc = L["Forces Target Glow to be disabled for these frames"],
4624 },
4625 },
4626 },
4627 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'targettarget'),
4628 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'targettarget'),
4629 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'targettarget'),
4630 power = GetOptionsTable_Power(nil, UF.CreateAndUpdateUF, 'targettarget'),
4631 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'targettarget'),
4632 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'targettarget'),
4633 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'targettarget'),
4634 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'targettarget'),
4635 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'targettarget'),
4636 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, 'targettarget'),
4637 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'targettarget'),
4638 },
4639}
4640
4641--TargetTargetTarget
4642E.Options.args.unitframe.args.targettargettarget = {
4643 name = L["TargetTargetTarget"],
4644 type = 'group',
4645 order = 500,
4646 childGroups = "tab",
4647 get = function(info) return E.db.unitframe.units.targettargettarget[info[#info]] end,
4648 set = function(info, value) E.db.unitframe.units.targettargettarget[info[#info]] = value; UF:CreateAndUpdateUF('targettargettarget') end,
4649 disabled = function() return not E.UnitFrames.Initialized end,
4650 args = {
4651 enable = {
4652 type = 'toggle',
4653 order = 1,
4654 name = L["Enable"],
4655 },
4656 showAuras = {
4657 order = 2,
4658 type = 'execute',
4659 name = L["Show Auras"],
4660 func = function()
4661 local frame = ElvUF_TargetTargetTarget
4662 if frame.forceShowAuras then
4663 frame.forceShowAuras = nil;
4664 else
4665 frame.forceShowAuras = true;
4666 end
4667
4668 UF:CreateAndUpdateUF('targettargettarget')
4669 end,
4670 },
4671 resetSettings = {
4672 type = 'execute',
4673 order = 3,
4674 name = L["Restore Defaults"],
4675 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["TargetTargetTarget Frame"], nil, {unit='targettargettarget', mover='TargetTargetTarget Frame'}) end,
4676 },
4677 copyFrom = {
4678 type = 'select',
4679 order = 4,
4680 name = L["Copy From"],
4681 desc = L["Select a unit to copy settings from."],
4682 values = UF.units,
4683 set = function(info, value) UF:MergeUnitSettings(value, 'targettargettarget'); end,
4684 },
4685 generalGroup = {
4686 order = 5,
4687 type = "group",
4688 name = L["General"],
4689 args = {
4690 header = {
4691 order = 1,
4692 type = "header",
4693 name = L["General"],
4694 },
4695 width = {
4696 order = 3,
4697 name = L["Width"],
4698 type = 'range',
4699 min = 50, max = 1000, step = 1,
4700 },
4701 height = {
4702 order = 4,
4703 name = L["Height"],
4704 type = 'range',
4705 min = 10, max = 500, step = 1,
4706 },
4707 hideonnpc = {
4708 type = 'toggle',
4709 order = 6,
4710 name = L["Text Toggle On NPC"],
4711 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4712 get = function(info) return E.db.unitframe.units.targettargettarget.power.hideonnpc end,
4713 set = function(info, value) E.db.unitframe.units.targettargettarget.power.hideonnpc = value; UF:CreateAndUpdateUF('targettargettarget') end,
4714 },
4715 smartAuraPosition = {
4716 order = 8,
4717 type = "select",
4718 name = L["Smart Aura Position"],
4719 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
4720 values = smartAuraPositionValues,
4721 },
4722 orientation = {
4723 order = 9,
4724 type = "select",
4725 name = L["Frame Orientation"],
4726 desc = L["Set the orientation of the UnitFrame."],
4727 values = orientationValues,
4728 },
4729 colorOverride = {
4730 order = 10,
4731 name = L["Class Color Override"],
4732 desc = L["Override the default class color setting."],
4733 type = 'select',
4734 values = colorOverrideValues,
4735 },
4736 spacer = {
4737 order = 11,
4738 type = "description",
4739 name = "",
4740 },
4741 disableMouseoverGlow = {
4742 order = 12,
4743 type = "toggle",
4744 name = L["Block Mouseover Glow"],
4745 desc = L["Forces Mouseover Glow to be disabled for these frames"],
4746 },
4747 disableTargetGlow = {
4748 order = 13,
4749 type = "toggle",
4750 name = L["Block Target Glow"],
4751 desc = L["Forces Target Glow to be disabled for these frames"],
4752 },
4753 },
4754 },
4755 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'targettargettarget'),
4756 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'targettargettarget'),
4757 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'targettargettarget'),
4758 power = GetOptionsTable_Power(nil, UF.CreateAndUpdateUF, 'targettargettarget'),
4759 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'targettargettarget'),
4760 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'targettargettarget'),
4761 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'targettargettarget'),
4762 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'targettargettarget'),
4763 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'targettargettarget'),
4764 raidicon = GetOptionsTable_RaidIcon(UF.CreateAndUpdateUF, 'targettargettarget'),
4765 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'targettargettarget'),
4766 },
4767}
4768
4769--Pet
4770E.Options.args.unitframe.args.pet = {
4771 name = L["PET"],
4772 type = 'group',
4773 order = 800,
4774 childGroups = "tab",
4775 get = function(info) return E.db.unitframe.units.pet[info[#info]] end,
4776 set = function(info, value) E.db.unitframe.units.pet[info[#info]] = value; UF:CreateAndUpdateUF('pet') end,
4777 disabled = function() return not E.UnitFrames.Initialized end,
4778 args = {
4779 enable = {
4780 type = 'toggle',
4781 order = 1,
4782 name = L["Enable"],
4783 },
4784 showAuras = {
4785 order = 2,
4786 type = 'execute',
4787 name = L["Show Auras"],
4788 func = function()
4789 local frame = ElvUF_Pet
4790 if frame.forceShowAuras then
4791 frame.forceShowAuras = nil;
4792 else
4793 frame.forceShowAuras = true;
4794 end
4795
4796 UF:CreateAndUpdateUF('pet')
4797 end,
4798 },
4799 resetSettings = {
4800 type = 'execute',
4801 order = 3,
4802 name = L["Restore Defaults"],
4803 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Pet Frame"], nil, {unit='pet', mover='Pet Frame'}) end,
4804 },
4805 copyFrom = {
4806 type = 'select',
4807 order = 4,
4808 name = L["Copy From"],
4809 desc = L["Select a unit to copy settings from."],
4810 values = UF.units,
4811 set = function(info, value) UF:MergeUnitSettings(value, 'pet'); end,
4812 },
4813 generalGroup = {
4814 order = 5,
4815 type = "group",
4816 name = L["General"],
4817 args = {
4818 header = {
4819 order = 1,
4820 type = "header",
4821 name = L["General"],
4822 },
4823 width = {
4824 order = 3,
4825 name = L["Width"],
4826 type = 'range',
4827 min = 50, max = 1000, step = 1,
4828 },
4829 height = {
4830 order = 4,
4831 name = L["Height"],
4832 type = 'range',
4833 min = 10, max = 500, step = 1,
4834 },
4835 hideonnpc = {
4836 type = 'toggle',
4837 order = 6,
4838 name = L["Text Toggle On NPC"],
4839 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4840 get = function(info) return E.db.unitframe.units.pet.power.hideonnpc end,
4841 set = function(info, value) E.db.unitframe.units.pet.power.hideonnpc = value; UF:CreateAndUpdateUF('pet') end,
4842 },
4843 smartAuraPosition = {
4844 order = 8,
4845 type = "select",
4846 name = L["Smart Aura Position"],
4847 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
4848 values = smartAuraPositionValues,
4849 },
4850 orientation = {
4851 order = 9,
4852 type = "select",
4853 name = L["Frame Orientation"],
4854 desc = L["Set the orientation of the UnitFrame."],
4855 values = orientationValues,
4856 },
4857 colorOverride = {
4858 order = 10,
4859 name = L["Class Color Override"],
4860 desc = L["Override the default class color setting."],
4861 type = 'select',
4862 values = colorOverrideValues,
4863 },
4864 disableMouseoverGlow = {
4865 order = 11,
4866 type = "toggle",
4867 name = L["Block Mouseover Glow"],
4868 desc = L["Forces Mouseover Glow to be disabled for these frames"],
4869 },
4870 disableTargetGlow = {
4871 order = 12,
4872 type = "toggle",
4873 name = L["Block Target Glow"],
4874 desc = L["Forces Target Glow to be disabled for these frames"],
4875 },
4876 },
4877 },
4878 buffIndicator = {
4879 order = 600,
4880 type = 'group',
4881 name = L["Buff Indicator"],
4882 get = function(info) return E.db.unitframe.units.pet.buffIndicator[info[#info]] end,
4883 set = function(info, value) E.db.unitframe.units.pet.buffIndicator[info[#info]] = value; UF:CreateAndUpdateUF('pet') end,
4884 args = {
4885 header = {
4886 order = 1,
4887 type = "header",
4888 name = L["Buff Indicator"],
4889 },
4890 enable = {
4891 type = 'toggle',
4892 name = L["Enable"],
4893 order = 2,
4894 },
4895 size = {
4896 type = 'range',
4897 name = L["Size"],
4898 desc = L["Size of the indicator icon."],
4899 order = 3,
4900 min = 4, max = 50, step = 1,
4901 },
4902 fontSize = {
4903 type = 'range',
4904 name = L["FONT_SIZE"],
4905 order = 4,
4906 min = 7, max = 212, step = 1,
4907 },
4908 },
4909 },
4910 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateUF, 'pet'),
4911 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'pet'),
4912 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'pet'),
4913 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'pet'),
4914 power = GetOptionsTable_Power(false, UF.CreateAndUpdateUF, 'pet'),
4915 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'pet'),
4916 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'pet'),
4917 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'pet'),
4918 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'pet'),
4919 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'pet'),
4920 castbar = GetOptionsTable_Castbar(false, UF.CreateAndUpdateUF, 'pet'),
4921 aurabar = GetOptionsTable_AuraBars(UF.CreateAndUpdateUF, 'pet'),
4922 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'pet'),
4923 },
4924}
4925
4926--Pet Target
4927E.Options.args.unitframe.args.pettarget = {
4928 name = L["PetTarget"],
4929 type = 'group',
4930 order = 900,
4931 childGroups = "tab",
4932 get = function(info) return E.db.unitframe.units.pettarget[info[#info]] end,
4933 set = function(info, value) E.db.unitframe.units.pettarget[info[#info]] = value; UF:CreateAndUpdateUF('pettarget') end,
4934 disabled = function() return not E.UnitFrames.Initialized end,
4935 args = {
4936 enable = {
4937 type = 'toggle',
4938 order = 1,
4939 name = L["Enable"],
4940 },
4941 showAuras = {
4942 order = 2,
4943 type = 'execute',
4944 name = L["Show Auras"],
4945 func = function()
4946 local frame = ElvUF_PetTarget
4947 if frame.forceShowAuras then
4948 frame.forceShowAuras = nil;
4949 else
4950 frame.forceShowAuras = true;
4951 end
4952
4953 UF:CreateAndUpdateUF('pettarget')
4954 end,
4955 },
4956 resetSettings = {
4957 type = 'execute',
4958 order = 3,
4959 name = L["Restore Defaults"],
4960 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["PetTarget Frame"], nil, {unit='pettarget', mover='PetTarget Frame'}) end,
4961 },
4962 copyFrom = {
4963 type = 'select',
4964 order = 4,
4965 name = L["Copy From"],
4966 desc = L["Select a unit to copy settings from."],
4967 values = UF.units,
4968 set = function(info, value) UF:MergeUnitSettings(value, 'pettarget'); end,
4969 },
4970 generalGroup = {
4971 order = 5,
4972 type = "group",
4973 name = L["General"],
4974 args = {
4975 header = {
4976 order = 1,
4977 type = "header",
4978 name = L["General"],
4979 },
4980 width = {
4981 order = 3,
4982 name = L["Width"],
4983 type = 'range',
4984 min = 50, max = 1000, step = 1,
4985 },
4986 height = {
4987 order = 4,
4988 name = L["Height"],
4989 type = 'range',
4990 min = 10, max = 500, step = 1,
4991 },
4992 hideonnpc = {
4993 type = 'toggle',
4994 order = 6,
4995 name = L["Text Toggle On NPC"],
4996 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
4997 get = function(info) return E.db.unitframe.units.pettarget.power.hideonnpc end,
4998 set = function(info, value) E.db.unitframe.units.pettarget.power.hideonnpc = value; UF:CreateAndUpdateUF('pettarget') end,
4999 },
5000 smartAuraPosition = {
5001 order = 8,
5002 type = "select",
5003 name = L["Smart Aura Position"],
5004 desc = L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."],
5005 values = smartAuraPositionValues,
5006 },
5007 orientation = {
5008 order = 9,
5009 type = "select",
5010 name = L["Frame Orientation"],
5011 desc = L["Set the orientation of the UnitFrame."],
5012 values = orientationValues,
5013 },
5014 colorOverride = {
5015 order = 10,
5016 name = L["Class Color Override"],
5017 desc = L["Override the default class color setting."],
5018 type = 'select',
5019 values = colorOverrideValues,
5020 },
5021 spacer = {
5022 order = 11,
5023 type = "description",
5024 name = "",
5025 },
5026 disableMouseoverGlow = {
5027 order = 12,
5028 type = "toggle",
5029 name = L["Block Mouseover Glow"],
5030 desc = L["Forces Mouseover Glow to be disabled for these frames"],
5031 },
5032 disableTargetGlow = {
5033 order = 13,
5034 type = "toggle",
5035 name = L["Block Target Glow"],
5036 desc = L["Forces Target Glow to be disabled for these frames"],
5037 },
5038 },
5039 },
5040 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateUF, 'pettarget'),
5041 health = GetOptionsTable_Health(false, UF.CreateAndUpdateUF, 'pettarget'),
5042 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateUF, 'pettarget'),
5043 power = GetOptionsTable_Power(false, UF.CreateAndUpdateUF, 'pettarget'),
5044 name = GetOptionsTable_Name(UF.CreateAndUpdateUF, 'pettarget'),
5045 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateUF, 'pettarget'),
5046 fader = GetOptionsTable_Fader(UF.CreateAndUpdateUF, 'pettarget'),
5047 buffs = GetOptionsTable_Auras('buffs', false, UF.CreateAndUpdateUF, 'pettarget'),
5048 debuffs = GetOptionsTable_Auras('debuffs', false, UF.CreateAndUpdateUF, 'pettarget'),
5049 cutaway = GetOptionsTable_Cutaway(UF.CreateAndUpdateUF, 'pettarget')
5050 },
5051}
5052
5053--Party Frames
5054E.Options.args.unitframe.args.party = {
5055 name = L["PARTY"],
5056 type = 'group',
5057 order = 1100,
5058 childGroups = "tab",
5059 get = function(info) return E.db.unitframe.units.party[info[#info]] end,
5060 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5061 disabled = function() return not E.UnitFrames.Initialized end,
5062 args = {
5063 enable = {
5064 type = 'toggle',
5065 order = 1,
5066 name = L["Enable"],
5067 },
5068 configureToggle = {
5069 order = 2,
5070 type = 'execute',
5071 name = L["Display Frames"],
5072 func = function()
5073 UF:HeaderConfig(ElvUF_Party, ElvUF_Party.forceShow ~= true or nil)
5074 end,
5075 },
5076 resetSettings = {
5077 type = 'execute',
5078 order = 3,
5079 name = L["Restore Defaults"],
5080 func = function(info) E:StaticPopup_Show('RESET_UF_UNIT', L["Party Frames"], nil, {unit='party', mover='Party Frames'}) end,
5081 },
5082 copyFrom = {
5083 type = 'select',
5084 order = 4,
5085 name = L["Copy From"],
5086 desc = L["Select a unit to copy settings from."],
5087 values = {
5088 ['raid'] = L["Raid Frames"],
5089 ['raid40'] = L["Raid40 Frames"],
5090 },
5091 set = function(info, value) UF:MergeUnitSettings(value, 'party', true); end,
5092 },
5093 customText = GetOptionsTable_CustomText(UF.CreateAndUpdateHeaderGroup, 'party'),
5094 generalGroup = {
5095 order = 6,
5096 type = 'group',
5097 name = L["General"],
5098 args = {
5099 header = {
5100 order = 1,
5101 type = "header",
5102 name = L["General"],
5103 },
5104 hideonnpc = {
5105 type = 'toggle',
5106 order = 3,
5107 name = L["Text Toggle On NPC"],
5108 desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."],
5109 get = function(info) return E.db.unitframe.units.party.power.hideonnpc end,
5110 set = function(info, value) E.db.unitframe.units.party.power.hideonnpc = value; UF:CreateAndUpdateHeaderGroup('party'); end,
5111 },
5112 colorOverride = {
5113 order = 7,
5114 name = L["Class Color Override"],
5115 desc = L["Override the default class color setting."],
5116 type = 'select',
5117 values = colorOverrideValues,
5118 },
5119 orientation = {
5120 order = 8,
5121 type = "select",
5122 name = L["Frame Orientation"],
5123 desc = L["Set the orientation of the UnitFrame."],
5124 values = orientationValues,
5125 },
5126 disableMouseoverGlow = {
5127 order = 9,
5128 type = "toggle",
5129 name = L["Block Mouseover Glow"],
5130 desc = L["Forces Mouseover Glow to be disabled for these frames"],
5131 },
5132 disableTargetGlow = {
5133 order = 10,
5134 type = "toggle",
5135 name = L["Block Target Glow"],
5136 desc = L["Forces Target Glow to be disabled for these frames"],
5137 },
5138 positionsGroup = {
5139 order = 100,
5140 name = L["Size and Positions"],
5141 type = 'group',
5142 guiInline = true,
5143 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party', nil, nil, true) end,
5144 args = {
5145 width = {
5146 order = 1,
5147 name = L["Width"],
5148 type = 'range',
5149 min = 10, max = 500, step = 1,
5150 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5151 },
5152 height = {
5153 order = 2,
5154 name = L["Height"],
5155 type = 'range',
5156 min = 10, max = 500, step = 1,
5157 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5158 },
5159 spacer = {
5160 order = 3,
5161 name = '',
5162 type = 'description',
5163 width = 'full',
5164 },
5165 growthDirection = {
5166 order = 4,
5167 name = L["Growth Direction"],
5168 desc = L["Growth direction from the first unitframe."],
5169 type = 'select',
5170 values = growthDirectionValues,
5171 },
5172 numGroups = {
5173 order = 7,
5174 type = 'range',
5175 name = L["Number of Groups"],
5176 min = 1, max = 8, step = 1,
5177 set = function(info, value)
5178 E.db.unitframe.units.party[info[#info]] = value;
5179 UF:CreateAndUpdateHeaderGroup('party')
5180 if ElvUF_Party.isForced then
5181 UF:HeaderConfig(ElvUF_Party)
5182 UF:HeaderConfig(ElvUF_Party, true)
5183 end
5184 end,
5185 },
5186 groupsPerRowCol = {
5187 order = 8,
5188 type = 'range',
5189 name = L["Groups Per Row/Column"],
5190 min = 1, max = 8, step = 1,
5191 set = function(info, value)
5192 E.db.unitframe.units.party[info[#info]] = value;
5193 UF:CreateAndUpdateHeaderGroup('party')
5194 if ElvUF_Party.isForced then
5195 UF:HeaderConfig(ElvUF_Party)
5196 UF:HeaderConfig(ElvUF_Party, true)
5197 end
5198 end,
5199 },
5200 horizontalSpacing = {
5201 order = 9,
5202 type = 'range',
5203 name = L["Horizontal Spacing"],
5204 min = -1, max = 50, step = 1,
5205 },
5206 verticalSpacing = {
5207 order = 10,
5208 type = 'range',
5209 name = L["Vertical Spacing"],
5210 min = -1, max = 50, step = 1,
5211 },
5212 groupSpacing = {
5213 order = 11,
5214 type = "range",
5215 name = L["Group Spacing"],
5216 desc = L["Additional spacing between each individual group."],
5217 min = 0, softMax = 50, step = 1,
5218 },
5219 },
5220 },
5221 visibilityGroup = {
5222 order = 200,
5223 name = L["Visibility"],
5224 type = 'group',
5225 guiInline = true,
5226 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party', nil, nil, true) end,
5227 args = {
5228 showPlayer = {
5229 order = 1,
5230 type = 'toggle',
5231 name = L["Display Player"],
5232 desc = L["When true, the header includes the player when not in a raid."],
5233 },
5234 visibility = {
5235 order = 2,
5236 type = 'input',
5237 name = L["Visibility"],
5238 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."],
5239 width = 'full',
5240 },
5241 },
5242 },
5243 sortingGroup = {
5244 order = 300,
5245 type = 'group',
5246 guiInline = true,
5247 name = L["Grouping & Sorting"],
5248 set = function(info, value) E.db.unitframe.units.party[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party', nil, nil, true) end,
5249 args = {
5250 groupBy = {
5251 order = 1,
5252 name = L["Group By"],
5253 desc = L["Set the order that the group will sort."],
5254 type = 'select',
5255 values = {
5256 ['CLASS'] = L["CLASS"],
5257 ['CLASSROLE'] = L["CLASS"]..' & '..L["ROLE"],
5258 ['ROLE'] = L["Role: Tank, Healer, Damage"],
5259 ['ROLE2'] = L["Role: Tank, Damage, Healer"],
5260 ['NAME'] = L["NAME"],
5261 ['MTMA'] = L["Main Tanks / Main Assist"],
5262 ['GROUP'] = L["GROUP"],
5263 },
5264 },
5265 sortDir = {
5266 order = 2,
5267 name = L["Sort Direction"],
5268 desc = L["Defines the sort order of the selected sort method."],
5269 type = 'select',
5270 values = {
5271 ['ASC'] = L["Ascending"],
5272 ['DESC'] = L["Descending"]
5273 },
5274 },
5275 spacer = {
5276 order = 3,
5277 type = 'description',
5278 width = 'full',
5279 name = ' '
5280 },
5281 raidWideSorting = {
5282 order = 4,
5283 name = L["Raid-Wide Sorting"],
5284 desc = L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."],
5285 type = 'toggle',
5286 },
5287 invertGroupingOrder = {
5288 order = 5,
5289 name = L["Invert Grouping Order"],
5290 desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."],
5291 disabled = function() return not E.db.unitframe.units.party.raidWideSorting end,
5292 type = 'toggle',
5293 },
5294 startFromCenter = {
5295 order = 6,
5296 name = L["Start Near Center"],
5297 desc = L["The initial group will start near the center and grow out."],
5298 disabled = function() return not E.db.unitframe.units.party.raidWideSorting end,
5299 type = 'toggle',
5300 },
5301 },
5302 },
5303 },
5304 },
5305 buffIndicator = {
5306 order = 701,
5307 type = 'group',
5308 name = L["Buff Indicator"],
5309 get = function(info) return E.db.unitframe.units.party.buffIndicator[info[#info]] end,
5310 set = function(info, value) E.db.unitframe.units.party.buffIndicator[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5311 args = {
5312 header = {
5313 order = 1,
5314 type = "header",
5315 name = L["Buff Indicator"],
5316 },
5317 enable = {
5318 type = 'toggle',
5319 name = L["Enable"],
5320 order = 2,
5321 },
5322 size = {
5323 type = 'range',
5324 name = L["Size"],
5325 desc = L["Size of the indicator icon."],
5326 order = 3,
5327 min = 4, max = 50, step = 1,
5328 },
5329 fontSize = {
5330 type = 'range',
5331 name = L["FONT_SIZE"],
5332 order = 4,
5333 min = 7, max = 212, step = 1,
5334 },
5335 profileSpecific = {
5336 type = 'toggle',
5337 name = L["Profile Specific"],
5338 desc = L["Use the profile specific filter 'Buff Indicator (Profile)' instead of the global filter 'Buff Indicator'."],
5339 order = 5,
5340 },
5341 configureButton = {
5342 type = 'execute',
5343 name = L["Configure Auras"],
5344 func = function()
5345 if E.db.unitframe.units.party.buffIndicator.profileSpecific then
5346 E:SetToFilterConfig('Buff Indicator (Profile)')
5347 else
5348 E:SetToFilterConfig('Buff Indicator')
5349 end
5350 end,
5351 order = 6
5352 },
5353 },
5354 },
5355 raidRoleIcons = {
5356 order = 703,
5357 type = 'group',
5358 name = L["RL Icon"],
5359 get = function(info) return E.db.unitframe.units.party.raidRoleIcons[info[#info]] end,
5360 set = function(info, value) E.db.unitframe.units.party.raidRoleIcons[info[#info]] = value; UF:CreateAndUpdateHeaderGroup('party') end,
5361 args = {
5362 header = {
5363 order = 1,
5364 type = "header",
5365 name = L["RL Icon"],
5366 },
5367 enable = {
5368 type = 'toggle',
5369 name = L["Enable"],
5370 order = 2,
5371 },
5372 position = {
5373 type = 'select',
5374 order = 3,
5375 name = L["Position"],
5376 values = {
5377 ['TOPLEFT'] = 'TOPLEFT',
5378 ['TOPRIGHT'] = 'TOPRIGHT',
5379 },
5380 },
5381 },
5382 },
5383 health = GetOptionsTable_Health(true, UF.CreateAndUpdateHeaderGroup, 'party'),
5384 healPredction = GetOptionsTable_HealPrediction(UF.CreateAndUpdateHeaderGroup, 'party'),
5385 infoPanel = GetOptionsTable_InformationPanel(UF.CreateAndUpdateHeaderGroup, 'party'),
5386 power = GetOptionsTable_Power(false, UF.CreateAndUpdateHeaderGroup, 'party'),
5387 name = GetOptionsTable_Name(UF.CreateAndUpdateHeaderGroup, 'party'),
5388 portrait = GetOptionsTable_Portrait(UF.CreateAndUpdateHeaderGroup, 'party'),
5389 fader = GetOptionsTable_Fader(UF.CreateAndUpdateHeaderGroup, 'party'),
5390 buffs = GetOptionsTable_Auras('buffs', true, UF.CreateAndUpdateHeaderGroup, 'party'),
5391 debuffs = GetOptionsTable_Auras('debuffs', true, UF.CreateAndUpdateHeaderGroup, 'party'),
5392 rdebuffs = GetOptionsTable_RaidDebuff(UF.CreateAndUpdateHeaderGroup, 'party'),
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()