From f8bb31fe78438331f0c4127d6c87ce9055c02196 Mon Sep 17 00:00:00 2001 From: pepopo978 Date: Tue, 4 Nov 2025 08:52:21 -0800 Subject: [PATCH] Support both - and %- in ignore list properly --- Cursive.toc | 4 ++-- Localization.lua | 4 ++-- filter.lua | 2 +- settings.lua | 5 ++++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cursive.toc b/Cursive.toc index d19c064..4b52d7f 100644 --- a/Cursive.toc +++ b/Cursive.toc @@ -1,6 +1,6 @@ ## Interface: 11200 -## Title: [|CFF33AAFFSUPERWOW|R] Cursive 2.5.4 -## Title-zhCN: [|CFF33AAFFSUPERWOW|R] Cursive 2.5.4 +## Title: [|CFF33AAFFSUPERWOW|R] Cursive 2.5.5 +## Title-zhCN: [|CFF33AAFFSUPERWOW|R] Cursive 2.5.5 ## Author: Pepopo ## Notes: Uses SuperWoW GUIDs to show units in combat and track curses ## Notes-zhCN: 使用SuperWoW的GUID功能来显示战斗中的单位并监视诅咒等 diff --git a/Localization.lua b/Localization.lua index ca5fc32..2507970 100644 --- a/Localization.lua +++ b/Localization.lua @@ -102,7 +102,7 @@ L:RegisterTranslations("enUS", function() ["Expiring latest -> soonest"] = true, ["Not ignored"] = true, ["Ignored Mobs List (Enter to save)"] = true, - ["Comma separated list of strings to ignore if found in the unit name"] = 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.", ["Shared Faerie Fire"] = true, ["This will show other player's Faerie Fires and avoid trying to cast Faerie Fire on those mobs"] = true, @@ -309,7 +309,7 @@ L:RegisterTranslations("zhCN", function() ["Expiring latest -> soonest"] = "最新->即将到期", ["Not ignored"] = "不被忽略", ["Ignored Mobs List (Enter to save)"] = "忽略的怪物列表(回车保存)", - ["Comma separated list of strings to ignore if found in the unit name"] = "如果在单位名称中找到,则忽略的字符串列表,用半角逗号分隔", + ["Ignored Mobs Desc"] = "用逗号分隔的字符串列表,如果在单位名称中找到则忽略。如果你使用了这些正则表达式字符(*+%?),它将进行正则表达式搜索,否则将进行纯文本搜索。所以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/filter.lua b/filter.lua index defa247..24a1063 100644 --- a/filter.lua +++ b/filter.lua @@ -66,7 +66,7 @@ filter.notignored = function(unit) return true end for _, str in ipairs(Cursive.db.profile.ignorelist) do - if string.find(string.lower(unitName), string.lower(str), nil, false) then + if string.find(string.lower(unitName), string.lower(str), nil, not Cursive.db.profile.ignorelistuseregex) then return false end end diff --git a/settings.lua b/settings.lua index 990131f..d6d82fa 100644 --- a/settings.lua +++ b/settings.lua @@ -53,6 +53,7 @@ Cursive:RegisterDefaults("profile", { filterignored = true, ignorelist = {}, + ignorelistuseregex = false, }) local function splitString(str, delimiter) @@ -451,7 +452,7 @@ local mobFilters = { ["ignorelist"] = { type = "text", name = L["Ignored Mobs List (Enter to save)"], - desc = L["Comma separated list of strings to ignore if found in the unit name"], + desc = L["Ignored Mobs Desc"], usage = "whelp, black dragonkin, player3", order = 68, get = function() @@ -466,6 +467,8 @@ local mobFilters = { else Cursive.db.profile.ignorelist = splitString(v, ","); end + -- check for common lua regex patterns + Cursive.db.profile.ignorelistuseregex = string.find(v, "[*+%%?]") ~= nil end, }, }