(feat/Prototypes) Add prefix negation also to zoneId and encounterId load checks
(cherry picked from commit 666d59ccc86b7f2c34fe032e4f6a57c3689fdf9f)
This commit is contained in:
@@ -593,10 +593,11 @@ function WeakAuras.CheckNumericIds(loadids, currentId)
|
|||||||
local startI, endI = string.find(loadids, currentId, searchFrom);
|
local startI, endI = string.find(loadids, currentId, searchFrom);
|
||||||
while (startI) do
|
while (startI) do
|
||||||
searchFrom = endI + 1; -- start next search from end
|
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
|
-- 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
|
if (endI == string.len(loadids) or tonumber(string.sub(loadids, endI + 1, endI + 1)) == nil) then
|
||||||
return true;
|
return not isNeg
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
startI, endI = string.find(loadids, currentId, searchFrom);
|
startI, endI = string.find(loadids, currentId, searchFrom);
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ function Private.InitializeEncounterAndZoneLists()
|
|||||||
encounter_list = encounter_list .. "\n"
|
encounter_list = encounter_list .. "\n"
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
function Private.get_encounters_list()
|
function Private.get_encounters_list()
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ function Private.InitializeEncounterAndZoneLists()
|
|||||||
encounter_list = encounter_list .. "\n"
|
encounter_list = encounter_list .. "\n"
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
function Private.get_encounters_list()
|
function Private.get_encounters_list()
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ function Private.InitializeEncounterAndZoneLists()
|
|||||||
encounter_list = encounter_list .. "\n"
|
encounter_list = encounter_list .. "\n"
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
function Private.get_encounters_list()
|
function Private.get_encounters_list()
|
||||||
|
|||||||
Reference in New Issue
Block a user