Hyperlink Tooltip Help
This code has been around for a while and (first found it with NeavUI) but it seems to wrk for most item links except battle pets is there something im missing? Does a battle pet link have it own link style?
In this first image you will notice the mouseover is working. ( I also have fstack enabled to see what the difference in links are) In this second image I linked a battle pet in the "say" channel and no tooltip. (again fstack is enabled) Here is the current code I am using: Code:
local _G = getfenv(0) Thanks Coke |
Battle pets have their own tooltip object; they don't use the GameTooltip at all. Battle pet abilities, garrison followers, follower abilities, and missions also have their own tooltips objects. You can see how the default UI handles those here, though really it would be a lot easier to just call the click function on mouseover instead of recreating it:
Code:
chat:HookScript('OnHyperlinkEnter', ChatFrame_OnHyperlinkShow) Code:
local linktypes = { Also you can just use HookScript instead of manually storing and replacing and calling the original script. If there is no original script then HookScript behaves exactly like SetScript. |
Quote:
Quote:
Quote:
So this is what I tried and didn't get to work: Code:
local _G = getfenv(0) Coke |
so I figured it out (kinda on my own :P)
in Phanx's original code the linkType the T was no capitalized in the function code so it was not finding the table. Code:
local linktypes = { Coke |
That works too, but your last attempt didn't work because you were using some awful table-creating Frankenstein instead of the code I posted.
(1) When you use HookScript you should not manually capture and call the original script -- if you do that, it will be called twice, once before your script, and once from inside your script. If the original method toggles something, then calling it twice is like not calling it at all. (2) You were looping over a list of string values and trying to call frame methods on them. This would generate a Lua error telling you exactly what and where the problem was. I know I've told you before -- go get an error display addon and use it! (3) Even if you fixed #2, you'd still be attempting to show every tooltip object at the same time, which doesn't even make sense, because... (4) You'd also be calling methods like SetOwner and SetHyperlink on objects that do not have those methods. Battle pet and garrison related tooltips are not GameTooltip-type objects, and cannot display arbitrary hyperlinks. |
is there a SetPoint I can use to have the tooltip for the hyperlink show above my chatframe instead of above my mainmenubar?
I guess what im asking is were would I put this code: Code:
local i Coke |
Quote:
And believe it or not Phanx I listen to everything you have to say on coding, It might not sink in for the first few attempts or tries but in the end all my code seems to have the Phanx Seal of Approval :p because it is how you have written it. Coke |
Just found out you need to add:
Code:
currency = true, Coke |
Quote:
Code:
tooltip:SetOwner(parentFrame, "ANCHOR_NONE") Also, you shouldn't use Bugger and BugSack at the same time -- they both do the same thing. Pick the one you prefer, and get rid of the othe one. :p |
Hey Phanx, coud you please post a final coude of this that works?
I'd realy like to see Battele Pet Tooltips on hoover and all tooltips shoud be anchored on top of my chatframe. Also any way to make it work with TipTac? I have tryed to get something to work with the things posted here but no chance :( I'm currently using this: Lua Code:
|
Quote:
Quote:
|
Quote:
...and its also not OP's code and I knew you woud read it :P |
Quote:
Code:
local showLinkType = { |
Thank you, but it gives this error and nothing is happening :S but the code is still awesome!
Code:
2x LinkHover\LinkHover-1.3.lua:52: 'for' limit must be a number Lua Code:
|
try NUM_CHAT_WINDOWS
|
Quote:
Code:
9x LinkHover\LinkHover-1.4.lua:22: attempt to index global 'linkData' (a nil value) |
like Phanx said further up, you need to use SetOwner
Lua Code:
you can find a list of anchors here: http://wowprogramming.com/docs/widge...oltip/SetOwner edit: you edited your post :P |
Ok it works now for normal tooltips but gives error with Gnosis when trying too mouseover PetLinks,
When I disable Gnosis it gives error with BadBoy etc ... So disabeling all AddOns give this error: Code:
4x FrameXML\ItemRef.lua:252: ItemRefTooltip:SetHyperlink(): Unknown link type Lua Code:
|
I think the SetItemRef call in OnHyperlinkEnter should be this instead:
Code:
SetItemRef(linkData, link, "LeftButton", frame) Code:
ItemRefTooltip:Hide() |
Quote:
Quote:
|
All times are GMT -6. The time now is 02:48 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI