Skip to content

Commit

Permalink
dispel types to use local table
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Nov 24, 2024
1 parent 641545a commit cec2aa3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion ElvUI/Core/General/API.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ local UIErrorsFrame = UIErrorsFrame
-- GLOBALS: ElvDB

local DebuffColors = E.Libs.Dispel:GetDebuffTypeColor()
local DispelTypes = E.Libs.Dispel:GetMyDispelTypes()

E.MountIDs = {}
E.MountText = {}
Expand Down Expand Up @@ -425,7 +426,7 @@ function E:CheckRole()
end

function E:IsDispellableByMe(debuffType)
return E.Libs.Dispel:IsDispellableByMe(debuffType)
return DispelTypes[debuffType]
end

function E:UpdateDispelColors()
Expand Down
5 changes: 3 additions & 2 deletions ElvUI/Core/Modules/Nameplates/StyleFilter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ local C_Item_IsEquippedItem = C_Item.IsEquippedItem
local C_PetBattles_IsInBattle = C_PetBattles and C_PetBattles.IsInBattle

local BleedList = E.Libs.Dispel:GetBleedList()
local DispelTypes = E.Libs.Dispel:GetMyDispelTypes()

local FallbackColor = {r=1, b=1, g=1}

Expand Down Expand Up @@ -366,9 +367,9 @@ function NP:StyleFilterDispelCheck(frame, filter)
if isStealable then
return true
end
elseif auraType and E:IsDispellableByMe(auraType) then
elseif auraType and DispelTypes[auraType] then
return true
elseif not auraType and BleedList[spellID] and E:IsDispellableByMe('Bleed') then
elseif not auraType and BleedList[spellID] and DispelTypes.Bleed then
return true
end

Expand Down
10 changes: 5 additions & 5 deletions ElvUI/Core/Modules/UnitFrames/Elements/Auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ local UnitIsFriend = UnitIsFriend
local UnitIsUnit = UnitIsUnit

local DebuffColors = E.Libs.Dispel:GetDebuffTypeColor()
local DispelTypes = E.Libs.Dispel:GetMyDispelTypes()
local BleedList = E.Libs.Dispel:GetBleedList()
local BadDispels = E.Libs.Dispel:GetBadList()

Expand Down Expand Up @@ -443,10 +444,10 @@ function UF:PostUpdateAura(_, button)
if enemy and db.auraByType then
r, g, b = enemy.r, enemy.g, enemy.b
end
elseif bad and db.auraByDispels and BadDispels[button.spellID] and button.debuffType and E:IsDispellableByMe(button.debuffType) then
elseif bad and db.auraByDispels and BadDispels[button.spellID] and button.debuffType and DispelTypes[button.debuffType] then
r, g, b = bad.r, bad.g, bad.b
elseif db.auraByType then
local bleed = not button.debuffType and BleedList[button.spellID] and E:IsDispellableByMe('Bleed') and DebuffColors.Bleed
local bleed = not button.debuffType and BleedList[button.spellID] and DispelTypes.Bleed and DebuffColors.Bleed
if bleed then
r, g, b = bleed.r, bleed.g, bleed.b
else
Expand Down Expand Up @@ -623,9 +624,8 @@ function UF:AuraFilter(unit, button, name, icon, count, debuffType, duration, ex
--- button.isDebuff = isDebuff
--- button.isPlayer = source == 'player' or source == 'vehicle'

local dispel = self.type == 'debuffs' and debuffType and E:IsDispellableByMe(debuffType)

local bleed = not dispel and not debuffType and E:IsDispellableByMe('Bleed')
local dispel = self.type == 'debuffs' and debuffType and DispelTypes[debuffType]
local bleed = not dispel and not debuffType and DispelTypes.Bleed
if bleed then dispel = BleedList[spellID] end

button.canDesaturate = db.desaturate
Expand Down
10 changes: 5 additions & 5 deletions ElvUI_Libraries/Core/oUF/simpy/profiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ local Update = function(data, finish)
return count, (finish > data.high) and finish, (finish < data.low) and finish, data.total + finish, data.total / count
end

local Total = function(data, finish)
local count = data.count + 1
return count, data.total + finish, data.total / count
end

local Save = function(data, start, finish)
local count, high, low, total, average = Update(data, finish)

Expand All @@ -49,11 +54,6 @@ local Save = function(data, start, finish)
data.average = average
end

local Total = function(data, finish)
local count = data.count + 1
return count, data.total + finish, data.total / count
end

local Single = function(func, ...)
local data = _funcs[func]
if not data then
Expand Down

0 comments on commit cec2aa3

Please sign in to comment.