Quantcast
WoWInterface - View Single Post - How can I hooksecurefunc with colon like this: "MainMenuBarMixin:OnShow"
View Single Post
08-21-18, 06:24 PM   #7
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
Originally Posted by Nikita S. Doroshenko View Post
The thing that is confusing me, is hoocsecurefunc sometimes toggle lua errors like "funxtionX is not a function"
For example, I tried to hook some functions like function PlayerTalentFrame_UpdateSpecFrame(self, spec) from Blizzard_TalentUI.lua:

-snip-
So I used this code:
-snip
And got this: Error. hooksecurefunc(): PlayerTalentFrame_UpdateSpecFrame is not a function

At the same time, for example:
-snip
Works perfectly.

Can't understand why this happens, and will appreciate any advises how to hook functions with "funxtionX is not a function" error.
Blizzard_TalentUI is LoadOnDemand, you need to wait for ADDON_LOADED and check for Blizzard_TalentUI, or set your addon to LoadOnDemand and LoadWith Blizzard_TalentUI, depending on your use case.
  Reply With Quote