Skip to content

Commit

Permalink
For spell input fields with noValidation (used for "Name(s)" fields) …
Browse files Browse the repository at this point in the history
…show name from GetSpellInfo when value is a number, fixes #5058

This partially revert 7230ad1
Don't convert display when value is a string, but do it for numbers
  • Loading branch information
mrbuds authored and InfusOnWoW committed May 6, 2024
1 parent cbd5b2b commit b6e1e0e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions WeakAurasOptions/LoadOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,6 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
return nil;
end
elseif(arg.type == "spell") then
if arg.noValidation then
return value and tostring(value)
end
local useExactSpellId = (arg.showExactOption and getValue(trigger, nil, "use_exact_"..realname, multiEntry, entryNumber))
if value and value ~= "" then
local spellID = WeakAuras.SafeToNumber(value)
Expand All @@ -727,13 +724,16 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
if spellName then
return ("%s (%s)"):format(spellID, spellName) .. "\0" .. value
end
elseif not useExactSpellId then
elseif not useExactSpellId and not arg.noValidation then
local spellName = GetSpellInfo(value)
if spellName then
return spellName
end
end
end
if arg.noValidation then
return value and tostring(value)
end
if value == nil then
return nil
end
Expand Down

0 comments on commit b6e1e0e

Please sign in to comment.