View Single Post
09-12-14, 01:50 PM   #7
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Originally Posted by Phanx View Post
Keep in mind that files are loaded in the order they are listed. Your list of libraries will result in a lot of errors on login, because you're loading libraries that depend on other libraries before the libraries they depend on. For example:

* AceDB-3.0 depends on CallbackHandler-1.0, but you're loading AceDB first.
* Part of AceConfig-3.0 depends on AceGUI-3.0, and another part depends on AceConsole-3.0, but you're loading AceConfig before either of those.

Also, AceGUI-3.0-SharedMediaWidgets requires both AceGUI-3.0 and LibSharedMedia-3.0, the latter of which isn't mentioned anywhere in the XML you posted, so I have to assume you're not loading it at all.

If you don't see any errors, make sure that:

1. You're testing without other addons enabled. If your addon is still called MayronUI, but you're also using Archy, for example, then the libraries in Archy will already be loaded when your addon loads, hiding the problem.

2. You have BugSack installed. The default error display, even if you've turned it on, is incapable of showing errors that occur during the initial loading process, and is therefore useless for addon development.

Unrelatedly, I would suggest loading the library's Lua file directly if you know it only has one file, rather than loading an XML file that loads the Lua file. Reading files from disk is by far the slowest part of the loading process, so the fewer files that need to be read, the better.

Assuming the file paths themselves are correct, I'd suggest this:

xml Code:
  1. <Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/
  2. ..\FrameXML\UI.xsd">
  3.     <Script  file="libs\LibStub\LibStub.lua"/>
  4.     <Script  file="libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"/>
  5.     <Script  file="libs\AceAddon-3.0\AceAddon-3.0.lua"/>
  6.     <Script  file="libs\AceConsole-3.0\AceConsole-3.0.lua"/>
  7.     <Include file="libs\AceGUI-3.0\AceGUI-3.0.xml"/>
  8.     <Include file="libs\AceConfig-3.0\AceConfig-3.0.xml"/> <!-- depends on AceConsole, AceGUI -->
  9.     <Script  file="libs\AceDB-3.0\AceDB-3.0.lua"/> <!-- depends on CallbackHandler -->
  10.     <Script  file="libs\AceDBOptions-3.0\AceDBOptions-3.0.lua"/> <!-- depends on AceDB -->
  11.     <Script  file="libs\AceHook-3.0\AceHook-3.0.lua"/>
  12.     <Script  file="libs\AceLocale-3.0\AceLocale-3.0.lua"/>
  13.     <Script  file="libs\LibAboutPanel.lua" />
  14.     <Script  file="libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/> <!-- depends on CallbackHandler -->
  15.     <Script  file="libs\LibDualSpec-1.0\LibDualSpec-1.0.lua"/> <!-- depends on AceDB, AceDBOptions -->
  16.     <Script  file="libs\LibSharedMedia-3.0\LibSharedMedia-3.0.lua"/> <!-- CallbackHandler -->
  17.     <Include file="libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/> <!-- depends on AceGUI, LibSharedMedia -->
  18. </Ui>
Excellent, I knew that order mattered but was getting confused on how to find out the right order and assumed it should be correct due to my old AddOn still working (before I completely rewrote it). I think I found the difference though and I assume it had to be because another AddOn had SharedMedia installed correctly and I was using the library already loaded by that instead.

About the unrelated thing, I had it all in the TOC file and did not use the embeds because I want to save on files being loaded and completely agree. When I could not get it to work I tried copying the method I had used before with no luck so yes I will definitely try to cut back on files. I also want to merge more code into one single file because the Modules folder on GitHub now looks horrific.

This is exactly what I was after so thanks Phanx

EDIT: Works perfectly, ty <3

Last edited by Mayron : 09-12-14 at 02:07 PM.
  Reply With Quote