Add files via upload
This commit is contained in:
@@ -897,10 +897,12 @@ function addon.Nameplates:ApplyThreatToPlate(data, pct, situation)
|
||||
-- Smooth the percentage
|
||||
local oldPct = data.lastPct or 0
|
||||
local smoothPct
|
||||
if pct == 0 then
|
||||
smoothPct = 0
|
||||
-- Snap instantly when jumping to full aggro (100%) or dropping to 0
|
||||
-- (mob switched target). Smooth intermediate transitions moderately.
|
||||
if pct == 0 or pct >= 99.5 or math.abs(pct - oldPct) > 40 then
|
||||
smoothPct = pct
|
||||
else
|
||||
smoothPct = oldPct + (pct - oldPct) * 0.3
|
||||
smoothPct = oldPct + (pct - oldPct) * 0.6
|
||||
end
|
||||
data.lastPct = smoothPct
|
||||
|
||||
@@ -948,8 +950,20 @@ function addon.Nameplates:ApplyThreatToPlate(data, pct, situation)
|
||||
|
||||
-- Update text
|
||||
if data.text then
|
||||
local displayPct = math.floor(pct + 0.5)
|
||||
data.text:SetText(displayPct .. "%")
|
||||
local textStr
|
||||
if RelationshipsThreatPlatesDB.tankMode and data.plateName then
|
||||
-- Tank mode: show raw threat lead over the 2nd-highest player
|
||||
-- (positive = you have that much lead as top-threat holder;
|
||||
-- negative = you're that much behind the current top).
|
||||
textStr = addon.Threat:GetTankDisplayForMob(data.plateName)
|
||||
if not textStr or textStr == "--" then
|
||||
-- Fall back to % when no absolute values are available.
|
||||
textStr = math.floor(pct + 0.5) .. "%"
|
||||
end
|
||||
else
|
||||
textStr = math.floor(pct + 0.5) .. "%"
|
||||
end
|
||||
data.text:SetText(textStr)
|
||||
|
||||
if pct >= 90 then
|
||||
data.text:SetTextColor(1, 0.2, 0.2, 1)
|
||||
|
||||
Reference in New Issue
Block a user