Thread Tools Display Modes
08-18-13, 03:16 AM   #1
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Code loading priority help

Ok so, i have this addon, that runs as a dependency for almost all my other addons

http://pastebin.com/jUcx1dy8

It's been serving me well for several years. The thing is, i'm in the process of redoing my entire UI, and at the same time, move all my addons into one.

That part is almost complete and works great exept for this one.

Because it was a dependency for everything else, i was guaranteed that it would be executed first but not anymore since my UI is now one big single addon.

In short, i need a way to execute this first before any other code. I've tried several different ways, but all failed, either silently (no error but no pixel adjustment) or with an error (attempt to perform arithmetic on upvalue "ScaleFix")

This isn't very clear i know and i'm sorry about that
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
  Reply With Quote
08-18-13, 04:59 AM   #2
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
WoW loads your AddOn files in the order they're listed in the TOC, so you should just be able to list CaelLib's file first.
  Reply With Quote
08-18-13, 05:00 AM   #3
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by Choonstertwo View Post
WoW loads your AddOn files in the order they're listed in the TOC, so you should just be able to list CaelLib's file first.
Yeah no, that's not what i meant, there's only one addon, and only one file in the toc. the UI.xml listing all the files. Putting this code above first in the XML doesn't help. Wish it was that easy lol
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
  Reply With Quote
08-18-13, 05:12 AM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
That sounds like a pretty bad way to set up your addon -- it would probably be better to break it up into discrete parts, eg. CaelUI_UnitFrames, CaelUI_ActionBars, etc. -- but regardless of that, there's no way that listing a file first doesn't make it load first. If your "lib" file isn't being loaded first, then you've listed something else before it. Double-check your TOC and XML files, and/or post your actual files.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
08-18-13, 05:21 AM   #5
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
Originally Posted by Phanx View Post
That sounds like a pretty bad way to set up your addon -- it would probably be better to break it up into discrete parts, eg. CaelUI_UnitFrames, CaelUI_ActionBars, etc. -- but regardless of that, there's no way that listing a file first doesn't make it load first. If your "lib" file isn't being loaded first, then you've listed something else before it. Double-check your TOC and XML files, and/or post your actual files.
Well, i can guarantee that it's not a TOC or xml issue.

The TOC only loads caelUI.xml

and here's the XML

http://pastebin.com/0yJRE5tV

I don't say that it doesn't load first, i only say that if it's not loaded as an external addon, it just doesn't work, either silently or with the error above.
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }
  Reply With Quote
08-18-13, 06:07 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Okay, so what is the actual error message?
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Code loading priority help


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