This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - jeaks

Pages: [1]
1
Serverside Modding / [SOLVED] Eluna AIO - Addon - Showing a spell tooltip
« on: December 08, 2016, 05:49:34 pm »
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: [Select]
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.

[center:xpja7nde][/center:xpja7nde]

Game Version: 3.3.5a

Thank you

How to solve:



Instead of using
 
Code: [Select]
SetSpellByID(spellid)which might not even work, use
 
Code: [Select]
SetHyperlink("spell:"..spellid)

Pages: [1]