Thread: Hookscript
View Single Post
01-05-22, 07:52 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
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:
  1. local T = C_Timer.NewTicker(1, function()
  2.     if CUSTOMFRAME then
  3.         CUSTOMFRAME:HookScript("OnUpdate", function(self)
  4.             print("have it")
  5.         end)
  6.         T:Cancel()
  7.     end
  8. end)

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?
...???
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-05-22 at 08:38 AM.
  Reply With Quote