Hookscript
Hi,
quick 2 questions: 1. how can you remove hookscript from frame upon some condition? 2. what is the best way to wait for some frame to show in UI... and i dont mean to Show() when already exists.. i mean to get it when it is created regardless of its visibility state? i want this: Code:
UIParent:HookScript( Thank you. |
You can't unkook something, just alter what the hook function does,
You could use OnUpdate on a frame of your own and when the CUSTOMFRAME is found, hide your frame (that stops it's OnUpdate from running) or set it's OnUpdate script to nil. Maybe something like: Lua Code:
There are probably other possabilities depending on what other conditions might exist Is the frame in a Load-On-Demand addon? Is there another frame/function that creates the frame that you can hook? ...??? |
That code return error... saying T is not found... i just put self:Cancel() instead...
In any case thank you.. i managed to get it working. |
The code posted was intended to replace your code, not be used in it :eek:.
|
Yes... i know... and when i drop just that piece of code you posted i get error cuz T is uknown variable (at least in classic SoM client)... dunno scope issues or what.. im not wow lua developer.. i just dabble with it to customize my ui...
|
From https://github.com/tomrus88/Blizzard...merAugment.lua I'd guess the callback gets called with the right object to use cancel on. So this should work:
Lua Code:
|
Indeed, I left the T out of the function declaration... oops
Lua Code:
|
All times are GMT -6. The time now is 01:56 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI