Skip to content

Commit

Permalink
Debuffs status: Now a enabled boss debuffs filter does not hide other…
Browse files Browse the repository at this point in the history
… filters.

Debuffs status: Removed some unused code.
  • Loading branch information
michaelnpsp committed Jan 14, 2021
1 parent c35a428 commit 64444cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
12 changes: 6 additions & 6 deletions Options/modules/statuses/StatusAuraDebuffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function Grid2Options:MakeStatusDebuffsFilterOptions(status, options, optionPara
status.dbx.filterTyped = (not v) and true or nil
status:Refresh(true)
end,
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil or status.dbx.filterBossDebuffs==false end
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil end
}
options.showUntypedDebuffs = {
type = "toggle",
Expand All @@ -95,7 +95,7 @@ function Grid2Options:MakeStatusDebuffsFilterOptions(status, options, optionPara
end
status:Refresh(true)
end,
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil or status.dbx.filterBossDebuffs==false end
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil end
}
options.filterSep0 = { type = "description", name = "", order = 83.5 }
options.showNonBossDebuffs = {
Expand Down Expand Up @@ -141,7 +141,7 @@ function Grid2Options:MakeStatusDebuffsFilterOptions(status, options, optionPara
end
status:Refresh(true)
end,
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil or status.dbx.filterBossDebuffs==false end
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil end
}
options.showLongDebuffs = {
type = "toggle",
Expand All @@ -153,7 +153,7 @@ function Grid2Options:MakeStatusDebuffsFilterOptions(status, options, optionPara
status.dbx.filterLongDebuffs = (not v) and true or nil
status:Refresh(true)
end,
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil or status.dbx.filterBossDebuffs==false end
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil end
}
options.filterSep2 = { type = "description", name = "", order = 87.5 }
options.showNonSelfDebuffs = {
Expand All @@ -170,7 +170,7 @@ function Grid2Options:MakeStatusDebuffsFilterOptions(status, options, optionPara
end
status:Refresh(true)
end,
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil or status.dbx.filterBossDebuffs==false end
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil end
}
options.showSelfDebuffs = {
type = "toggle",
Expand All @@ -182,7 +182,7 @@ function Grid2Options:MakeStatusDebuffsFilterOptions(status, options, optionPara
status.dbx.filterCaster = (not v) and true or nil
status:Refresh(true)
end,
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil or status.dbx.filterBossDebuffs==false end
hidden = function() return status.dbx.useWhiteList or status.dbx.filterDispelDebuffs~=nil end
}
options.filterSep3 = { type = "description", name = "", order = 89.5 }
options.useWhiteList = {
Expand Down
17 changes: 0 additions & 17 deletions modules/StatusAurasDebuffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ local function CompileUpdateStateFilter(status)
return assert(loadstring(source))()
end

-- Filter + black list
local function status_UpdateStateFilter(self, unit, name, duration, caster, boss, typ)
return ( not self.spells[name] ) and
( self.filterLong ==nil or self.filterLong ~= (duration>=300) ) and
( self.filterBoss ==nil or self.filterBoss ~= boss ) and
( self.filterCaster==nil or self.filterCaster~= (myUnits[caster]==true) ) and
( self.filterTyped ==nil or self.filterTyped ~= (typ=='Typeless') )
end

-- All debuffs + white list
local function status_UpdateStateWhiteList(self, unit, name)
return self.spells[name]
Expand All @@ -46,11 +37,6 @@ local function status_UpdateStateBlackList(self, unit, name)
return not self.spells[name]
end

-- Boss Debuffs filter + black list
local function status_UpdateStateBoss(self, _, name, _, _, boss)
return boss and (not self.spells[name])
end

-- Dispellable by Player debuffs
local function status_UpdateStateDispel(self, _, _, _, _, _, typ)
return typ and playerDispelTypes[typ]
Expand Down Expand Up @@ -177,9 +163,6 @@ local function status_Update(self, dbx)
if self.filterLong == nil and self.filterBoss == nil and self.filterTyped ==nil and self.filterCaster == nil then
self.UpdateState = status_UpdateStateBlackList
self.GetIcons = status_GetIconsBlackList
elseif self.filterBoss==false then
self.UpdateState = status_UpdateStateBoss
self.GetIcons = status_GetIconsFilter
else
self.UpdateState = CompileUpdateStateFilter(self)
self.GetIcons = status_GetIconsFilter
Expand Down

0 comments on commit 64444cf

Please sign in to comment.