diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 42427bb..89f468c 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -3220,6 +3220,13 @@ function Private.ExecEnv.CheckTotemName(totemName, triggerTotemName, triggerTote return true end +function Private.ExecEnv.CheckTotemIcon(totemIcon, triggerTotemIcon, operator) + if not triggerTotemIcon then + return true + end + return (totemIcon == triggerTotemIcon) == (operator == "==") +end + -- Queueable Spells local queueableSpells local classQueueableSpells = { diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 2b0efdb..6826a66 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -4854,6 +4854,8 @@ Private.event_prototypes = { local triggerTotemName = %q local triggerTotemPattern = %q local triggerTotemPatternOperator = %q + local triggerTotemIcon = %s + local triggerTotemIconOperator = %q local clone = %s local inverse = %s local remainingCheck = %s @@ -4870,6 +4872,10 @@ Private.event_prototypes = { active = false; end + if not Private.ExecEnv.CheckTotemIcon(icon, triggerTotemIcon, triggerTotemIconOperator) then + active = false + end + if (inverse) then active = not active; if (triggerTotemName) then @@ -4899,8 +4905,9 @@ Private.event_prototypes = { local found = false; for i = 1, 4 do local _, totemName, startTime, duration, icon = GetTotemInfo(i); - if ((startTime and startTime ~= 0) and - Private.ExecEnv.CheckTotemName(totemName, triggerTotemName, triggerTotemPattern, triggerTotemPatternOperator) + if ((startTime and startTime ~= 0) + and Private.ExecEnv.CheckTotemName(totemName, triggerTotemName, triggerTotemPattern, triggerTotemPatternOperator) + and Private.ExecEnv.CheckTotemIcon(icon, triggerTotemIcon, triggerTotemIconOperator) ) then found = true; end @@ -4920,7 +4927,9 @@ Private.event_prototypes = { local _, totemName, startTime, duration, icon = GetTotemInfo(i); active = (startTime and startTime ~= 0); - if not Private.ExecEnv.CheckTotemName(totemName, triggerTotemName, triggerTotemPattern, triggerTotemPatternOperator) then + if not Private.ExecEnv.CheckTotemName(totemName, triggerTotemName, triggerTotemPattern, triggerTotemPatternOperator) + or not Private.ExecEnv.CheckTotemIcon(icon, triggerTotemIcon, triggerTotemIconOperator) + then active = false; end if (active and remainingCheck) then @@ -4958,6 +4967,8 @@ Private.event_prototypes = { trigger.use_totemName and totemName or "", trigger.use_totemNamePattern and trigger.totemNamePattern or "", trigger.use_totemNamePattern and trigger.totemNamePattern_operator or "", + trigger.use_icon and trigger.icon or "nil", + trigger.use_icon and trigger.icon_operator or "", trigger.use_clones and "true" or "false", trigger.use_inverse and "true" or "false", trigger.use_remaining and tonumber(trigger.remaining or 0) or "nil", @@ -4984,6 +4995,14 @@ Private.event_prototypes = { display = L["Totem Name Pattern Match"], type = "longstring", }, + { + name = "icon", + display = L["Totem Icon"], + type = "number", + conditionType = "number", + operator_types = "only_equal", + store = true, + }, { name = "clones", display = L["Clone per Match"], diff --git a/WeakAurasOptions/LoadOptions.lua b/WeakAurasOptions/LoadOptions.lua index 1f8882f..973017a 100644 --- a/WeakAurasOptions/LoadOptions.lua +++ b/WeakAurasOptions/LoadOptions.lua @@ -435,7 +435,9 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum name = L["Operator"], order = order, hidden = disabled or hidden, - values = arg.operator_types == "without_equal" and OptionsPrivate.Private.operator_types_without_equal or OptionsPrivate.Private.operator_types, + values = arg.operator_types == "without_equal" and OptionsPrivate.Private.operator_types_without_equal + or arg.operator_types == "only_equal" and OptionsPrivate.Private.equality_operator_types + or OptionsPrivate.Private.operator_types, get = function() return getValue(trigger, "use_"..realname, realname.."_operator", multiEntry, entryNumber) end,