From d863387bce818b05b94a79a04b8b180b3c7e8bab Mon Sep 17 00:00:00 2001 From: Josh Sachs <11616365+josh-sachs@users.noreply.github.com> Date: Mon, 6 Apr 2026 21:05:03 -0400 Subject: [PATCH] add [bg]/[nobg] conditional for battleground detection Uses GetBattlefieldStatus to check whether any battlefield queue slot is in the "active" state, which indicates the player is currently inside a battleground instance. --- Conditionals.lua | 18 ++++++++++++++++++ Core.lua | 2 ++ 2 files changed, 20 insertions(+) diff --git a/Conditionals.lua b/Conditionals.lua index 432707b..7036337 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -7331,6 +7331,24 @@ CleveRoids.Keywords = { return IsResting() == nil end, + bg = function() + for i = 1, MAX_BATTLEFIELD_QUEUES do + if GetBattlefieldStatus(i) == "active" then + return true + end + end + return false + end, + + nobg = function() + for i = 1, MAX_BATTLEFIELD_QUEUES do + if GetBattlefieldStatus(i) == "active" then + return false + end + end + return true + end, + stat = function(conditionals) return Multi(conditionals.stat, function(args) if type(args) ~= "table" or not args.name then diff --git a/Core.lua b/Core.lua index 97fb94a..7250cd0 100644 --- a/Core.lua +++ b/Core.lua @@ -150,6 +150,8 @@ local BOOLEAN_CONDITIONALS = { stopattack = true, pet = true, nopet = true, + bg = true, + nobg = true, } local requirementCheckFrame = CreateFrame("Frame")