View Single Post
01-22-10, 12:08 PM   #58
Marthisdil
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 363
Originally Posted by spiel2001 View Post
One thing I see is this...

Code:
     if ( nUI_Loaded ) then
        nUI_ResetWatchFrame = function() end;
    end
I would recommend that you actually move that outside of all of your functions and lose the test... it won't hurt anything to do it if nUI isn't loaded. The problem is your "Create" method doesn't get called until the VARIABLES_LOADED event fires at which point nUI has already taken control of the WatchFrame.

Just put this at the top of your source file...

Code:
nUI_ResetWatchFrame = function() end;
If nUI isn't loaded, it hurts nothing. If it is loaded, and you have marked your addon as dependent on nUI, your code won't load until nUI's code has already been loaded, but *before* it is executed, in which case your function will replace nUI's function and keep it from being executed and thus keep nUI from fiddling with the watch frame.
If nothing else, I'm learning a lil bit about frames and lua here

I <3 you guys!
__________________

Marth