From 514845c2aa6c6b810470a839eb1c8626a0ced74b Mon Sep 17 00:00:00 2001 From: NoM0Re Date: Fri, 14 Mar 2025 12:14:56 +0100 Subject: [PATCH] small fixes --- WeakAuras/BuffTrigger2.lua | 3 --- WeakAuras/Init.lua | 2 +- WeakAurasOptions/BuffTrigger2.lua | 7 ++----- WeakAurasOptions/Cache.lua | 14 ++++++++------ WeakAurasOptions/LoadOptions.lua | 6 +++--- 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/WeakAuras/BuffTrigger2.lua b/WeakAuras/BuffTrigger2.lua index cd904b4..d94263e 100644 --- a/WeakAuras/BuffTrigger2.lua +++ b/WeakAuras/BuffTrigger2.lua @@ -2724,9 +2724,6 @@ function BuffTrigger.GetNameAndIconSimple(data, triggernum) end --- Returns the name and icon to show in the options. ---- @param data table ---- @param triggernum number ---- @return string|nil name, any icon function BuffTrigger.GetNameAndIcon(data, triggernum) local name, icon = BuffTrigger.GetNameAndIconSimple(data, triggernum) if (not name or not icon and WeakAuras.spellCache) then diff --git a/WeakAuras/Init.lua b/WeakAuras/Init.lua index 6124953..b68e399 100644 --- a/WeakAuras/Init.lua +++ b/WeakAuras/Init.lua @@ -9,7 +9,7 @@ WeakAuras.doubleWidth = WeakAuras.normalWidth * 2 local versionStringFromToc = GetAddOnMetadata("WeakAuras", "Version") local versionString = "5.19.5 Beta" -local buildTime = "20250227215630" +local buildTime = "20250314121155" local isAwesomeEnabled = C_NamePlate and C_NamePlate.GetNamePlateForUnit and true or false WeakAuras.versionString = versionString diff --git a/WeakAurasOptions/BuffTrigger2.lua b/WeakAurasOptions/BuffTrigger2.lua index 744cfa5..58b8b43 100644 --- a/WeakAurasOptions/BuffTrigger2.lua +++ b/WeakAurasOptions/BuffTrigger2.lua @@ -116,10 +116,7 @@ local function CreateNameOptions(aura_options, data, trigger, size, isExactSpell return GetSpellInfo(WeakAuras.SafeToNumber(trigger[optionKey] and trigger[optionKey][i] or 0)) end aura_options[iconOption].image = function() - local icon - if trigger.auraspellids and trigger.auraspellids[i] then - icon = select(3, GetSpellInfo(trigger.auraspellids[i])) - end + local icon = select(3, GetSpellInfo(trigger[optionKey] and trigger[optionKey][i] or "")) return icon and tostring(icon) or "", 18, 18 end aura_options[iconOption].disabled = function() @@ -957,7 +954,7 @@ local function GetBuffTriggerOptions(data, triggernum) ignoreInvisible = { type = "toggle", name = L["Ignore out of checking range"], - desc = L["Uses UnitIsVisible() to check if in range. This is polled every second."], + desc = L["Uses UnitIsVisible() to check if game client has loaded a object for this unit. This distance is around 100 yards. This is polled every second."], order = 69.9, width = WeakAuras.doubleWidth, hidden = function() return not (trigger.type == "aura2" and (trigger.unit == "group" or trigger.unit == "raid" or trigger.unit == "party")) end diff --git a/WeakAurasOptions/Cache.lua b/WeakAurasOptions/Cache.lua index 32ddce4..1ddce19 100644 --- a/WeakAurasOptions/Cache.lua +++ b/WeakAurasOptions/Cache.lua @@ -27,8 +27,8 @@ function spellCache.Build() return end - local holes --[[ + local holes if WeakAuras.IsClassicEra() then holes = {} holes[63707] = 81743 @@ -57,7 +57,7 @@ function spellCache.Build() id = id + 1 local name, _, icon = GetSpellInfo(id) - if(icon == 136243) then -- 136243 is the a gear icon, we can ignore those spells + if (icon == "Interface\\Icons\\trade_engineering") then -- 136243 is the a gear icon, we can ignore those spells misses = 0; elseif name and name ~= "" and icon then cache[name] = cache[name] or {} @@ -68,9 +68,11 @@ function spellCache.Build() cache[name].spells = cache[name].spells .. "," .. id .. "=" .. icon end misses = 0 - --if holes and holes[id] then - -- id = holes[id] - --end + --[[ + if holes and holes[id] then + id = holes[id] + end + ]] else misses = misses + 1 end @@ -110,7 +112,7 @@ while misses < 4000000 do id = id + 1 local name = GetSpellInfo(id) local icon = GetSpellTexture(id) - if icon == 136243 then -- 136243 is the a gear icon, we can ignore those spells + if (icon == "Interface\\Icons\\trade_engineering") then -- 136243 is the a gear icon, we can ignore those spells misses = 0 elseif name and name ~= "" and icon then if misses > 10000 then diff --git a/WeakAurasOptions/LoadOptions.lua b/WeakAurasOptions/LoadOptions.lua index b147170..da9549f 100644 --- a/WeakAurasOptions/LoadOptions.lua +++ b/WeakAurasOptions/LoadOptions.lua @@ -34,7 +34,7 @@ local function CorrectSpellName(input) local spells = spellCache.GetSpellsMatching(input) if type(spells) == "table" then for id in pairs(spells) do - if id and tonumber(id) and id > 0 and IsSpellKnown(tonumber(id)) then + if tonumber(id) and id ~= 0 and IsSpellKnown(id) then return id end end @@ -648,12 +648,12 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum local icon = spellCache.GetIcon(value); return icon and tostring(icon) or "", 18, 18; elseif(arg.type == "spell") then - local spellName, _, icon = GetSpellInfo(value); + local name, _, icon = GetSpellInfo(value); if arg.noValidation then -- GetSpellInfo and other wow apis are case insensitive, but the later matching we do -- isn't. For validted inputs, we automatically correct the casing via GetSpellName -- Since we don't do that for noValidation, we are extra picky on the input - if type(value) == "string" and spellName ~= value then + if type(value) == "string" and name ~= value then return "", 18, 18 end end