Strange GameTooltip behavior with SetPoint
So basically, I'm trying to learn lua and AddOn development by adding the features and UI elements I like from big already done stuff, but by only manipulating stock blizzard frames. It's been a neat way to learn how both the stock Blizzard UI and AddOns in general work.
I really like having a tooltip underneath the mouse cursor when I'm hovering over players, and other things in the world. It helps bring attention to what my pointy thing is pointing at. So I wrote this: Code:
GameTooltip:HookScript("OnUpdate", function(self, elpased) What causes this, and how can I stop it? I've tried also hooking OnShow and doing the same math there, but that doesn't seem to help. |
You could add
Code:
print(elpased) Code:
local x, y = GetCursorPosition() I think you might want to use UPDATE_MOUSEOVER_UNIT event though. |
Have you looked at other ToolTip addons that place the tip at the cursor? Here is just one that does that:
https://www.wowinterface.com/downloa...fsTooltip.html |
Have a look at my reply to your comment from last night. Just adjust the SetPoint coordinates to your liking.
|
Here's what I have that's almost perfect:
Code:
--This function handles actually moving the GameTooltip frame The last things on the agenda for me: 1.) Get rid of the fadeout (a hot topic, apparently from Google) on Worldframe items. 2.) If you mouseover a PLAYER and then a Doodad (the sign for a shop, for example) the tooltip size is incorrect, I'm not sure how to approach that. |
1) Doesn't hooksecurefunc(GameTooltip, "FadeOut", function(self) self:Hide() end) do the trick? I always had that fadeout issue back when I used TipTac, and they claimed it "wasn't fixable", but it has never been a problem with my code.
2) That doesn't happen on my end, and not sure why it occurs, so I can't help there. It has to be something your code does differently from mine, but I wouldn't be able to tell what exactly. |
Quote:
Also, that hooksecurefunc line doesn't work for me; I resorted to hiding based on UIParent and WorldFrame mouseover shenanigans. Unfortunately that has its issues as well. PhanxTooltip has a large block for getting rid of the fade, I might just copy that. |
All times are GMT -6. The time now is 09:07 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI