From 8e19bd25461cbacae57aed93911bb60a102fce30 Mon Sep 17 00:00:00 2001 From: NoM0Re <1629787+nom0re@users.noreply.github.com> Date: Mon, 27 Oct 2025 06:55:29 -0700 Subject: [PATCH] (feat/Prototypes) Add prefix negation also to zoneId and encounterId load checks (cherry picked from commit 666d59ccc86b7f2c34fe032e4f6a57c3689fdf9f) --- WeakAuras/Prototypes.lua | 5 +++-- WeakAuras/Types_ClassicPlus.lua | 2 +- WeakAuras/Types_TBC.lua | 2 +- WeakAuras/Types_Wrath.lua | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index bdd7b0a..9fc836b 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -593,10 +593,11 @@ function WeakAuras.CheckNumericIds(loadids, currentId) local startI, endI = string.find(loadids, currentId, searchFrom); while (startI) do searchFrom = endI + 1; -- start next search from end - if (startI == 1 or tonumber(string.sub(loadids, startI - 1, startI - 1)) == nil) then + local isNeg = (startI > 1 and string.sub(loadids, startI - 1, startI - 1) == "-") + if (isNeg or startI == 1 or tonumber(string.sub(loadids, startI - 1, startI - 1)) == nil) then -- Either right at start, or character before is not a number if (endI == string.len(loadids) or tonumber(string.sub(loadids, endI + 1, endI + 1)) == nil) then - return true; + return not isNeg end end startI, endI = string.find(loadids, currentId, searchFrom); diff --git a/WeakAuras/Types_ClassicPlus.lua b/WeakAuras/Types_ClassicPlus.lua index 7007a7c..48a7268 100644 --- a/WeakAuras/Types_ClassicPlus.lua +++ b/WeakAuras/Types_ClassicPlus.lua @@ -125,7 +125,7 @@ function Private.InitializeEncounterAndZoneLists() encounter_list = encounter_list .. "\n" end - encounter_list = encounter_list:sub(1, -3) .. "\n\n" .. L["Based on "] .. "https://wago.tools/db2/DungeonEncounter?build=3.4.5.63009\n" .. L["Supports multiple entries, separated by commas\n"] + encounter_list = encounter_list:sub(1, -3) .. "\n\n" .. L["Based on "] .. "https://wago.tools/db2/DungeonEncounter?build=3.4.5.63009\n" .. L["Supports multiple entries, separated by commas. Prefix with '-' for negation."] end function Private.get_encounters_list() diff --git a/WeakAuras/Types_TBC.lua b/WeakAuras/Types_TBC.lua index 599f5bd..4a7e6ab 100644 --- a/WeakAuras/Types_TBC.lua +++ b/WeakAuras/Types_TBC.lua @@ -121,7 +121,7 @@ function Private.InitializeEncounterAndZoneLists() encounter_list = encounter_list .. "\n" end - encounter_list = encounter_list:sub(1, -3) .. "\n\n" .. L["Based on "] .. "https://wago.tools/db2/DungeonEncounter?build=3.4.5.63009\n" .. L["Supports multiple entries, separated by commas\n"] + encounter_list = encounter_list:sub(1, -3) .. "\n\n" .. L["Based on "] .. "https://wago.tools/db2/DungeonEncounter?build=3.4.5.63009\n" .. L["Supports multiple entries, separated by commas. Prefix with '-' for negation."] end function Private.get_encounters_list() diff --git a/WeakAuras/Types_Wrath.lua b/WeakAuras/Types_Wrath.lua index 51343dd..beec2c1 100644 --- a/WeakAuras/Types_Wrath.lua +++ b/WeakAuras/Types_Wrath.lua @@ -146,7 +146,7 @@ function Private.InitializeEncounterAndZoneLists() encounter_list = encounter_list .. "\n" end - encounter_list = encounter_list:sub(1, -3) .. "\n\n" .. L["Based on "] .. "https://wago.tools/db2/DungeonEncounter?build=3.4.5.63009\n" .. L["Supports multiple entries, separated by commas\n"] + encounter_list = encounter_list:sub(1, -3) .. "\n\n" .. L["Based on "] .. "https://wago.tools/db2/DungeonEncounter?build=3.4.5.63009\n" .. L["Supports multiple entries, separated by commas. Prefix with '-' for negation."] end function Private.get_encounters_list()