Skip to content

Commit

Permalink
buff filter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Nov 21, 2022
1 parent 3fef7a4 commit a51ad29
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 18 deletions.
45 changes: 39 additions & 6 deletions Modules/UnitFrames/Elements/Buffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,52 @@ local UF = SUI.UF
local function Build(frame, DB)
--Buff Icons
local Buffs = CreateFrame('Frame', frame.unitOnCreate .. 'Buffs', frame)
Buffs.PostUpdateButton = function(self, button, unit, data, position)
button.data = data
end
Buffs.PostCreateButton = function(self, button)
UF.Auras:PostCreateButton('Buffs', button)
end

---@param unit UnitId
---@param data UnitAuraInfo
local FilterAura = function(element, unit, data)
local CustomFilter = function(
element,
unit,
button,
name,
icon,
count,
debuffType,
duration,
expiration,
source,
isStealable,
nameplateShowPersonal,
spellID,
canApplyAura,
isBossDebuff,
castByPlayer,
nameplateShowAll,
modRate,
effect1,
effect2,
effect3)
---@type UnitAuraInfo
local data = {
spellId = spellID,
name = name,
icon = icon,
count = count,
duration = duration,
isBossAura = isBossDebuff,
isPlayer = castByPlayer,
nameplateShowAll = nameplateShowAll,
expirationTime = expiration,
debuffType = debuffType,
isStealable = isStealable,
canApplyAura = canApplyAura,
sourceUnit = source
}
return UF.Auras:Filter(element, unit, data, element.DB.rules)
end
Buffs.FilterAura = FilterAura
Buffs.CustomFilter = CustomFilter
frame.Buffs = Buffs
end

Expand Down
42 changes: 39 additions & 3 deletions Modules/UnitFrames/Elements/Debuffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,47 @@ local function Build(frame, DB)
end

---@param unit UnitId
---@param data UnitAuraInfo
local FilterAura = function(element, unit, data)
local CustomFilter = function(
element,
unit,
button,
name,
icon,
count,
debuffType,
duration,
expiration,
source,
isStealable,
nameplateShowPersonal,
spellID,
canApplyAura,
isBossDebuff,
castByPlayer,
nameplateShowAll,
modRate,
effect1,
effect2,
effect3)
---@type UnitAuraInfo
local data = {
spellId = spellID,
name = name,
icon = icon,
count = count,
duration = duration,
isBossAura = isBossDebuff,
isPlayer = castByPlayer,
nameplateShowAll = nameplateShowAll,
expirationTime = expiration,
debuffType = debuffType,
isStealable = isStealable,
canApplyAura = canApplyAura,
sourceUnit = source
}
return UF.Auras:Filter(element, unit, data, element.DB.rules)
end
Debuffs.FilterAura = FilterAura
Debuffs.CustomFilter = CustomFilter

frame.Debuffs = Debuffs
end
Expand Down
6 changes: 1 addition & 5 deletions Modules/UnitFrames/Handlers/Auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ function Auras:OnClick(button, elementName)
end

if button.data and keyDown then
if keyDown == 'CTRL' then
for k, v in pairs(button.data) do
print(k .. ' = ' .. tostring(v))
end
elseif keyDown == 'SHIFT' then
if keyDown == 'SHIFT' then
if not AddToFilterWindow then
CreateAddToFilterWindow()
end
Expand Down
5 changes: 1 addition & 4 deletions Modules/UnitFrames/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,7 @@ function Options:AddAuraFilters(frameName, OptionSet, set, get)
isBossAura = L['Casted by boss'],
isHarmful = L['Harmful'],
isHelpful = L['Helpful'],
isMount = L['Mount'],
showPlayers = L['Player casted'],
isRaid = L['Raid'],
isStealable = L['Stealable']
showPlayers = L['Player casted']
}
}
}
Expand Down

0 comments on commit a51ad29

Please sign in to comment.