Skip to content

Commit 3a1609b

Browse files
committed
Add a number threshold setting to filter low damage events
1 parent abb0aea commit 3a1609b

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Locales/enUS.lua

+2
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,5 @@ L["X Variance"] = true
131131
L["Randomly varies the starting horizontal position of each damage number."] = true
132132
L["Y Variance"] = true
133133
L["Randomly varies the starting vertical position of each damage number."] = true
134+
L["Hide Hits Threshold"] = true
135+
L["Hide hits that are below this threshold."] = true

NameplateSCT.lua

+19-1
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,11 @@ local numDamageEvents = 0
894894
local lastDamageEventTime
895895
local runningAverageDamageEvents = 0
896896
function NameplateSCT:DamageEvent(guid, spellName, amount, overkill, school, crit, spellId, absorbed)
897+
-- Hide small hits based on threshold
898+
if (self.db.global.sizing.hideSmallHitsThreshold > 0 and self.db.global.sizing.hideSmallHitsThreshold > (amount+absorbed)) then
899+
return
900+
end
901+
897902
local text, animation, pow, size, alpha
898903
local autoattack = spellName == "melee" or spellName == "pet"
899904

@@ -955,7 +960,7 @@ function NameplateSCT:DamageEvent(guid, spellName, amount, overkill, school, cri
955960

956961
if ((not crit and amount < SMALL_HIT_MULTIPIER*runningAverageDamageEvents)
957962
or (crit and amount/2 < SMALL_HIT_MULTIPIER*runningAverageDamageEvents)) then
958-
if (self.db.global.sizing.smallHitsHide) then
963+
if self.db.global.sizing.smallHitsHide then
959964
-- skip this damage event, it's too small
960965
return
961966
else
@@ -1879,6 +1884,19 @@ local menu = {
18791884
set = function(_, newValue) NameplateSCT.db.global.sizing.smallHitsHide = newValue end,
18801885
order = 22,
18811886
},
1887+
hideSmallHitsThreshold = {
1888+
type = 'range',
1889+
name = L["Hide Hits Threshold"],
1890+
desc = L["Hide hits that are below this threshold."],
1891+
min = 0,
1892+
max = 10000000,
1893+
softMax = 10000,
1894+
step = 1,
1895+
get = function() return NameplateSCT.db.global.sizing.hideSmallHitsThreshold end,
1896+
set = function(_, newValue) NameplateSCT.db.global.sizing.hideSmallHitsThreshold = newValue end,
1897+
order = 23,
1898+
width = "full",
1899+
},
18821900
},
18831901
},
18841902
},

0 commit comments

Comments
 (0)