From 339d77b7db06438a3ddb39ef2477edf9ebef244a Mon Sep 17 00:00:00 2001 From: Xiaoyang Huang <4454469+Xiaoyang-Huang@users.noreply.github.com> Date: Sun, 17 Aug 2025 21:59:18 +0800 Subject: [PATCH 1/2] add filter option for stack-able buff and debuff --- Bars.lua | 13 +++++++------ Raven_Options/Options.lua | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/Bars.lua b/Bars.lua index 55a8f71..6469e4e 100644 --- a/Bars.lua +++ b/Bars.lua @@ -1596,17 +1596,18 @@ local function DetectNewBuffs(unit, n, aura, isBuff, bp, vbp, bg) local isMine = (tc == "player") local isTabard = isMine and icon and (icon == tabardIcon) -- test if on player, same icon as equipped tabard, not cancellable local isCastable = aura[17] and not isWeapon + local isStackable = aura[3] > 0 local isOther = not isStealable and not isCastable and not isNPC and not isVehicle and not isMagic and not isEffect and - not isWeapon and not isBoss and not isEnrage and not isTracking and not isResource and not isMount and not isTabard + not isWeapon and not isBoss and not isEnrage and not isTracking and not isResource and not isMount and not isTabard and not isStackable local id, gname = nil, nil local checkAll = (unit == "all") if checkAll then id = aura[20]; gname = aura[21] end -- these fields are only valid if unit == "all" - local includeTypes = not bp.detectBuffTypes or (bp.detectStealable and isStealable) or (bp.detectCastable and isCastable) + local includeTypes = not bp.detectBuffTypes or (bp.detectStealable and isStealable) or (bp.detectCastable and isCastable) or (bp.detectStackable and isStackable) or (bp.detectNPCBuffs and isNPC) or (bCcuffs and isVehicle) or (bp.detectBossBuffs and isBoss) or (bp.detectEnrageBuffs and isEnrage) or (bp.detectMagicBuffs and isMagic) or (bp.detectEffectBuffs and isEffect) or (bp.detectAlertBuffs and isAlert) or (bp.detectWeaponBuffs and isWeapon) or (bp.detectTracking and isTracking) or (bp.detectResources and isResource) or (bp.detectMountBuffs and isMount) or (bp.detectTabardBuffs and isTabard) or (bp.detectMinionBuffs and isMinion) or (bp.detectOtherBuffs and isOther) - local excludeTypes = not bp.excludeBuffTypes or not ((bp.excludeStealable and isStealable) or (bp.excludeCastable and isCastable) + local excludeTypes = not bp.excludeBuffTypes or not ((bp.excludeStealable and isStealable) or (bp.excludeCastable and isCastable) or (bp.excludeStackable and isStackable) or (bp.excludeNPCBuffs and isNPC) or (bp.excludeVehicleBuffs and isVehicle) or (bp.excludeBossBuffs and isBoss) or (bp.excludeEnrageBuffs and isEnrage) or (bp.excludeMagicBuffs and isMagic) or (bp.excludeEffectBuffs and isEffect) or (bp.excludeAlertBuffs and isAlert) or (bp.excludeWeaponBuffs and isWeapon) or (bp.excludeTracking and isTracking) or (bp.excludeResources and isResource) or (bp.excludeMountBuffs and isMount) @@ -1616,7 +1617,6 @@ local function DetectNewBuffs(unit, n, aura, isBuff, bp, vbp, bg) (not checkAll and not (bp.noPlayerBuffs and UnitIsUnit(unit, "player")) and not (bp.noPetBuffs and UnitIsUnit(unit, "pet")) and not (bp.noTargetBuffs and UnitIsUnit(unit, "target")) and not (bp.noFocusBuffs and UnitIsUnit(unit, "focus")) and MOD:CheckCastBy(tc, bp.detectBuffsCastBy))) and CheckTimeAndDuration(bp, aura[2], aura[5]) and includeTypes and excludeTypes then - local b, tag = detectedBar, aura[9] table.wipe(b); b.enableBar = true; b.sorder = 0; b.action = n; b.spellID = spellID; b.barType = "Buff" if unit == "all" then @@ -1683,16 +1683,17 @@ local function DetectNewDebuffs(unit, n, aura, isBuff, bp, vbp, bg) local isEffect = (tt == "effect") local isAlert = (tt == "alert") local isPoison, isCurse, isMagic, isDisease = (aura[4] == "Poison"), (aura[4] == "Curse"), (aura[4] == "Magic"), (aura[4] == "Disease") + local isStackable = aura[3] > 0 local isOther = not isBoss and not isEffect and not isPoison and not isCurse and not isMagic and not isDisease and not isDispel and not isInflict and not isNPC and not isVehicle local isMine = (tc == "player") local id, gname = aura[20], aura[21] local checkAll = (unit == "all") - local includeTypes = not bp.filterDebuffTypes or (bp.detectDispellable and isDispel) or (bp.detectInflictable and isInflict) + local includeTypes = not bp.filterDebuffTypes or (bp.detectDispellable and isDispel) or (bp.detectInflictable and isInflict) or (bp.detectMultiStack and isStackable) or (bp.detectNPCDebuffs and isNPC) or (bp.detectVehicleDebuffs and isVehicle) or (bp.detectBossDebuffs and isBoss) or (bp.detectPoison and isPoison) or (bp.detectCurse and isCurse) or (bp.detectMagic and isMagic) or (bp.detectDisease and isDisease) or (bp.detectEffectDebuffs and isEffect) or (bp.detectAlertDebuffs and isAlert) or (bp.detectOtherDebuffs and isOther) - local excludeTypes = not bp.excludeDebuffTypes or not ((bp.excludeDispellable and isDispel) or (bp.excludeInflictable and isInflict) + local excludeTypes = not bp.excludeDebuffTypes or not ((bp.excludeDispellable and isDispel) or (bp.excludeInflictable and isInflict) or (bp.excludeMultiStack and isStackable) or (bp.excludeNPCDebuffs and isNPC) or (bp.excludeVehicleDebuffs and isVehicle) or (bp.excludeBossDebuffs and isBoss) or (bp.excludePoison and isPoison) or (bp.excludeCurse and isCurse) or (bp.excludeMagic and isMagic) or (bp.excludeDisease and isDisease) or (bp.excludeEffectDebuffs and isEffect) or (bp.excludeAlertDebuffs and isAlert) or (bp.excludeOtherDebuffs and isOther)) diff --git a/Raven_Options/Options.lua b/Raven_Options/Options.lua index 9921218..8ddcdd1 100644 --- a/Raven_Options/Options.lua +++ b/Raven_Options/Options.lua @@ -6480,6 +6480,13 @@ MOD.OptionsTable = { get = function(info) return GetBarGroupField("detectCastable") end, set = function(info, value) SetBarGroupField("detectCastable", value) end, }, + Stackable = { + type = "toggle", order = 15, name = L["Stackable"], + disabled = function(info) return not GetBarGroupField("detectBuffTypes") or not GetBarGroupField("detectBuffs") end, + desc = L['Include buffs that able to stack.'], + get = function(info) return GetBarGroupField("detectStackable") end, + set = function(info, value) SetBarGroupField("detectStackable", value) end, + }, Stealable = { type = "toggle", order = 20, name = L["Stealable"], disabled = function(info) return not GetBarGroupField("detectBuffTypes") or not GetBarGroupField("detectBuffs") end, @@ -6605,6 +6612,13 @@ MOD.OptionsTable = { get = function(info) return GetBarGroupField("excludeCastable") end, set = function(info, value) SetBarGroupField("excludeCastable", value) end, }, + Stackable = { + type = "toggle", order = 15, name = L["Stackable"], + disabled = function(info) return not GetBarGroupField("excludeBuffTypes") or not GetBarGroupField("detectBuffs") end, + desc = L['Exclude buffs that able to stack.'], + get = function(info) return GetBarGroupField("excludeStackable") end, + set = function(info, value) SetBarGroupField("excludeStackable", value) end, + }, Stealable = { type = "toggle", order = 20, name = L["Stealable"], disabled = function(info) return not GetBarGroupField("excludeBuffTypes") or not GetBarGroupField("detectBuffs") end, @@ -7167,6 +7181,13 @@ MOD.OptionsTable = { get = function(info) return GetBarGroupField("detectInflictable") end, set = function(info, value) SetBarGroupField("detectInflictable", value) end, }, + Stackable = { + type = "toggle", order = 15, name = L["Stackable"], + disabled = function(info) return not GetBarGroupField("filterDebuffTypes") end, + desc = L['Include debuffs that able to stack.'], + get = function(info) return GetBarGroupField("detectMultiStack") end, + set = function(info, value) SetBarGroupField("detectMultiStack", value) end, + }, Dispellable = { type = "toggle", order = 20, name = L["Dispellable"], disabled = function(info) return not GetBarGroupField("filterDebuffTypes") end, @@ -7263,6 +7284,13 @@ MOD.OptionsTable = { get = function(info) return GetBarGroupField("excludeInflictable") end, set = function(info, value) SetBarGroupField("excludeInflictable", value) end, }, + Stackable = { + type = "toggle", order = 15, name = L["Stackable"], + disabled = function(info) return not GetBarGroupField("excludeDebuffTypes") end, + desc = L['Exclude debuffs that able to stack.'], + get = function(info) return GetBarGroupField("excludeMultiStack") end, + set = function(info, value) SetBarGroupField("excludeMultiStack", value) end, + }, Dispellable = { type = "toggle", order = 20, name = L["Dispellable"], disabled = function(info) return not GetBarGroupField("excludeDebuffTypes") end, From 50ec45c7306ec41bfbfa43e57c0b6666644ec45a Mon Sep 17 00:00:00 2001 From: Xiaoyang Huang <4454469+Xiaoyang-Huang@users.noreply.github.com> Date: Sun, 17 Aug 2025 22:06:28 +0800 Subject: [PATCH 2/2] add filter option for stack-able buff and debuff --- Bars.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bars.lua b/Bars.lua index 6469e4e..9c50bbe 100644 --- a/Bars.lua +++ b/Bars.lua @@ -1685,7 +1685,7 @@ local function DetectNewDebuffs(unit, n, aura, isBuff, bp, vbp, bg) local isPoison, isCurse, isMagic, isDisease = (aura[4] == "Poison"), (aura[4] == "Curse"), (aura[4] == "Magic"), (aura[4] == "Disease") local isStackable = aura[3] > 0 local isOther = not isBoss and not isEffect and not isPoison and not isCurse and not isMagic and not isDisease - and not isDispel and not isInflict and not isNPC and not isVehicle + and not isDispel and not isInflict and not isNPC and not isVehicle and not isStackable local isMine = (tc == "player") local id, gname = aura[20], aura[21] local checkAll = (unit == "all")