Making An itemLink Interactive/Clickable and Show Tooltip
I am working on an addon for my raid leader. I can generate a frame that shows a list of all loot picked up off a boss and the name of the character that picked it up. Next step I want to take is make that item link clickable to show the item tooltip like it does in the chat window (or better yet show it on mouseover).
Code:
-- code I found online to generate an item link from equipped mainhand weapon I've looked and tried various things but nothing has worked. Didn't include it here so it is more clear what I am looking for. |
Would this help?
https://wow.gamepedia.com/API_GameTooltip_SetHyperlink Lua Code:
|
Yes! Thank you. I also took away the texture for the frame so the item link is just floating. Now it is just a matter of having those links appear in the frame and easy to read, combined with what you found for me I will pretty much be done with this phase of the project. Thank you!
|
I've hit another problem and I don't see where the issue is. I reworked how my frames work, before I was trying to 'delete' or otherwise toss used frames and create new ones for each new piece of loot dropped, but I was reading about lua and it apparently isn't going to work that way without wasting memory.
So I rewrote all of it to reuse each frame and then later reset the text. At the top of the file, I declare these empty tables. I do a loop of 10 because less than 10 pieces of loot should drop per boss. I make a font string for the character name and add it to the table. I set it's text to " " to check if it is empty later, might not be the best way to do it but it works for now. I make a frame for the item link and also a font string for the text of that item and add them to their tables. Code:
--[=====[ Here is the loot frame: Code:
CreateFrame("Frame", "BossLootFrame", UIParent) This code brings up the loot frame on boss death, and it shows the character names and the item links, but now the item links do not have the mouse over functionality. Thanks in advanced! |
All times are GMT -6. The time now is 10:35 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI