Skip to content

Commit 44b2a47

Browse files
committed
Merge branch 'main' into classic-beta
2 parents c2f276e + 19d5eea commit 44b2a47

File tree

15 files changed

+116
-39
lines changed

15 files changed

+116
-39
lines changed

ElvUI/Core/Defaults/Profile.lua

+11
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,7 @@ local UF_SubGroup = {
16551655
width = 120,
16561656
height = 28,
16571657
threatStyle = 'GLOW',
1658+
threatPrimary = true,
16581659
colorOverride = 'USE_DEFAULT',
16591660
name = CopyTable(UF_Name),
16601661
raidicon = CopyTable(UF_RaidIcon),
@@ -1861,6 +1862,7 @@ P.unitframe = {
18611862
height = 54,
18621863
lowmana = 30,
18631864
threatStyle = 'GLOW',
1865+
threatPrimary = true,
18641866
smartAuraPosition = 'DISABLED',
18651867
colorOverride = 'USE_DEFAULT',
18661868
disableMouseoverGlow = false,
@@ -1917,6 +1919,8 @@ P.unitframe = {
19171919
height = 54,
19181920
orientation = 'RIGHT',
19191921
threatStyle = 'GLOW',
1922+
threatPrimary = true,
1923+
threatPlayer = false,
19201924
smartAuraPosition = 'DISABLED',
19211925
colorOverride = 'USE_DEFAULT',
19221926
middleClickFocus = true,
@@ -1949,6 +1953,7 @@ P.unitframe = {
19491953
targettarget = {
19501954
enable = true,
19511955
threatStyle = 'NONE',
1956+
threatPrimary = true,
19521957
orientation = 'MIDDLE',
19531958
smartAuraPosition = 'DISABLED',
19541959
colorOverride = 'USE_DEFAULT',
@@ -1974,6 +1979,8 @@ P.unitframe = {
19741979
focus = {
19751980
enable = true,
19761981
threatStyle = 'GLOW',
1982+
threatPrimary = true,
1983+
threatPlayer = false,
19771984
orientation = 'MIDDLE',
19781985
smartAuraPosition = 'DISABLED',
19791986
colorOverride = 'USE_DEFAULT',
@@ -2005,6 +2012,7 @@ P.unitframe = {
20052012
enable = true,
20062013
orientation = 'MIDDLE',
20072014
threatStyle = 'GLOW',
2015+
threatPrimary = true,
20082016
smartAuraPosition = 'DISABLED',
20092017
colorOverride = 'USE_DEFAULT',
20102018
width = 130,
@@ -2033,6 +2041,7 @@ P.unitframe = {
20332041
boss = {
20342042
enable = true,
20352043
threatStyle = 'NONE',
2044+
threatPrimary = true,
20362045
growthDirection = 'DOWN',
20372046
orientation = 'RIGHT',
20382047
smartAuraPosition = 'DISABLED',
@@ -2099,6 +2108,7 @@ P.unitframe = {
20992108
party = {
21002109
enable = true,
21012110
threatStyle = 'GLOW',
2111+
threatPrimary = true,
21022112
orientation = 'LEFT',
21032113
visibility = '[@raid6,exists][@party1,noexists] hide;show',
21042114
growthDirection = 'UP_RIGHT',
@@ -2150,6 +2160,7 @@ P.unitframe = {
21502160
enable = true,
21512161
orientation = 'LEFT',
21522162
threatStyle = 'GLOW',
2163+
threatPrimary = true,
21532164
colorOverride = 'USE_DEFAULT',
21542165
middleClickFocus = false,
21552166
width = 120,

ElvUI/Core/General/Tags.lua

+9
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ local QuestDifficultyColors = QuestDifficultyColors
3535
local UnitBattlePetLevel = UnitBattlePetLevel
3636
local UnitClassification = UnitClassification
3737
local UnitDetailedThreatSituation = UnitDetailedThreatSituation
38+
local UnitThreatPercentageOfLead = UnitThreatPercentageOfLead
3839
local UnitExists = UnitExists
3940
local UnitFactionGroup = UnitFactionGroup
4041
local UnitGetIncomingHeals = UnitGetIncomingHeals
@@ -627,6 +628,13 @@ E:AddTag('realm:dash:translit', 'UNIT_NAME_UPDATE', function(unit)
627628
end
628629
end)
629630

631+
E:AddTag('threat:lead', 'UNIT_THREAT_LIST_UPDATE UNIT_THREAT_SITUATION_UPDATE GROUP_ROSTER_UPDATE', function(unit)
632+
local percent = UnitThreatPercentageOfLead('player', unit)
633+
if percent and percent > 0 and (IsInGroup() or UnitExists('pet')) then
634+
return format('%.0f%%', percent)
635+
end
636+
end)
637+
630638
E:AddTag('threat:percent', 'UNIT_THREAT_LIST_UPDATE UNIT_THREAT_SITUATION_UPDATE GROUP_ROSTER_UPDATE', function(unit)
631639
local _, _, percent = UnitDetailedThreatSituation('player', unit)
632640
if percent and percent > 0 and (IsInGroup() or UnitExists('pet')) then
@@ -1649,6 +1657,7 @@ E.TagInfo = {
16491657
-- Threat
16501658
['threat:current'] = { category = 'Threat', description = "Displays the current threat as a value" },
16511659
['threat:percent'] = { category = 'Threat', description = "Displays the current threat as a percent" },
1660+
['threat:lead'] = { category = 'Threat', description = "Displays the current threat of lead as a percent" },
16521661
['threat'] = { category = 'Threat', description = "Displays the current threat situation (Aggro is secure tanking, -- is losing threat and ++ is gaining threat)" },
16531662
}
16541663

ElvUI/Core/Modules/UnitFrames/Elements/Threat.lua

+11-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,16 @@ function UF:Configure_Threat(frame)
3232
local threat = frame.ThreatIndicator
3333
if not threat then return end
3434

35-
local threatStyle = frame.db and frame.db.threatStyle
35+
local db = frame.db
36+
local threatStyle = db and db.threatStyle
3637
if threatStyle and threatStyle ~= 'NONE' then
3738
if not frame:IsElementEnabled('ThreatIndicator') then
3839
frame:EnableElement('ThreatIndicator')
3940
end
4041

42+
local unit = frame.unitframeType
43+
threat.feedbackUnit = db.threatPlayer and (unit == 'target' or unit == 'focus') and 'player' or nil
44+
4145
if threatStyle == 'GLOW' then
4246
threat:SetFrameStrata('BACKGROUND')
4347
threat.MainGlow:ClearAllPoints()
@@ -151,12 +155,13 @@ end
151155

152156
function UF:UpdateThreat(unit, status, r, g, b)
153157
local parent = self:GetParent()
154-
local db = parent.db and parent.db.threatStyle
155-
local badunit = not unit or parent.unit ~= unit
156158

157-
if not badunit and status and status > 1 then
158-
UF:ThreatHandler(self, parent, db, status, r, g, b)
159+
local db = parent.db
160+
if not db then return end
161+
162+
if (unit and parent.unit == unit) and status and status > (db.threatPrimary and 1 or 0) then
163+
UF:ThreatHandler(self, parent, db.threatStyle, status, r, g, b)
159164
else
160-
UF:ThreatHandler(self, parent, db, nil, unpack(E.media.unitframeBorderColor))
165+
UF:ThreatHandler(self, parent, db.threatStyle, nil, unpack(E.media.unitframeBorderColor))
161166
end
162167
end

ElvUI_Options/Core/UnitFrames.lua

+25-17
Original file line numberDiff line numberDiff line change
@@ -960,28 +960,34 @@ local function GetOptionsTable_ClassBar(updateFunc, groupName, numUnits)
960960
end
961961

962962
local function GetOptionsTable_GeneralGroup(updateFunc, groupName, numUnits)
963-
local config = ACH:Group(L["General"], nil, 1)
963+
local config = ACH:Group(L["General"], nil, 1, 'tab')
964964
config.args.orientation = ACH:Select(L["Frame Orientation"], L["Set the orientation of the UnitFrame."], 1, orientationValues)
965-
config.args.disableMouseoverGlow = ACH:Toggle(L["Block Mouseover Glow"], L["Forces Mouseover Glow to be disabled for these frames"], 2)
966-
config.args.disableTargetGlow = ACH:Toggle(L["Block Target Glow"], L["Forces Target Glow to be disabled for these frames"], 3)
967-
config.args.disableFocusGlow = ACH:Toggle(L["Block Focus Glow"], L["Forces Focus Glow to be disabled for these frames"], 4)
965+
config.args.disableMouseoverGlow = ACH:Toggle(L["Block Mouseover Glow"], L["Forces Mouseover Glow to be disabled for these frames"], 3)
966+
config.args.disableTargetGlow = ACH:Toggle(L["Block Target Glow"], L["Forces Target Glow to be disabled for these frames"], 4)
967+
config.args.disableFocusGlow = ACH:Toggle(L["Block Focus Glow"], L["Forces Focus Glow to be disabled for these frames"], 5)
968968

969969
if groupName ~= 'tank' and groupName ~= 'assist' then
970-
config.args.hideonnpc = ACH:Toggle(L["Text Toggle On NPC"], L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], 5, nil, nil, nil, function() return E.db.unitframe.units[groupName].power.hideonnpc end, function(_, value) E.db.unitframe.units[groupName].power.hideonnpc = value updateFunc(UF, groupName, numUnits) end)
970+
config.args.hideonnpc = ACH:Toggle(L["Text Toggle On NPC"], L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], 6, nil, nil, nil, function() return E.db.unitframe.units[groupName].power.hideonnpc end, function(_, value) E.db.unitframe.units[groupName].power.hideonnpc = value updateFunc(UF, groupName, numUnits) end)
971971
end
972972

973973
if groupName ~= 'party' and groupName ~= 'assist' and groupName ~= 'tank' and not strmatch(groupName, '^raid') then
974-
config.args.smartAuraPosition = ACH:Select(L["Smart Aura Position"], L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."], 6, C.Values.SmartAuraPositions)
974+
config.args.smartAuraPosition = ACH:Select(L["Smart Aura Position"], L["Will show Buffs in the Debuff position when there are no Debuffs active, or vice versa."], 2, C.Values.SmartAuraPositions)
975975
end
976976

977977
if groupName == 'arena' then
978-
config.args.pvpSpecIcon = ACH:Toggle(L["Spec Icon"], L["Display icon on arena frame indicating the units talent specialization or the units faction if inside a battleground."], 5, nil, nil, nil, nil, nil, function() return E.db.unitframe.units[groupName].orientation == 'MIDDLE' end)
978+
config.args.pvpSpecIcon = ACH:Toggle(L["Spec Icon"], L["Display icon on arena frame indicating the units talent specialization or the units faction if inside a battleground."], 6, nil, nil, nil, nil, nil, function() return E.db.unitframe.units[groupName].orientation == 'MIDDLE' end)
979979
else
980-
config.args.threatStyle = ACH:Select(L["Threat Display Mode"], nil, 7, threatValues)
980+
config.args.threatGroup = ACH:Group(L["Threat"], nil, 50)
981+
config.args.threatGroup.args.threatStyle = ACH:Select(L["Display Mode"], nil, 1, threatValues)
982+
config.args.threatGroup.args.threatPrimary = ACH:Toggle(L["Primary Unit"], L["Requires the unit to be the primary target to display."], 2)
983+
config.args.threatGroup.inline = true
984+
985+
if groupName == 'target' or groupName == 'focus' then
986+
config.args.threatGroup.args.threatPlayer = ACH:Toggle(L["My Threat"], L["Threat similar to Blizzard, which displays your threat from the unit."], 3)
987+
end
981988
end
982989

983-
config.args.positionsGroup = ACH:Group(L["Size and Positions"], nil, 100, nil, nil, function(info, value) E.db.unitframe.units[groupName][info[#info]] = value updateFunc(UF, groupName, numUnits) end)
984-
config.args.positionsGroup.inline = true
990+
config.args.positionsGroup = ACH:Group(L["Size and Positions"], nil, 200, nil, nil, function(info, value) E.db.unitframe.units[groupName][info[#info]] = value updateFunc(UF, groupName, numUnits) end)
985991
config.args.positionsGroup.args.width = ACH:Range(L["Width"], nil, 1, { min = 15, max = 1000, step = 1 })
986992
config.args.positionsGroup.args.height = ACH:Range(L["Height"], nil, 2, { min = 5, max = 500, step = 1 })
987993

@@ -993,34 +999,33 @@ local function GetOptionsTable_GeneralGroup(updateFunc, groupName, numUnits)
993999
config.args.positionsGroup.args.verticalSpacing = ACH:Range(L["Vertical Spacing"], nil, 10, spacingNormal)
9941000
config.args.positionsGroup.args.groupSpacing = ACH:Range(L["Group Spacing"], L["Additional spacing between each individual group."], 11, spacingNormal, nil, nil, nil, nil, groupName == 'party')
9951001

996-
config.args.visibilityGroup = ACH:Group(L["Visibility"], nil, 200, nil, nil, function(info, value) E.db.unitframe.units[groupName][info[#info]] = value updateFunc(UF, groupName, numUnits) end)
997-
config.args.visibilityGroup.inline = true
1002+
config.args.visibilityGroup = ACH:Group(L["Visibility"], nil, 100, nil, nil, function(info, value) E.db.unitframe.units[groupName][info[#info]] = value updateFunc(UF, groupName, numUnits) end)
9981003
config.args.visibilityGroup.args.showPlayer = ACH:Toggle(L["Display Player"], L["When true, the header includes the player when not in a raid."], 0)
9991004
config.args.visibilityGroup.args.defaults = ACH:Execute(L["Restore Defaults"], function() return P.unitframe.units[groupName].visibility end, 1, function() E.db.unitframe.units[groupName].visibility = P.unitframe.units[groupName].visibility updateFunc(UF, groupName, numUnits) end, nil, true)
10001005
config.args.visibilityGroup.args.visibility = ACH:Input(L["Visibility"], L["VISIBILITY_DESC"], 2, nil, 'full')
10011006

10021007
config.args.sortingGroup = ACH:Group(L["Grouping & Sorting"], nil, 300, nil, nil, function(info, value) E.db.unitframe.units[groupName][info[#info]] = value updateFunc(UF, groupName, numUnits) end)
1003-
config.args.sortingGroup.inline = true
10041008
config.args.sortingGroup.args.raidWideSorting = ACH:Toggle(L["Raid-Wide Sorting"], L["Enabling this allows raid-wide sorting however you will not be able to distinguish between groups."], 1, nil, nil, nil, nil, nil, nil, groupName == 'party')
10051009
config.args.sortingGroup.args.invertGroupingOrder = ACH:Toggle(L["Invert Grouping Order"], L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."], 2, nil, nil, nil, nil, nil, nil, function() return not E.db.unitframe.units[groupName].raidWideSorting end)
10061010
config.args.sortingGroup.args.startFromCenter = ACH:Toggle(L["Start Near Center"], L["The initial group will start near the center and grow out."], 3, nil, nil, nil, nil, nil, nil, function() return groupName ~= 'party' and not E.db.unitframe.units[groupName].raidWideSorting end)
10071011
config.args.sortingGroup.args.groupBy = ACH:Select(L["Group By"], L["Set the order that the group will sort."], 4, { CLASS = L["CLASS"], ROLE = L["ROLE"], NAME = L["Name"], GROUP = L["GROUP"], INDEX = L["Index"] })
10081012
config.args.sortingGroup.args.sortDir = ACH:Select(L["Sort Direction"], nil, 5, { ASC = L["Ascending"], DESC = L["Descending"] })
10091013
config.args.sortingGroup.args.sortMethod = ACH:Select(L["Sort Method"], nil, 6, { NAME = L["Name"], INDEX = L["Index"] }, nil, nil, nil, nil, nil, function() return E.db.unitframe.units[groupName].groupBy == 'INDEX' or E.db.unitframe.units[groupName].groupBy == 'NAME' end)
10101014

1011-
config.args.sortingGroup.args.roleSetup = ACH:Group(L["Role Order"], nil, 7, nil, nil, nil, nil, function() return E.db.unitframe.units[groupName].groupBy ~= 'ROLE' end)
1012-
config.args.sortingGroup.args.roleSetup.inline = true
1015+
config.args.sortingGroup.args.roleSetup = ACH:Group(L["Role Order"], nil, 400, nil, nil, nil, nil, function() return E.db.unitframe.units[groupName].groupBy ~= 'ROLE' end)
10131016
config.args.sortingGroup.args.roleSetup.args.ROLE1 = ACH:Select(' ', nil, 1, roles)
10141017
config.args.sortingGroup.args.roleSetup.args.ROLE2 = ACH:Select(' ', nil, 2, roles)
10151018
config.args.sortingGroup.args.roleSetup.args.ROLE3 = ACH:Select(' ', nil, 3, roles)
1019+
config.args.sortingGroup.args.roleSetup.inline = true
10161020

1017-
config.args.sortingGroup.args.classSetup = ACH:Group(L["Class Order"], nil, 7, nil, nil, nil, nil, function() return E.db.unitframe.units[groupName].groupBy ~= 'CLASS' end)
1021+
config.args.sortingGroup.args.classSetup = ACH:Group(L["Class Order"], nil, 500, nil, nil, nil, nil, function() return E.db.unitframe.units[groupName].groupBy ~= 'CLASS' end)
10181022
config.args.sortingGroup.args.classSetup.inline = true
10191023

10201024
for i = 1, NUM_CLASSES do
10211025
config.args.sortingGroup.args.classSetup.args['CLASS'..i] = ACH:Select(' ', nil, i, classTable)
10221026
end
10231027
else
1028+
config.args.positionsGroup.inline = true -- inline for others
10241029
config.args.positionsGroup.args.width.set = function(info, value) if E.db.unitframe.units[groupName].castbar and E.db.unitframe.units[groupName].castbar.width == E.db.unitframe.units[groupName][info[#info]] then E.db.unitframe.units[groupName].castbar.width = value end E.db.unitframe.units[groupName][info[#info]] = value updateFunc(UF, groupName, numUnits) end
10251030

10261031
if groupName == 'boss' or groupName == 'arena' then
@@ -1429,7 +1434,10 @@ local function GetUnitSettings(unitType, updateFunc, numUnits)
14291434
group.args.anchorPoint = ACH:Select(L["Position"], nil, 5, C.Values.AllPoints)
14301435
group.args.xOffset = ACH:Range(L["X-Offset"], nil, 6, { min = -500, max = 500, step = 1 })
14311436
group.args.yOffset = ACH:Range(L["Y-Offset"], nil, 7, { min = -500, max = 500, step = 1 })
1432-
group.args.threatStyle = ACH:Select(L["Threat Display Mode"], nil, 8, threatValues)
1437+
1438+
group.args.threatGroup = ACH:Group(L["Threat"], nil, 20)
1439+
group.args.threatGroup.args.threatStyle = ACH:Select(L["Display Mode"], nil, 1, threatValues)
1440+
group.args.threatGroup.args.threatPrimary = ACH:Toggle(L["Primary Unit"], L["Requires the unit to be the primary target to display."], 2)
14331441

14341442
for subElement in pairs(defaults[element]) do
14351443
if subElement == 'colorPetByUnitClass' then

ElvUI_Options/Locales/deDE.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ L["LEFT"] = "Links"
1616
L["RIGHT"] = "Rechts"
1717
L["TOP"] = "Oben"
1818

19+
L["Primary Unit"] = true
20+
L["Requires the unit to be the primary target to display."] = true
21+
L["Pet Specific"] = true
22+
L["Use the profile specific filter Aura Indicator (Pet) instead of the global filter Aura Indicator."] = true
1923
L["%s and then %s"] = "%s und dann %s"
2024
L["24-Hour Time"] = "24-Stunden Format"
2125
L["2D"] = "2D"
@@ -1703,7 +1707,7 @@ L["This will pin the voice buttons to the chat's tab panel. Unchecking it will c
17031707
L["This will reset the contents of this filter back to default. Any spell you have added to this filter will be removed."] = "Dieses wird den Inhalt des Filters auf Standard zurücksetzen. Jeder Zauber den du zum Filter hinzugefügt hast wird gelöscht."
17041708
L["This works like a macro, you can run different situations to get the actionbar to page differently.\n Example: '[combat] 2;'"] = "Dies funktioniert wie ein Makro. Sie können verschiedene Situationen ausführen, um die Aktionsleiste unterschiedlich anzuzeigen.\n Beispiel: '[combat] 2;'"
17051709
L["This works like a macro, you can run different situations to get the actionbar to show/hide differently.\n Example: '[combat] show;hide'"] = "Dieses funktioniert wie ein Makro, du kannst verschiedene Situationen verwenden um die Aktionsleiste zu zeigen/verstecken.\n Beispiel: '[combat] show;hide'"
1706-
L["Threat Display Mode"] = "Bedrohungs Anzeigemodus"
1710+
L["Display Mode"] = "Anzeigemodus"
17071711
L["Threat"] = "Bedrohung"
17081712
L["Threshold (in minutes) before text is shown in the HH:MM format. Set to -1 to never change to this format."] = "Schwellenwert (in Minuten) bevor der Text in MM:SS Format angezeigt wird. Setze auf -1 um niemals das Format zu ändern."
17091713
L["Threshold (in seconds) before text is shown in the MM:SS format. Set to -1 to never change to this format."] = "Schwellenwert (in Sekunden) bevor der Text in MM:SS Format angezeigt wird. Setze auf -1 um niemals das Format zu ändern."

ElvUI_Options/Locales/enUS.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ L["LEFT"] = true
1616
L["RIGHT"] = true
1717
L["TOP"] = true
1818

19+
L["Primary Unit"] = true
20+
L["Requires the unit to be the primary target to display."] = true
21+
L["Pet Specific"] = true
22+
L["Use the profile specific filter Aura Indicator (Pet) instead of the global filter Aura Indicator."] = true
1923
L["%s and then %s"] = true
2024
L["24-Hour Time"] = true
2125
L["2D"] = true
@@ -1703,7 +1707,7 @@ L["This will pin the voice buttons to the chat's tab panel. Unchecking it will c
17031707
L["This will reset the contents of this filter back to default. Any spell you have added to this filter will be removed."] = true
17041708
L["This works like a macro, you can run different situations to get the actionbar to page differently.\n Example: '[combat] 2;'"] = true
17051709
L["This works like a macro, you can run different situations to get the actionbar to show/hide differently.\n Example: '[combat] show;hide'"] = true
1706-
L["Threat Display Mode"] = true
1710+
L["Display Mode"] = true
17071711
L["Threat"] = true
17081712
L["Threshold (in minutes) before text is shown in the HH:MM format. Set to -1 to never change to this format."] = true
17091713
L["Threshold (in seconds) before text is shown in the MM:SS format. Set to -1 to never change to this format."] = true

0 commit comments

Comments
 (0)