• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

TrinityCore WotLK AIO / Addon - Showing spell tooltip

jeaks

New member
[solved] AIO / Addon - Showing spell tooltip

I recently compiled Eluna and I'm using AIO with it to create some nice scripts.
I made a frame with a spell's icon and I want to show its tooltip on mouse hover but I can't find the function for it. ( except for GameTooltip:GetSpellById() which doesn't do anything )

My work so far:
Code:
local SpellName1,SpellRank1,SpellIcon1,SpellCost1 = GetSpellInfo(168)

local imgSpellIcon1 = CreateFrame("Button", "imgSpellIcon1", frameAttributes, nil)
imgSpellIcon1:SetSize(50, 50)
imgSpellIcon1:SetPoint("TOPLEFT", 30, -69)
imgSpellIcon1:EnableMouse(true)
imgSpellIcon1:SetNormalTexture(SpellIcon1)


local function OnEnter(self, motion) 
   GameTooltip:SetOwner(self, "ANCHOR_BOTTOMRIGHT") 
   GameTooltip:SetText(SpellName1,1,1,1) 
   -- GameTooltip:AddLine(SpellRank1, 1, 1, 1) 
   GameTooltip:AddLine(SpellCost1.." Mana", 1, 1, 1) 
   GameTooltip:Show() 
end 

imgSpellIcon1:SetScript("OnEnter", OnEnter) 
imgSpellIcon1:SetScript("OnLeave", function() GameTooltip:Hide() end)



I managed to get to this point but it's ugly.
I want the real tooltip to show not a custom one.

ofbNAcx.png

Game Version: 3.3.5a

Thank you
How to solve:

Instead of using
Code:
SetSpellByID(spellid)
which might not even work, use
Code:
SetHyperlink("spell:"..spellid)
 
Last edited:
Top