small fixes

This commit is contained in:
NoM0Re
2025-03-14 12:14:56 +01:00
parent 3c574cb4a6
commit 514845c2aa
5 changed files with 14 additions and 18 deletions
-3
View File
@@ -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
+1 -1
View File
@@ -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
+2 -5
View File
@@ -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
+8 -6
View File
@@ -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
+3 -3
View File
@@ -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