Skip to content

Commit

Permalink
Fix tooltip mouseover setspell
Browse files Browse the repository at this point in the history
Note: Only works with spells in the
players spellbook.
  • Loading branch information
RichSteini committed Apr 10, 2023
1 parent f3f8d2b commit 6c6baf1
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions WeakAuras/GenericTrigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3525,7 +3525,14 @@ function GenericTrigger.SetToolTip(trigger, state)
end
return true
elseif (state.spellId) then
GameTooltip:SetSpellByID(state.spellId);
-- This only works for spells in the players spellbook
local spellBookId, bookType = GetSpellBookID(state.spellId, BOOKTYPE_SPELL), BOOKTYPE_SPELL
if not spellBookId then
spellBookId, bookType = GetSpellBookID(state.spellId, BOOKTYPE_PET), BOOKTYPE_PET
end
if spellBookId then
GameTooltip:SetSpell(spellBookId, bookType);
end
return true
elseif (state.link) then
GameTooltip:SetHyperlink(state.link);
Expand All @@ -3548,7 +3555,14 @@ function GenericTrigger.SetToolTip(trigger, state)
if (Private.category_event_prototype[trigger.type]) then
if (trigger.event and Private.event_prototypes[trigger.event]) then
if(Private.event_prototypes[trigger.event].hasSpellID) then
GameTooltip:SetSpellByID(trigger.spellName);
-- This only works for spells in the players spellbook
local spellBookId, bookType = GetSpellBookID(trigger.spellName, BOOKTYPE_SPELL), BOOKTYPE_SPELL
if not spellBookId then
spellBookId, bookType = GetSpellBookID(trigger.spellName, BOOKTYPE_PET), BOOKTYPE_PET
end
if spellBookId then
GameTooltip:SetSpell(spellBookId, bookType);
end
return true
elseif(Private.event_prototypes[trigger.event].hasItemID) then
GameTooltip:SetHyperlink("item:"..trigger.itemName..":0:0:0:0:0:0:0")
Expand Down

0 comments on commit 6c6baf1

Please sign in to comment.