From 93458f64cbc6e0f72a529e70e70775e264870d87 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Mon, 18 Mar 2024 22:08:27 +0100 Subject: [PATCH 01/19] add Player Location trigger Creates a new player location trigger and moves instance filters from a condition trigger to the player location trigger. --- WeakAuras/Modernize.lua | 63 ++++++++++++ WeakAuras/Prototypes.lua | 203 +++++++++++++++++++++++++++++++-------- WeakAuras/Types.lua | 10 ++ WeakAuras/WeakAuras.lua | 16 +-- 4 files changed, 246 insertions(+), 46 deletions(-) diff --git a/WeakAuras/Modernize.lua b/WeakAuras/Modernize.lua index 3e97de05c3..0ea10e1fe7 100644 --- a/WeakAuras/Modernize.lua +++ b/WeakAuras/Modernize.lua @@ -2013,6 +2013,69 @@ function Private.Modernize(data) end + -- Version 72 moves instance filters from a conditions trigger to a player location trigger + if data.internalVersion < 72 then + local new_triggers = {} + local delete_triggers = {} + local condition_filters = { + "alwaystrue", + "incombat", + "pvpflagged", + "alive", + "vehicle", + "resting", + "mounted", + "HasPet", + "ismoving", + "afk", + "ingroup", + } + + for i, triggerData in ipairs(data.triggers) do + local t = triggerData.trigger + local canRemoveTrigger = true + + -- Check for a Conditions trigger with instance filters + if t.event == "Conditions" and ( + t.use_instance_size + or t.use_instance_difficulty + or t.use_instance_type + ) then -- Create a new trigger object + local new = CopyTable(triggerData) + new.trigger.event = "Player Location" + new.trigger.use_instanceDifficulty = new.trigger.use_instance_difficulty + new.trigger.use_instance_difficulty = nil + new.trigger.instanceDifficulty = new.trigger.instance_difficulty + new.trigger.instance_difficulty = nil + + -- Remove any condition filters from the new trigger + for _, name in ipairs(condition_filters) do + if t["use_"..name] ~= nil then + canRemoveTrigger = false + end + new.trigger[name] = nil + new.trigger["use_"..name] = nil + end + tinsert(new_triggers, new) + end + + -- the remaining conditions trigger has no active filters and the trigger can be removed + if canRemoveTrigger then + delete_triggers[i] = true + end + end + + -- Remove triggers + for i in pairs(delete_triggers) do + data.triggers[i] = nil + end + + -- Add triggers + for _,triggerData in ipairs(new_triggers) do + tinsert(data.triggers, triggerData) + end + end + data.internalVersion = max(data.internalVersion or 0, WeakAuras.InternalVersion()) end diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 7b71015892..5b4a9e4707 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -194,7 +194,7 @@ local function get_zoneId_list() L["Parent Zone"], parentmap_name, currentmap_info.parentMapID) end - return ("%s|cffffd200%s|r\n%s: %d\n\n%s%s|cffffd200%s|r\n%s: %d\n\n%s"):format( + return ("%s|cffffd200%s|r\n%s: %d\n\n%s%s|cffffd200%s|r\n%s: i%d\n\n%s"):format( Private.get_zoneId_list(), L["Current Zone"], currentmap_name, @@ -1769,7 +1769,7 @@ Private.load_prototype = { multiline = true, events = {"ZONE_CHANGED", "ZONE_CHANGED_INDOORS", "ZONE_CHANGED_NEW_AREA", "VEHICLE_UPDATE"}, desc = get_zoneId_list, - preamble = "local zoneChecker = Private.ExecEnv.ParseZoneCheck(%q)", + preamble = "local zoneChecker = Private.ExecEnv.ParseZoneCheck(%q, true)", test = "zoneChecker:Check(zoneId, zonegroupId, instanceId, minimapZoneText)", optional = true, }, @@ -9921,13 +9921,6 @@ Private.event_prototypes = { tinsert(events, "GROUP_ROSTER_UPDATE") end - if trigger.use_instance_difficulty ~= nil - or trigger.use_instance_type ~= nil - or trigger.use_instance_size ~= nil - then - tinsert(events, "PLAYER_DIFFICULTY_CHANGED") - end - return { ["events"] = events, ["unit_events"] = { @@ -9943,11 +9936,7 @@ Private.event_prototypes = { tinsert(events, "PLAYER_MOVING_UPDATE"); end - if trigger.use_instance_difficulty ~= nil - or trigger.use_instance_type ~= nil - or trigger.use_instance_size ~= nil - or trigger.use_pvpflagged ~= nil - then + if trigger.use_pvpflagged ~= nil then tinsert(events, "WA_DELAYED_PLAYER_ENTERING_WORLD") end @@ -10037,32 +10026,6 @@ Private.event_prototypes = { values = "group_types", init = "Private.ExecEnv.GroupType()", }, - { - name = "instance_size", - display = L["Instance Size Type"], - type = "multiselect", - values = "instance_types", - sorted = true, - init = "WeakAuras.InstanceType()", - }, - { - name = "instance_difficulty", - display = L["Instance Difficulty"], - type = "multiselect", - values = "difficulty_types", - init = "WeakAuras.InstanceDifficulty()", - enable = WeakAuras.IsRetail(), - hidden = not WeakAuras.IsRetail(), - }, - { - name = "instance_type", - display = L["Instance Type"], - type = "multiselect", - values = "instance_difficulty_types", - init = "WeakAuras.InstanceTypeRaw()", - enable = WeakAuras.IsRetail(), - hidden = not WeakAuras.IsRetail(), - }, }, automaticrequired = true, progressType = "none" @@ -10571,6 +10534,166 @@ Private.event_prototypes = { end, automaticrequired = true }, + ["Player Location"] = { + type = "unit", + events = function(trigger, untrigger) + local events = {} + if trigger.use_zoneIds ~= nil + or trigger.use_zone ~= nil + or trigger.use_subzone ~= nil + then + tinsert(events, "ZONE_CHANGED") + tinsert(events, "ZONE_CHANGED_INDOORS") + tinsert(events, "ZONE_CHANGED_NEW_AREA") + tinsert(events, "VEHICLE_UPDATE") + end + if trigger.use_indoors ~= nil then + tinsert(events, "MINIMAP_UPDATE_ZOOM") + tinsert(events, "ZONE_CHANGED_INDOORS") + end + if trigger.use_instanceDifficulty ~= nil + or trigger.use_instance_type ~= nil + or trigger.use_instance_size ~= nil + then + tinsert(events, "PLAYER_DIFFICULTY_CHANGED") + end + return { + ["events"] = events, + } + end, + internal_events = function(trigger, untrigger) + local events = { "CONDITIONS_CHECK",}; + if trigger.use_instance_difficulty ~= nil + or trigger.use_instance_type ~= nil + or trigger.use_instance_size ~= nil + then + tinsert(events, "WA_DELAYED_PLAYER_ENTERING_WORLD") + end + return events; + end, + force_events = "CONDITIONS_CHECK,", + name = L["Player Location"], + init = function(trigger) + local ret = [=[ + local recursive = %s + local zoneChecker = Private.ExecEnv.ParseZoneCheck(%q, recursive) + + local uiMapId = C_Map.GetBestMapForUnit("player") + local zonegroupId = uiMapId and C_Map.GetMapGroupID(uiMapId) + local instanceName, _, _, _, _, _, _, instanceId = GetInstanceInfo() + local minimapZoneText = GetMinimapZoneText() + + local zoneText = GetZoneText() + local mapInfo = C_Map.GetMapInfo(uiMapId) + local isIndoors = IsIndoors() + ]=] + return ret:format(trigger.use_recursive and "true" or "nil", trigger.zoneIds or 0) + end, + statesParameter = "one", + args = { + { + name = "zoneIds", + display = L["Player Location ID(s)"], + type = "string", + multiline = true, + desc = get_zoneId_list, + test = "zoneChecker:Check(uiMapId, zonegroupId, instanceId, minimapZoneText)", + }, + { + name = "recursive", + display = L["Recursive"], + desc = L["Enable this to recurse on each child map until it finds a match. Disable this to only include direct descendants."], + type = "toggle", + test = "true", + enable = function(trigger) + if trigger.use_zoneIds then + local zoneChecker = Private.ExecEnv.ParseZoneCheck(trigger.zoneIds) + return zoneChecker and zoneChecker.isChildFilter + end + end, + }, + { + name = "zone", + display = L["Zone Name"], + type = "string", + conditionType = "string", + store = true, + init = "zoneText", + multiEntry = { + operator = "or", + } + }, + { + name = "subzone", + display = L["Subzone Name"], + desc = L["Name of the (sub-)zone currently shown above the minimap."], + type = "string", + conditionType = "string", + store = true, + init = "minimapZoneText", + multiEntry = { + operator = "or", + }, + }, + { + name = "mapType", + display = L["Map Type"], + type = "select", + conditionType = "select", + init = "mapInfo.mapType", + values = "map_types", + store = true, + }, + { + name = "indoors", + display = L["Indoors"], + type = "toggle", + conditionType = "boolean", + init = "isIndoors", + }, + { + name = "instanceTitle", + display = L["Instance Filters"], + type = "description", + }, + { + name = "instance", + display = L["Instance Name"], + test = "true", + hidden = "true", + store = true, + }, + { + name = "instance_size", + display = L["Instance Size Type"], + type = "multiselect", + values = "instance_types", + sorted = true, + init = "WeakAuras.InstanceType()", + }, + { + name = "instanceDifficulty", + display = L["Instance Difficulty"], + type = "multiselect", + values = "difficulty_types", + init = "WeakAuras.InstanceDifficulty()", + store = true, + enable = WeakAuras.IsRetail(), + hidden = not WeakAuras.IsRetail(), + }, + { + name = "instance_type", + display = L["Instance Type"], + type = "multiselect", + values = "instance_difficulty_types", + init = "WeakAuras.InstanceTypeRaw()", + enable = WeakAuras.IsRetail(), + hidden = not WeakAuras.IsRetail(), + }, + }, + automaticrequired = true, + progressType = none + }, }; if WeakAuras.IsClassicEraOrWrath() then diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 45ea62bd88..57f50b06a0 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -2874,6 +2874,16 @@ do end end +Private.map_types = { + [Enum.UIMapType.Cosmic] = L["Cosmic"], + [Enum.UIMapType.World] = L["World"], + [Enum.UIMapType.Continent] = L["Continent"], + [Enum.UIMapType.Zone] = L["Zone"], + [Enum.UIMapType.Dungeon] = L["Dungeon"], + [Enum.UIMapType.Micro] = L["Micro"], + [Enum.UIMapType.Orphan] = L["Orphan"], +} + ---@class Private ---@field TocToExpansion table Private.TocToExpansion = { diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 82e5ef9eee..43f44279f9 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1,7 +1,7 @@ --- @type string, Private local AddonName, Private = ... -local internalVersion = 71 +local internalVersion = 72 -- Lua APIs local insert = table.insert @@ -6096,7 +6096,7 @@ function Private.ExecEnv.ParseNameCheck(name) return matches end -function Private.ExecEnv.ParseZoneCheck(input) +function Private.ExecEnv.ParseZoneCheck(input, recursive) if not input then return end local matcher = { @@ -6111,9 +6111,12 @@ function Private.ExecEnv.ParseZoneCheck(input) self.zoneGroupIds[id] = true elseif prevChar == 'c' or prevChar == 'C' then self.zoneIds[id] = true - local info = C_Map.GetMapChildrenInfo(id, nil, true) - for _,childInfo in pairs(info) do - self.zoneIds[childInfo.mapID] = true + self.isChildFilter = true + local info = C_Map.GetMapChildrenInfo(id, nil, recursive) + if info then + for _,childInfo in pairs(info) do + self.zoneIds[childInfo.mapID] = true + end end elseif prevChar == 'a' or prevChar == 'A' then self.areaNames[C_Map.GetAreaInfo(id)] = true @@ -6127,7 +6130,8 @@ function Private.ExecEnv.ParseZoneCheck(input) zoneIds = {}, zoneGroupIds = {}, instanceIds = {}, - areaNames = {} + areaNames = {}, + isChildFilter = false } local start = input:find('%d', 1) From 404b4bc41a34197af19fd60b606a44f68d3eef2b Mon Sep 17 00:00:00 2001 From: Boneshock Date: Mon, 18 Mar 2024 22:56:43 +0100 Subject: [PATCH 02/19] that should've been a string --- WeakAuras/Prototypes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 5b4a9e4707..92033b1125 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10692,7 +10692,7 @@ Private.event_prototypes = { }, }, automaticrequired = true, - progressType = none + progressType = "none" }, }; From 5f9ec6bfefed58f316b10b380316190b1970b409 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Mon, 18 Mar 2024 23:21:42 +0100 Subject: [PATCH 03/19] minor tweaks --- WeakAuras/Prototypes.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 92033b1125..e19860cd41 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10541,6 +10541,7 @@ Private.event_prototypes = { if trigger.use_zoneIds ~= nil or trigger.use_zone ~= nil or trigger.use_subzone ~= nil + or trigger.use_mapType ~= nil then tinsert(events, "ZONE_CHANGED") tinsert(events, "ZONE_CHANGED_INDOORS") @@ -10562,7 +10563,7 @@ Private.event_prototypes = { } end, internal_events = function(trigger, untrigger) - local events = { "CONDITIONS_CHECK",}; + local events = { "INSTANCE_LOCATION_CHECK"}; if trigger.use_instance_difficulty ~= nil or trigger.use_instance_type ~= nil or trigger.use_instance_size ~= nil @@ -10571,7 +10572,7 @@ Private.event_prototypes = { end return events; end, - force_events = "CONDITIONS_CHECK,", + force_events = "INSTANCE_LOCATION_CHECK", name = L["Player Location"], init = function(trigger) local ret = [=[ From 1502768223c66a389adde35f1b7192f8857bdac1 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Thu, 21 Mar 2024 23:11:45 +0100 Subject: [PATCH 04/19] Only copy instance filters, don't delete them, instead show AuraWarning for deprecated filters --- WeakAuras/GenericTrigger.lua | 25 ++++++++++++++++- WeakAuras/Modernize.lua | 53 ++++++++++++------------------------ WeakAuras/Prototypes.lua | 38 +++++++++++++++++++++++++- 3 files changed, 78 insertions(+), 38 deletions(-) diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 2b7167e50d..349c0e00ce 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -1496,6 +1496,7 @@ function GenericTrigger.Add(data, region) watched_trigger_events[id] = nil local warnAboutCLEUEvents = false + local warnAboutDeprecatedInstanceFilters = false for triggernum, triggerData in ipairs(data.triggers) do local trigger, untrigger = triggerData.trigger, triggerData.untrigger @@ -1613,10 +1614,17 @@ function GenericTrigger.Add(data, region) force_events = force_events(trigger, untrigger) end - if prototype.includePets then includePets = trigger.use_includePets == true and trigger.includePets or nil end + + if trigger.event == "Conditions" and ( + trigger.use_instance_size ~= nil + or trigger.use_instance_difficulty ~= nil + or trigger.use_instance_type ~= nil + ) then + warnAboutDeprecatedInstanceFilters = true + end end end else -- CUSTOM @@ -1783,6 +1791,21 @@ function GenericTrigger.Add(data, region) else Private.AuraWarnings.UpdateWarning(data.uid, "spammy_event_warning") end + + if warnAboutDeprecatedInstanceFilters then + Private.AuraWarnings.UpdateWarning(data.uid, "deprecated_instance_filter", "warning", + string.format("%s\n|cffff0000%s\n%s\n%s|r\n\n%s\n%s", + L["This aura contains a |cffff0000Conditions trigger|r with one of the following deprecated filters:"], + L["Instance Size Type"], + L["Instance Difficulty"], + L["Instance Type"], + L["These instance filters have been migrated to a Player Location trigger and will be removed from the Condition trigger in a future update."], + L["Change your aura to use the new Player Location trigger or join the WeakAuras Discord server for help."] + ) + ) + else + Private.AuraWarnings.UpdateWarning(data.uid, "deprecated_instance_filter") + end end do diff --git a/WeakAuras/Modernize.lua b/WeakAuras/Modernize.lua index 0ea10e1fe7..d2648e3c55 100644 --- a/WeakAuras/Modernize.lua +++ b/WeakAuras/Modernize.lua @@ -2017,23 +2017,14 @@ function Private.Modernize(data) if data.internalVersion < 72 then local new_triggers = {} local delete_triggers = {} - local condition_filters = { - "alwaystrue", - "incombat", - "pvpflagged", - "alive", - "vehicle", - "resting", - "mounted", - "HasPet", - "ismoving", - "afk", - "ingroup", + local instance_filters = { + "instance_size", + "instance_difficulty", + "instance_type", } for i, triggerData in ipairs(data.triggers) do local t = triggerData.trigger - local canRemoveTrigger = true -- Check for a Conditions trigger with instance filters if t.event == "Conditions" and ( @@ -2041,33 +2032,23 @@ function Private.Modernize(data) or t.use_instance_difficulty or t.use_instance_type ) then -- Create a new trigger object - local new = CopyTable(triggerData) - new.trigger.event = "Player Location" - new.trigger.use_instanceDifficulty = new.trigger.use_instance_difficulty - new.trigger.use_instance_difficulty = nil - new.trigger.instanceDifficulty = new.trigger.instance_difficulty - new.trigger.instance_difficulty = nil - - -- Remove any condition filters from the new trigger - for _, name in ipairs(condition_filters) do - if t["use_"..name] ~= nil then - canRemoveTrigger = false + local new = { + trigger = { + event = "Player Location", + type = "unit", + } + } + -- Add instance filters to new trigger object + for _, name in ipairs(instance_filters) do + local new_name = name + if name == "instance_difficulty" then + new_name = "instanceDifficulty" end - new.trigger[name] = nil - new.trigger["use_"..name] = nil + new.trigger[new_name] = t[name] + new.trigger["use_"..new_name] = t["use_"..name] end tinsert(new_triggers, new) end - - -- the remaining conditions trigger has no active filters and the trigger can be removed - if canRemoveTrigger then - delete_triggers[i] = true - end - end - - -- Remove triggers - for i in pairs(delete_triggers) do - data.triggers[i] = nil end -- Add triggers diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 05e9f8502e..5ebfd9707a 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -9911,6 +9911,12 @@ Private.event_prototypes = { if trigger.use_ingroup ~= nil then tinsert(events, "GROUP_ROSTER_UPDATE") end + if trigger.use_instance_difficulty ~= nil + or trigger.use_instance_type ~= nil + or trigger.use_instance_size ~= nil + then + tinsert(events, "PLAYER_DIFFICULTY_CHANGED") + end return { ["events"] = events, @@ -9927,7 +9933,11 @@ Private.event_prototypes = { tinsert(events, "PLAYER_MOVING_UPDATE"); end - if trigger.use_pvpflagged ~= nil then + if trigger.use_instance_difficulty ~= nil + or trigger.use_instance_type ~= nil + or trigger.use_instance_size ~= nil + or trigger.use_pvpflagged ~= nil + then tinsert(events, "WA_DELAYED_PLAYER_ENTERING_WORLD") end @@ -10017,6 +10027,32 @@ Private.event_prototypes = { values = "group_types", init = "Private.ExecEnv.GroupType()", }, + { + name = "instance_size", + display = L["Instance Size Type"].." "..L["|cffff0000deprecated|r"], + type = "multiselect", + values = "instance_types", + sorted = true, + init = "WeakAuras.InstanceType()", + }, + { + name = "instance_difficulty", + display = L["Instance Difficulty"].." "..L["|cffff0000deprecated|r"], + type = "multiselect", + values = "difficulty_types", + init = "WeakAuras.InstanceDifficulty()", + enable = WeakAuras.IsRetail(), + hidden = not WeakAuras.IsRetail(), + }, + { + name = "instance_type", + display = L["Instance Type"].." "..L["|cffff0000deprecated|r"], + type = "multiselect", + values = "instance_difficulty_types", + init = "WeakAuras.InstanceTypeRaw()", + enable = WeakAuras.IsRetail(), + hidden = not WeakAuras.IsRetail(), + }, }, automaticrequired = true, progressType = "none" From 80a7917b21b39df7483521d23a19d4732243b66d Mon Sep 17 00:00:00 2001 From: Boneshock Date: Thu, 4 Apr 2024 17:58:31 +0200 Subject: [PATCH 05/19] rename to "Location" trigger --- WeakAuras/GenericTrigger.lua | 4 ++-- WeakAuras/Prototypes.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 39d96bb497..080e86db94 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -1799,8 +1799,8 @@ function GenericTrigger.Add(data, region) L["Instance Size Type"], L["Instance Difficulty"], L["Instance Type"], - L["These instance filters have been migrated to a Player Location trigger and will be removed from the Condition trigger in a future update."], - L["Change your aura to use the new Player Location trigger or join the WeakAuras Discord server for help."] + L["These instance filters have been migrated to a Location trigger and will be removed from the Condition trigger in a future update."], + L["Change your aura to use the new Location trigger or join the WeakAuras Discord server for help."] ) ) else diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index da4f05c068..1d92110890 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10698,7 +10698,7 @@ Private.event_prototypes = { end, automaticrequired = true }, - ["Player Location"] = { + ["Location"] = { type = "unit", events = function(trigger, untrigger) local events = {} @@ -10737,7 +10737,7 @@ Private.event_prototypes = { return events; end, force_events = "INSTANCE_LOCATION_CHECK", - name = L["Player Location"], + name = WeakAuras.newFeatureString..L["Location"], init = function(trigger) local ret = [=[ local recursive = %s From fb77aa278aae196f21c05a2fcf1b92aa0a8f5f42 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Thu, 4 Apr 2024 17:59:27 +0200 Subject: [PATCH 06/19] remove migration --- WeakAuras/Modernize.lua | 44 ----------------------------------------- 1 file changed, 44 deletions(-) diff --git a/WeakAuras/Modernize.lua b/WeakAuras/Modernize.lua index e1c40f3671..9b8c78978a 100644 --- a/WeakAuras/Modernize.lua +++ b/WeakAuras/Modernize.lua @@ -2020,50 +2020,6 @@ function Private.Modernize(data) end end - -- Version 72 moves instance filters from a conditions trigger to a player location trigger - if data.internalVersion < 72 then - local new_triggers = {} - local delete_triggers = {} - local instance_filters = { - "instance_size", - "instance_difficulty", - "instance_type", - } - - for i, triggerData in ipairs(data.triggers) do - local t = triggerData.trigger - - -- Check for a Conditions trigger with instance filters - if t.event == "Conditions" and ( - t.use_instance_size - or t.use_instance_difficulty - or t.use_instance_type - ) then -- Create a new trigger object - local new = { - trigger = { - event = "Player Location", - type = "unit", - } - } - -- Add instance filters to new trigger object - for _, name in ipairs(instance_filters) do - local new_name = name - if name == "instance_difficulty" then - new_name = "instanceDifficulty" - end - new.trigger[new_name] = t[name] - new.trigger["use_"..new_name] = t["use_"..name] - end - tinsert(new_triggers, new) - end - end - - -- Add triggers - for _,triggerData in ipairs(new_triggers) do - tinsert(data.triggers, triggerData) - end - end - data.internalVersion = max(data.internalVersion or 0, WeakAuras.InternalVersion()) end From 9e61634a7211ef79cdaa47afeed3f7a48a7d98a0 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Thu, 4 Apr 2024 18:00:03 +0200 Subject: [PATCH 07/19] small tweaks and fix bugs --- WeakAuras/Prototypes.lua | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 1d92110890..b705253a54 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10727,7 +10727,7 @@ Private.event_prototypes = { } end, internal_events = function(trigger, untrigger) - local events = { "INSTANCE_LOCATION_CHECK"}; + local events = {"INSTANCE_LOCATION_CHECK"}; if trigger.use_instance_difficulty ~= nil or trigger.use_instance_type ~= nil or trigger.use_instance_size ~= nil @@ -10749,7 +10749,7 @@ Private.event_prototypes = { local minimapZoneText = GetMinimapZoneText() local zoneText = GetZoneText() - local mapInfo = C_Map.GetMapInfo(uiMapId) + local mapInfo = uiMapId and C_Map.GetMapInfo(uiMapId) local isIndoors = IsIndoors() ]=] return ret:format(trigger.use_recursive and "true" or "nil", trigger.zoneIds or 0) @@ -10777,6 +10777,16 @@ Private.event_prototypes = { end end, }, + { + name = "zoneId", + display = L["Zone ID"], + conditionType = "number", + init = "uiMapId", + store = true, + hidden = true, + test = "true", + noProgressSource = true, + }, { name = "zone", display = L["Zone Name"], @@ -10805,16 +10815,17 @@ Private.event_prototypes = { display = L["Map Type"], type = "select", conditionType = "select", - init = "mapInfo.mapType", + init = "mapInfo and mapInfo.mapType", values = "map_types", store = true, }, { name = "indoors", display = L["Indoors"], - type = "toggle", - conditionType = "boolean", + type = "tristate", + conditionType = "bool", init = "isIndoors", + store = true, }, { name = "instanceTitle", @@ -10829,12 +10840,14 @@ Private.event_prototypes = { store = true, }, { - name = "instance_size", + name = "instanceSize", display = L["Instance Size Type"], type = "multiselect", values = "instance_types", sorted = true, init = "WeakAuras.InstanceType()", + conditionType = "select", + store = true, }, { name = "instanceDifficulty", @@ -10842,16 +10855,19 @@ Private.event_prototypes = { type = "multiselect", values = "difficulty_types", init = "WeakAuras.InstanceDifficulty()", + conditionType = "select", store = true, enable = WeakAuras.IsRetail(), hidden = not WeakAuras.IsRetail(), }, { - name = "instance_type", + name = "instanceType", display = L["Instance Type"], type = "multiselect", values = "instance_difficulty_types", init = "WeakAuras.InstanceTypeRaw()", + conditionType = "select", + store = true, enable = WeakAuras.IsRetail(), hidden = not WeakAuras.IsRetail(), }, From 32897abe294108abf4b51d1a384342863b903ce8 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Sun, 7 Apr 2024 22:28:14 +0200 Subject: [PATCH 08/19] always listen for events that are required by stored values --- WeakAuras/Prototypes.lua | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 5e7bab43f4..0fdb6cddcf 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10703,32 +10703,16 @@ Private.event_prototypes = { }, ["Location"] = { type = "unit", - events = function(trigger, untrigger) - local events = {} - if trigger.use_zoneIds ~= nil - or trigger.use_zone ~= nil - or trigger.use_subzone ~= nil - or trigger.use_mapType ~= nil - then - tinsert(events, "ZONE_CHANGED") - tinsert(events, "ZONE_CHANGED_INDOORS") - tinsert(events, "ZONE_CHANGED_NEW_AREA") - tinsert(events, "VEHICLE_UPDATE") - end - if trigger.use_indoors ~= nil then - tinsert(events, "MINIMAP_UPDATE_ZOOM") - tinsert(events, "ZONE_CHANGED_INDOORS") - end - if trigger.use_instanceDifficulty ~= nil - or trigger.use_instance_type ~= nil - or trigger.use_instance_size ~= nil - then - tinsert(events, "PLAYER_DIFFICULTY_CHANGED") - end - return { - ["events"] = events, + events = { + ["events"] = { + "ZONE_CHANGED", + "ZONE_CHANGED_INDOORS", + "ZONE_CHANGED_NEW_AREA", + "VEHICLE_UPDATE", + "MINIMAP_UPDATE_ZOOM", + "PLAYER_DIFFICULTY_CHANGED", } - end, + }, internal_events = function(trigger, untrigger) local events = {"INSTANCE_LOCATION_CHECK"}; if trigger.use_instance_difficulty ~= nil From 3a369f7bca885b635bc6af823d854671cd8187a2 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Sun, 7 Apr 2024 23:41:45 +0200 Subject: [PATCH 09/19] bugfix: start = 1 if no match is found --- WeakAuras/WeakAuras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 46510439c5..099ba22c96 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -6110,7 +6110,7 @@ function Private.ExecEnv.ParseZoneCheck(input, recursive) isChildFilter = false } - local start = input:find('%d', 1) + local start = input:find('%d', 1) or 1 local last = input:find('%D', start) while (last) do matcher:AddId(input, start, last - 1) From 528f129f477067b8710b29073a8ddfba27616322 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Sun, 7 Apr 2024 23:43:01 +0200 Subject: [PATCH 10/19] remove the optional recursive check: child filters are always recursive --- WeakAuras/Prototypes.lua | 21 +++------------------ WeakAuras/WeakAuras.lua | 6 ++---- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 0fdb6cddcf..c7acce1d31 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -1772,7 +1772,7 @@ Private.load_prototype = { multiline = true, events = {"ZONE_CHANGED", "ZONE_CHANGED_INDOORS", "ZONE_CHANGED_NEW_AREA", "VEHICLE_UPDATE"}, desc = get_zoneId_list, - preamble = "local zoneChecker = Private.ExecEnv.ParseZoneCheck(%q, true)", + preamble = "local zoneChecker = Private.ExecEnv.ParseZoneCheck(%q)", test = "zoneChecker:Check(zoneId, zonegroupId, instanceId, minimapZoneText)", optional = true, }, @@ -10727,9 +10727,6 @@ Private.event_prototypes = { name = WeakAuras.newFeatureString..L["Location"], init = function(trigger) local ret = [=[ - local recursive = %s - local zoneChecker = Private.ExecEnv.ParseZoneCheck(%q, recursive) - local uiMapId = C_Map.GetBestMapForUnit("player") local zonegroupId = uiMapId and C_Map.GetMapGroupID(uiMapId) local instanceName, _, _, _, _, _, _, instanceId = GetInstanceInfo() @@ -10739,7 +10736,7 @@ Private.event_prototypes = { local mapInfo = uiMapId and C_Map.GetMapInfo(uiMapId) local isIndoors = IsIndoors() ]=] - return ret:format(trigger.use_recursive and "true" or "nil", trigger.zoneIds or 0) + return ret end, statesParameter = "one", args = { @@ -10749,21 +10746,9 @@ Private.event_prototypes = { type = "string", multiline = true, desc = get_zoneId_list, + preamble = "local zoneChecker = Private.ExecEnv.ParseZoneCheck(%q)", test = "zoneChecker:Check(uiMapId, zonegroupId, instanceId, minimapZoneText)", }, - { - name = "recursive", - display = L["Recursive"], - desc = L["Enable this to recurse on each child map until it finds a match. Disable this to only include direct descendants."], - type = "toggle", - test = "true", - enable = function(trigger) - if trigger.use_zoneIds then - local zoneChecker = Private.ExecEnv.ParseZoneCheck(trigger.zoneIds) - return zoneChecker and zoneChecker.isChildFilter - end - end, - }, { name = "zoneId", display = L["Zone ID"], diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 099ba22c96..9b52fc64bd 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -6072,7 +6072,7 @@ function Private.ExecEnv.ParseNameCheck(name) return matches end -function Private.ExecEnv.ParseZoneCheck(input, recursive) +function Private.ExecEnv.ParseZoneCheck(input) if not input then return end local matcher = { @@ -6087,8 +6087,7 @@ function Private.ExecEnv.ParseZoneCheck(input, recursive) self.zoneGroupIds[id] = true elseif prevChar == 'c' or prevChar == 'C' then self.zoneIds[id] = true - self.isChildFilter = true - local info = C_Map.GetMapChildrenInfo(id, nil, recursive) + local info = C_Map.GetMapChildrenInfo(id, nil, true) if info then for _,childInfo in pairs(info) do self.zoneIds[childInfo.mapID] = true @@ -6107,7 +6106,6 @@ function Private.ExecEnv.ParseZoneCheck(input, recursive) zoneGroupIds = {}, instanceIds = {}, areaNames = {}, - isChildFilter = false } local start = input:find('%d', 1) or 1 From 1ec1d908757118bd480fb2b84545d85b3a169ead Mon Sep 17 00:00:00 2001 From: Boneshock Date: Mon, 8 Apr 2024 00:10:07 +0200 Subject: [PATCH 11/19] overwrite multiselect desc if arg.desc is set --- WeakAurasOptions/LoadOptions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WeakAurasOptions/LoadOptions.lua b/WeakAurasOptions/LoadOptions.lua index 0a3b822c78..bb44744070 100644 --- a/WeakAurasOptions/LoadOptions.lua +++ b/WeakAurasOptions/LoadOptions.lua @@ -253,7 +253,7 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum width = WeakAuras.normalWidth, name = arg.display, desc = function() - if arg.multiNoSingle then return arg.desc end + if arg.multiNoSingle or arg.desc then return arg.desc end local v = trigger["use_"..realname]; if(v == true) then return L["Multiselect single tooltip"]; From fd53b763d2f8ebe9799eeda46a3a7068023f7cdc Mon Sep 17 00:00:00 2001 From: Boneshock Date: Mon, 8 Apr 2024 00:13:18 +0200 Subject: [PATCH 12/19] remove instance filter aurawarning, instead show a guiding description --- WeakAuras/GenericTrigger.lua | 24 ------------------------ WeakAuras/Prototypes.lua | 4 ++++ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 04e89768fe..579ab53bc0 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -1514,7 +1514,6 @@ function GenericTrigger.Add(data, region) watched_trigger_events[id] = nil local warnAboutCLEUEvents = false - local warnAboutDeprecatedInstanceFilters = false for triggernum, triggerData in ipairs(data.triggers) do local trigger, untrigger = triggerData.trigger, triggerData.untrigger @@ -1635,14 +1634,6 @@ function GenericTrigger.Add(data, region) if prototype.includePets then includePets = trigger.use_includePets == true and trigger.includePets or nil end - - if trigger.event == "Conditions" and ( - trigger.use_instance_size ~= nil - or trigger.use_instance_difficulty ~= nil - or trigger.use_instance_type ~= nil - ) then - warnAboutDeprecatedInstanceFilters = true - end end end else -- CUSTOM @@ -1809,21 +1800,6 @@ function GenericTrigger.Add(data, region) else Private.AuraWarnings.UpdateWarning(data.uid, "spammy_event_warning") end - - if warnAboutDeprecatedInstanceFilters then - Private.AuraWarnings.UpdateWarning(data.uid, "deprecated_instance_filter", "warning", - string.format("%s\n|cffff0000%s\n%s\n%s|r\n\n%s\n%s", - L["This aura contains a |cffff0000Conditions trigger|r with one of the following deprecated filters:"], - L["Instance Size Type"], - L["Instance Difficulty"], - L["Instance Type"], - L["These instance filters have been migrated to a Location trigger and will be removed from the Condition trigger in a future update."], - L["Change your aura to use the new Location trigger or join the WeakAuras Discord server for help."] - ) - ) - else - Private.AuraWarnings.UpdateWarning(data.uid, "deprecated_instance_filter") - end end do diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index c7acce1d31..7c7ae18af0 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -145,6 +145,7 @@ end local constants = { nameRealmFilterDesc = L[" Filter formats: 'Name', 'Name-Realm', '-Realm'. \n\nSupports multiple entries, separated by commas\nCan use \\ to escape -."], + instanceFilterDeprecated = L["This filter has been moved to the Location trigger. Change your aura to use the new Location trigger or join the WeakAuras Discord server for help."], } if WeakAuras.IsClassicEraOrWrathOrCata() then @@ -10170,6 +10171,7 @@ Private.event_prototypes = { { name = "instance_size", display = L["Instance Size Type"].." "..L["|cffff0000deprecated|r"], + desc = constants.instanceFilterDeprecated, type = "multiselect", values = "instance_types", sorted = true, @@ -10178,6 +10180,7 @@ Private.event_prototypes = { { name = "instance_difficulty", display = L["Instance Difficulty"].." "..L["|cffff0000deprecated|r"], + desc = constants.instanceFilterDeprecated, type = "multiselect", values = "difficulty_types", init = "WeakAuras.InstanceDifficulty()", @@ -10187,6 +10190,7 @@ Private.event_prototypes = { { name = "instance_type", display = L["Instance Type"].." "..L["|cffff0000deprecated|r"], + desc = constants.instanceFilterDeprecated, type = "multiselect", values = "instance_difficulty_types", init = "WeakAuras.InstanceTypeRaw()", From 4683051e07c87889ac828be592b1ac52b0e0ac6a Mon Sep 17 00:00:00 2001 From: Boneshock Date: Mon, 8 Apr 2024 00:23:26 +0200 Subject: [PATCH 13/19] remove mapType filter --- WeakAuras/Prototypes.lua | 11 ----------- WeakAuras/Types.lua | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 7c7ae18af0..197c4b8b0c 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10735,9 +10735,7 @@ Private.event_prototypes = { local zonegroupId = uiMapId and C_Map.GetMapGroupID(uiMapId) local instanceName, _, _, _, _, _, _, instanceId = GetInstanceInfo() local minimapZoneText = GetMinimapZoneText() - local zoneText = GetZoneText() - local mapInfo = uiMapId and C_Map.GetMapInfo(uiMapId) local isIndoors = IsIndoors() ]=] return ret @@ -10786,15 +10784,6 @@ Private.event_prototypes = { operator = "or", }, }, - { - name = "mapType", - display = L["Map Type"], - type = "select", - conditionType = "select", - init = "mapInfo and mapInfo.mapType", - values = "map_types", - store = true, - }, { name = "indoors", display = L["Indoors"], diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 74b244866d..281b0fe288 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -2784,17 +2784,6 @@ if WeakAuras.IsRetail() then end end ----@type table -Private.map_types = { - [Enum.UIMapType.Cosmic] = L["Cosmic"], - [Enum.UIMapType.World] = L["World"], - [Enum.UIMapType.Continent] = L["Continent"], - [Enum.UIMapType.Zone] = L["Zone"], - [Enum.UIMapType.Dungeon] = L["Dungeon"], - [Enum.UIMapType.Micro] = L["Micro"], - [Enum.UIMapType.Orphan] = L["Orphan"], -} - ---@type table Private.TocToExpansion = { [1] = L["Classic"], From dabfbd89cd6afb888e6b3ca2daefd462a89ac352 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Mon, 8 Apr 2024 00:35:24 +0200 Subject: [PATCH 14/19] make player location ID available as a condition --- WeakAuras/Prototypes.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 197c4b8b0c..d26725e541 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10750,6 +10750,14 @@ Private.event_prototypes = { desc = get_zoneId_list, preamble = "local zoneChecker = Private.ExecEnv.ParseZoneCheck(%q)", test = "zoneChecker:Check(uiMapId, zonegroupId, instanceId, minimapZoneText)", + conditionType = "string", + conditionPreamble = function(input) + return Private.ExecEnv.ParseZoneCheck(input) + end, + conditionTest = function(state, needle, op, preamble) + return preamble:Check(state.zoneId, state.zonegroupId, state.instanceId, state.subzone) + end, + operator_types = "none", }, { name = "zoneId", @@ -10761,6 +10769,16 @@ Private.event_prototypes = { test = "true", noProgressSource = true, }, + { + name = "zonegroupId", + display = L["Zone Group ID"], + conditionType = "number", + init = "zonegroupId", + store = true, + hidden = true, + test = "true", + noProgressSource = true, + }, { name = "zone", display = L["Zone Name"], @@ -10797,6 +10815,16 @@ Private.event_prototypes = { display = L["Instance Filters"], type = "description", }, + { + name = "instanceId", + display = L["Instance ID"], + conditionType = "number", + init = "instanceId", + store = true, + hidden = true, + test = "true", + noProgressSource = true, + }, { name = "instance", display = L["Instance Name"], From 208b5917d4f30f4514e2982caac109b5a0cc5797 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Mon, 8 Apr 2024 01:00:51 +0200 Subject: [PATCH 15/19] remove conditionType since we can use Player Location Id. noProgressSource does nothing here --- WeakAuras/Prototypes.lua | 6 ------ 1 file changed, 6 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index d26725e541..25c71daf8b 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10762,22 +10762,18 @@ Private.event_prototypes = { { name = "zoneId", display = L["Zone ID"], - conditionType = "number", init = "uiMapId", store = true, hidden = true, test = "true", - noProgressSource = true, }, { name = "zonegroupId", display = L["Zone Group ID"], - conditionType = "number", init = "zonegroupId", store = true, hidden = true, test = "true", - noProgressSource = true, }, { name = "zone", @@ -10818,12 +10814,10 @@ Private.event_prototypes = { { name = "instanceId", display = L["Instance ID"], - conditionType = "number", init = "instanceId", store = true, hidden = true, test = "true", - noProgressSource = true, }, { name = "instance", From 2f9684ed4cafe73cb8430f0042800259a3668161 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Mon, 8 Apr 2024 09:09:51 +0200 Subject: [PATCH 16/19] =?UTF-8?q?smoll=20=F0=9F=AA=B2-fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WeakAuras/Prototypes.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 25c71daf8b..7dd0ac92f0 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10719,9 +10719,9 @@ Private.event_prototypes = { }, internal_events = function(trigger, untrigger) local events = {"INSTANCE_LOCATION_CHECK"}; - if trigger.use_instance_difficulty ~= nil - or trigger.use_instance_type ~= nil - or trigger.use_instance_size ~= nil + if trigger.use_instanceDifficulty ~= nil + or trigger.use_instanceType ~= nil + or trigger.use_instanceSize ~= nil then tinsert(events, "WA_DELAYED_PLAYER_ENTERING_WORLD") end From 1026f5f4e8fef6c2c70b5b3569f5ef840b9bbd6a Mon Sep 17 00:00:00 2001 From: Boneshock Date: Sat, 13 Apr 2024 18:35:17 +0200 Subject: [PATCH 17/19] WA_DPEW and VEHICLE_UPDATE are not required --- WeakAuras/Prototypes.lua | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index d2a0831ab4..181d29dd7b 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10711,21 +10711,11 @@ Private.event_prototypes = { "ZONE_CHANGED", "ZONE_CHANGED_INDOORS", "ZONE_CHANGED_NEW_AREA", - "VEHICLE_UPDATE", "MINIMAP_UPDATE_ZOOM", "PLAYER_DIFFICULTY_CHANGED", } }, - internal_events = function(trigger, untrigger) - local events = {"INSTANCE_LOCATION_CHECK"}; - if trigger.use_instanceDifficulty ~= nil - or trigger.use_instanceType ~= nil - or trigger.use_instanceSize ~= nil - then - tinsert(events, "WA_DELAYED_PLAYER_ENTERING_WORLD") - end - return events; - end, + internal_events = {"INSTANCE_LOCATION_CHECK"}, force_events = "INSTANCE_LOCATION_CHECK", name = WeakAuras.newFeatureString..L["Location"], init = function(trigger) From cf6fe8571b4f22fb04c10dbe51720298a493f411 Mon Sep 17 00:00:00 2001 From: Infus Date: Tue, 16 Apr 2024 22:45:20 +0200 Subject: [PATCH 18/19] Tweak --- WeakAuras/WeakAuras.lua | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 9a129855ce..5b8ef8db7a 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -6106,7 +6106,10 @@ function Private.ExecEnv.ParseZoneCheck(input) end end elseif prevChar == 'a' or prevChar == 'A' then - self.areaNames[C_Map.GetAreaInfo(id)] = true + local areaName = C_Map.GetAreaInfo(id) + if areaName then + self.areaNames[areaName] = true + end elseif prevChar == 'i' or prevChar == 'I' then self.instanceIds[id] = true else @@ -6120,16 +6123,18 @@ function Private.ExecEnv.ParseZoneCheck(input) areaNames = {}, } - local start = input:find('%d', 1) or 1 - local last = input:find('%D', start) - while (last) do - matcher:AddId(input, start, last - 1) - start = input:find('%d', last + 1) - last = input:find('%D', start) - end + local start = input:find('%d', 1) + if start then + local last = input:find('%D', start) + while (last) do + matcher:AddId(input, start, last - 1) + start = input:find('%d', last + 1) or #input + 1 + last = input:find('%D', start) + end - last = #input - matcher:AddId(input, start, last) + last = #input + matcher:AddId(input, start, last) + end return matcher end From 9d3b4125c4e67dc4758aa12c716aa4332e3b0312 Mon Sep 17 00:00:00 2001 From: Boneshock Date: Fri, 19 Apr 2024 05:07:47 +0200 Subject: [PATCH 19/19] Remove indoors option --- WeakAuras/Prototypes.lua | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 48f0e2530e..295b04db71 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -10774,7 +10774,6 @@ Private.event_prototypes = { "ZONE_CHANGED", "ZONE_CHANGED_INDOORS", "ZONE_CHANGED_NEW_AREA", - "MINIMAP_UPDATE_ZOOM", "PLAYER_DIFFICULTY_CHANGED", } }, @@ -10788,7 +10787,6 @@ Private.event_prototypes = { local instanceName, _, _, _, _, _, _, instanceId = GetInstanceInfo() local minimapZoneText = GetMinimapZoneText() local zoneText = GetZoneText() - local isIndoors = IsIndoors() ]=] return ret end, @@ -10850,14 +10848,6 @@ Private.event_prototypes = { operator = "or", }, }, - { - name = "indoors", - display = L["Indoors"], - type = "tristate", - conditionType = "bool", - init = "isIndoors", - store = true, - }, { name = "instanceTitle", display = L["Instance Filters"],