Thread Tools Display Modes
11-25-16, 04:18 PM   #1
alikim
A Fallenroot Satyr
Join Date: Jul 2015
Posts: 27
how to hookup non existing frames?

I'm trying to hook up AuctionFrame, like so

hooksecurefunc(AuctionFrame, "AuctionFrame_OnLoad", hook_AF_OnLoad)

and I get a general error about function usage, I guess that's because the frame doesn't exist till you open the auction window.

How do I hookup a frame that doesn't exist?

Is there a higher level frame that creates AuctionFrame and maybe I can hookup on that one? What is the common approach?

Last edited by alikim : 11-25-16 at 04:35 PM.
  Reply With Quote
11-25-16, 05:06 PM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,237
You need to have your AddOn do two things in its ToC:
  1. ## LoadOnDemand: 1
  2. ## LoadWith: Blizzard_AuctionUI
You are correct that the error is because the auction frame is not loaded, so you get nil errors. And if you want to access the auction UI when you are not visiting the auctioneer, well, I am not sure you can, but...
Lua Code:
  1. if not IsAddOnLoaded("Blizzard_AuctionUI") then
  2.     LoadAddOn("Blizzard_AuctionUI")
  3. end
  4.  
  5. -- now hook it and do stuff

Last edited by myrroddin : 11-25-16 at 05:08 PM. Reason: missing space in LoD
  Reply With Quote
11-25-16, 07:26 PM   #3
alikim
A Fallenroot Satyr
Join Date: Jul 2015
Posts: 27
Thank you!
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » how to hookup non existing frames?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off