(feat/Prototypes) Add prefix negation also to zoneId and encounterId load checks

(cherry picked from commit 666d59ccc86b7f2c34fe032e4f6a57c3689fdf9f)
This commit is contained in:
NoM0Re
2025-10-27 06:55:29 -07:00
committed by andrew6180
parent 2a85906a75
commit 8e19bd2546
4 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -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);
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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()