From 69624cf837c5d4e2df5c8d8a807e4e296d3b0638 Mon Sep 17 00:00:00 2001 From: Infus Date: Sun, 15 Oct 2023 17:21:40 +0200 Subject: [PATCH] Add a "Group Size" load option With the new multi entry checking this can be done in a flexibel way. Fixes: #1835 --- WeakAuras/Prototypes.lua | 11 +++++++++++ WeakAuras/WeakAuras.lua | 13 +++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 6218bea3d7..72b238cd69 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -1706,6 +1706,17 @@ Private.load_prototype = { values = "group_types", events = {"GROUP_ROSTER_UPDATE"} }, + { + name = "groupSize", + display = L["Group Size"], + type = "number", + init = "arg", + events = {"GROUP_ROSTER_UPDATE"}, + multiEntry = { + operator = "and", + limit = 2 + }, + }, { name = "group_leader", display = WeakAuras.newFeatureString .. L["Group Leader/Assist"], diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index a83b5b787a..8a9570aa85 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1662,6 +1662,7 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...) end local group = Private.ExecEnv.GroupType() + local groupSize = GetNumGroupMembers() local affixes, warmodeActive, effectiveLevel = 0, false, 0 if WeakAuras.IsRetail() then @@ -1682,14 +1683,14 @@ local function scanForLoadsImpl(toCheck, event, arg1, ...) local loadFunc = loadFuncs[id]; local loadOpt = loadFuncsForOptions[id]; if WeakAuras.IsClassicEra() then - shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, inEncounter, vehicle, class, player, realm, race, faction, playerLevel, raidRole, group, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size) - couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, inEncounter, vehicle, class, player, realm, race, faction, playerLevel, raidRole, group, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size) + shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, inEncounter, vehicle, class, player, realm, race, faction, playerLevel, raidRole, group, groupSize, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size) + couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, inEncounter, vehicle, class, player, realm, race, faction, playerLevel, raidRole, group, groupSize, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size) elseif WeakAuras.IsWrathClassic() then - shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, inEncounter, vehicle, vehicleUi, class, player, realm, race, faction, playerLevel, role, raidRole, group, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size, difficulty, difficultyIndex) - couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, inEncounter, vehicle, vehicleUi, class, player, realm, race, faction, playerLevel, role, raidRole, group, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size, difficulty, difficultyIndex) + shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, inEncounter, vehicle, vehicleUi, class, player, realm, race, faction, playerLevel, role, raidRole, group, groupSize, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size, difficulty, difficultyIndex) + couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, inEncounter, vehicle, vehicleUi, class, player, realm, race, faction, playerLevel, role, raidRole, group, groupSize, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size, difficulty, difficultyIndex) elseif WeakAuras.IsRetail() then - shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, inEncounter, warmodeActive, inPetBattle, vehicle, vehicleUi, dragonriding, specId, player, realm, race, faction, playerLevel, effectiveLevel, role, position, group, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size, difficulty, difficultyIndex, affixes) - couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, inEncounter, warmodeActive, inPetBattle, vehicle, vehicleUi, dragonriding, specId, player, realm, race, faction, playerLevel, effectiveLevel, role, position, group, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size, difficulty, difficultyIndex, affixes) + shouldBeLoaded = loadFunc and loadFunc("ScanForLoads_Auras", inCombat, alive, inEncounter, warmodeActive, inPetBattle, vehicle, vehicleUi, dragonriding, specId, player, realm, race, faction, playerLevel, effectiveLevel, role, position, group, groupSize, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size, difficulty, difficultyIndex, affixes) + couldBeLoaded = loadOpt and loadOpt("ScanForLoads_Auras", inCombat, alive, inEncounter, warmodeActive, inPetBattle, vehicle, vehicleUi, dragonriding, specId, player, realm, race, faction, playerLevel, effectiveLevel, role, position, group, groupSize, raidMemberType, zone, zoneId, zonegroupId, encounter_id, size, difficulty, difficultyIndex, affixes) end if(shouldBeLoaded and not loaded[id]) then