GameToolTip Update Event
I am creating an addon to automatically switch to your gathering skill set when you mouse over a node. The addon is currently getting its information from the GameToolTip.
I could not find any event linked to changes in theGameToolTip so I overrode the OnShow, OnHide and OnUpdate scripts. This works for my addon but it has broken any dynamic GameToolTips that updat when you hold down the shift modifier (eg show the item that you have equiped in the same slot at the item you are mousing over or with TSM when if updates the GameToolTip to show the prices for a stack instead of a single item. Code:
-- CreateEvent when GameToolTip Shows Any help would be apreciated. |
Why don't you hook the scripts instead of overriding them?
|
Thank you for the response LudiusMaximus.
I had tried to hook it instead of override but keept running into errors. When trying to do this I found this forum post and was basing my code off it. https://forum.elysium-project.org/to...tooltip-event/ So I tried... Quote:
Quote:
" Interface\AddOns\ClassicAutoGearChanger\main.lua:334: attempt to call upvalue 'BlizzardGameTooltipOnUpdateRetention' (a nil value) Time: Wed Jan 20 09:11:12 2021 Count: 1765 Stack: Interface\AddOns\ClassicAutoGearChanger\main.lua:334: attempt to call upvalue 'BlizzardGameTooltipOnUpdateRetention' (a nil value) [C]: ? Interface\AddOns\ClassicAutoGearChanger\main.lua:334: in function <Interface\AddOns\ClassicAutoGearChanger\main.lua:332> [C]: ? [C]: ? Locals: " This makes me think that GameTooltip.OnUpdate does not exist but if it did not exist overriding it should not cause any issues so I am a bit lost. |
Just fount this on https://wowwiki.fandom.com/wiki/UIOBJECT_GameTooltip
"When you mouse over things in the game world, the game engine internally calls the equivalent of :Set____() - not the actual Lua method. In particular, this means that hooked GameTooltip methods will never trigger for engine-generated tooltips. Hooks will however catch all other tooltips generated from the UI itself. For non-item/unit tooltips you will even see :AddLine and :AddDoubleLine calls." Does this mean that I need to hook the AddLine and AddDoubleLine scripts instead? |
Instead of
Code:
local BlizzardGameTooltipOnUpdateRetention = GameTooltip.OnUpdate Code:
local BlizzardGameTooltipOnUpdateRetention = GameTooltip:GetScript("OnUpdate") Is it important that your CustomToolTipOnUpdate() gets called before BlizzardGameTooltipOnUpdateRetention()? If not, just do a HookScript: Lua Code:
|
Thank you again for your response. It was very helpful.
To start with I changed the code to the following and got things to work. Quote:
Quote:
Again thanks alot for you assistance I really apreciated it. |
All times are GMT -6. The time now is 01:43 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI