Thread Tools Display Modes
09-12-14, 12:00 PM   #1
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Cannot setup SharedMediaWidgets lib - Need help

Hi,

I have rewrote my UI and I am trying to setup options in my GUI using the Ace library but I cannot get the Shared Media Widgets working. I decided to set up the libs in the exact same way my old UI use to work (which has no problems) but still I am getting an error and I do not know enough about libraries to fix it myself.

I have installed AceGUI-3.0-SharedMediaWidgets and placed it in the libs folder.

I have uploaded all the code to GitHub here: https://github.com/Mayron/MayronUI-4

The issue is this: (code found in Core.lua on line 306)
Lua Code:
  1. statusbarType= {
  2.     order = 6,
  3.     type = "select",
  4.     dialogControl = "LSM30_Statusbar",
  5.     name = "Status Bar Type",
  6.     desc = "Alter the status bar style.",
  7.     values = AceGUIWidgetLSMlists.statusbar,
  8.     get = function()
  9.         -- to do.
  10.      end,
  11.      set = function(self,key)
  12.         -- to do.
  13.      end,
  14. },

And I get this error: attempt to index global 'AceGUIWidgetLSMlists' (a nil value)

So I assume it is not loading the library but I honestly have been spending a long time and I cannot figure out what I screwed up on because I tried following the guide correctly and I have tried my old UI which was setup in near enough the same way which works.

Any experts want to explain how bad I am for me? hehe
Thanks!

Last edited by Mayron : 09-12-14 at 12:03 PM.
  Reply With Quote
09-12-14, 12:05 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Do you have the library listed in your TOC file?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-12-14, 12:16 PM   #3
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Originally Posted by Seerah View Post
Do you have the library listed in your TOC file?
In my TOC file I have embeds.xml and in that it has this:

xml Code:
  1. <Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
  2.   <Script file="libs\LibStub\LibStub.lua"/>
  3.   <Include file="libs\AceAddon-3.0\AceAddon-3.0.xml"/>
  4.   <Include file="libs\AceConfig-3.0\AceConfig-3.0.xml"/>
  5.   <Include file="libs\AceConsole-3.0\AceConsole-3.0.xml"/>
  6.   <Include file="libs\AceDB-3.0\AceDB-3.0.xml"/>
  7.   <Include file="libs\AceDBOptions-3.0\AceDBOptions-3.0.xml"/>
  8.   <Include file="libs\AceGUI-3.0\AceGUI-3.0.xml"/>
  9.   <Include file="libs\AceHook-3.0\AceHook-3.0.xml"/>
  10.   <Include file="libs\AceLocale-3.0\AceLocale-3.0.xml"/>
  11.   <Include file="libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
  12.   <Script file="libs\LibDataBroker-1.1\LibDataBroker-1.1.lua"/>
  13.   <Script file="libs\LibDualSpec-1.0\LibDualSpec-1.0.lua"/>
  14.   <Script file="libs\LibAboutPanel.lua" />
  15. </Ui>
  Reply With Quote
09-12-14, 12:23 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by Mayron View Post
In my TOC file I have embeds.xml and in that it has this:
So... That's a no then?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-12-14, 12:42 PM   #5
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Originally Posted by Seerah View Post
So... That's a no then?
I don't understand why I copied the same files over from my old UI which makes use of this same library and that uses the same embeds file as the one I linked but that works.

Not sure how I embed it if I want to use AceGUI-3.0-SharedMediaWidgets,
I tried <Include file="libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/> but doesn't work, I don't know a lot about this stuff.

Last edited by Mayron : 09-12-14 at 12:44 PM.
  Reply With Quote
09-12-14, 01:39 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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>
__________________
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 » Cannot setup SharedMediaWidgets lib - Need 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