From 864af635b1b8bcd32b97c3ce15933fd2c8b68e40 Mon Sep 17 00:00:00 2001 From: pepopo978 Date: Sat, 14 Mar 2026 09:32:47 -0700 Subject: [PATCH] ignore tokens < length 3 in the ignore list --- Localization.lua | 4 ++-- settings.lua | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Localization.lua b/Localization.lua index 5b87b7f..84be553 100644 --- a/Localization.lua +++ b/Localization.lua @@ -103,7 +103,7 @@ L:RegisterTranslations("enUS", function() ["Expiring latest -> soonest"] = true, ["Not ignored"] = true, ["Ignored Mobs List (Enter to save)"] = true, - ["Ignored Mobs Desc"] = "Comma separated list of strings to ignore if found in the unit name. If you use any of these regex characters (*+%?) it will do a regex search otherwise it will do a plain text search. So both Rift-Lost and Rift%-Lost should work.", + ["Ignored Mobs Desc"] = "Comma separated list of strings to ignore if found in the unit name. Tokens shorter than 3 characters are ignored. If you use any of these regex characters (*+%?) it will do a regex search otherwise it will do a plain text search. So both Rift-Lost and Rift%-Lost should work.", ["Shared Faerie Fire"] = true, ["This will show other player's Faerie Fires and avoid trying to cast Faerie Fire on those mobs"] = true, @@ -313,7 +313,7 @@ L:RegisterTranslations("zhCN", function() ["Expiring latest -> soonest"] = "最新->即将到期", ["Not ignored"] = "不被忽略", ["Ignored Mobs List (Enter to save)"] = "忽略的怪物列表(回车保存)", - ["Ignored Mobs Desc"] = "用逗号分隔的字符串列表,如果在单位名称中找到则忽略。如果你使用了这些正则表达式字符(*+%?),它将进行正则表达式搜索,否则将进行纯文本搜索。所以Rift-Lost和Rift%-Lost都应该有效.", + ["Ignored Mobs Desc"] = "用逗号分隔的字符串列表,如果在单位名称中找到则忽略。少于3个字符的条目会被忽略。如果你使用了这些正则表达式字符(*+%?),它将进行正则表达式搜索,否则将进行纯文本搜索。所以Rift-Lost和Rift%-Lost都应该有效.", ["Shared Faerie Fire"] = "共享精灵之火", ["This will show other player's Faerie Fires and avoid trying to cast Faerie Fire on those mobs"] = "这将显示其他玩家的精灵之火,并避免尝试在这些怪物上施放精灵之火", diff --git a/settings.lua b/settings.lua index dca9fd3..0cfc56e 100644 --- a/settings.lua +++ b/settings.lua @@ -62,11 +62,17 @@ local function splitString(str, delimiter) local from = 1 local delim_from, delim_to = string.find(str, delimiter, from) while delim_from do - table.insert(result, string.sub(str, from, delim_from - 1)) + local token = string.sub(str, from, delim_from - 1) + if string.len(token) >= 3 then + table.insert(result, token) + end from = delim_to + 1 delim_from, delim_to = string.find(str, delimiter, from) end - table.insert(result, string.sub(str, from)) + local token = string.sub(str, from) + if string.len(token) >= 3 then + table.insert(result, token) + end return result end