Skip to content

Commit

Permalink
fix: #2114 attempt 2 at fixing the avenging wrathpocalypse
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Nov 18, 2023
1 parent b0583ae commit 7e9c885
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
23 changes: 10 additions & 13 deletions Components/Core/Common/Textures.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,17 @@ function Textures:GetTexturePathFromSetting(setting)

if setting and setting ~= "" then

-- If there is a slash and a dot in it, then it is probably a raw file path.
-- Due to https://github.com/ascott18/TellMeWhen/issues/2114 and https://github.com/Stanzilla/WoWUIBugs/issues/503,
-- we must always return early here for anything that looks like a file path
if strfind(setting, "[\\/].*%.") then
return setting
end

local textureFromSpell = TMW.GetSpellTexture(setting)
if textureFromSpell then
return textureFromSpell
if TMW.GetSpellTexture(setting) then
return TMW.GetSpellTexture(setting)
end

-- If nothing else was detected, then it may be a wow icon in interface\icons.
-- it still might be a file in wow's root directory, but there is no way to tell for sure
return "Interface/Icons/" .. setting
-- If there is a slash in it, then it is probably a full path
if strfind(setting, "[\\/]") then
return setting
else
-- If there isn't a slash in it, then it is probably be a wow icon in interface\icons.
-- it still might be a file in wow's root directory, but there is no way to tell for sure
return "Interface/Icons/" .. setting
end
end
end
9 changes: 8 additions & 1 deletion TellMeWhen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,18 @@ if GetSpellInfo(336126) then
end
local SpellTexturesMetaIndex = TMW.SpellTexturesMetaIndex

local avengingWrathName = GetSpellInfo(31884)
function TMW.GetSpellTexture(spell)
if not spell then return end

local spellTex = GetSpellTexture(spell)
if spellTex and (spellTex ~= 135875 or GetSpellInfo(spell) == avengingWrathName) then
-- Workaround https://github.com/ascott18/TellMeWhen/issues/2114 -
-- don't return avenging wrath texture if the input wasn't the avenging wrath spell.
return spellTex
end

return
GetSpellTexture(spell) or
SpellTexturesMetaIndex[spell] or
rawget(SpellTexturesMetaIndex, strlowerCache[spell])
end
Expand Down

0 comments on commit 7e9c885

Please sign in to comment.