WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (http://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   AceGUI-3.0-SharedMediaWidgets (http://www.wowinterface.com/forums/showthread.php?t=45484)

Benalish 12-20-12 10:26 AM

AceGUI-3.0-SharedMediaWidgets
 
I'm trying to include in my options panel the AceGUI-3.0-SharedMediaWidgets combobox to select the font. I've tried using these two codes, but does not work:

Code:

<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Script file="Libs\LibStub\LibStub.lua"/>
<Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
<Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/>
<Include file="Libs\AceConfig-3.0\AceConfig-3.0.xml"/>
<Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
<Include file="Libs\AceDB-3.0\AceDB-3.0.xml"/>
<Include file="Libs\AceEvent-3.0\AceEvent-3.0.xml"/>
<Include file="Libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/>
</Ui>

Lua Code:
  1. WelcomeHome = LibStub("AceAddon-3.0"):NewAddon("WelcomeHome", "AceConsole-3.0")
  2.  
  3. local options = {
  4.    type = "group",
  5.    name = "WelcomeHome",
  6.    args = {
  7.     General = {
  8.          type = "group",
  9.          name = "General",
  10.          order = -1,
  11.          args = {
  12.             Info = {
  13.                type = 'select',
  14.      dialogControl = 'LSM30_Font',
  15.      name = 'Some Name',
  16.      desc = 'Some Description',
  17.      values = LSM:HashTable("font"),
  18.      get = function()
  19.           return current
  20.      end,
  21.      set = function(self,key)
  22.           current = key
  23.      end,
  24.             },
  25.          },
  26.       },
  27.    },
  28. }
  29.  
  30. function WelcomeHome:OnInitialize()
  31.     -- Called when the addon is loaded
  32.     LibStub("AceConfig-3.0"):RegisterOptionsTable("WelcomeHome", options)
  33.     self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("WelcomeHome", "WelcomeHome")
  34. end

I have to add something else?

Phanx 12-20-12 11:25 PM

Can you be more specific about how it "does not work"? What does the dropdown look like in-game? Do you have BugSack? Does it report any errors?

Also, your code indentation is really inconsistent. :(

Benalish 12-21-12 10:28 AM

Did not display the combobox! I solved the problem ;D the documentation found about ACE libraries are very approximate :rolleyes:

pelf 12-22-12 08:56 PM

Well, what were you doing wrong and was ended up being right?

Benalish 12-29-12 11:25 PM

I had not written this: local LSM = LibStub("LibSharedMedia-3.0")

Phanx 12-30-12 04:12 AM

Just FYI, if you're only going to be using that LSM variable in one place, you should just get rid of the variable and use LibStub("LibSharedMedia-3.0") directly in that one place instead.


All times are GMT -6. The time now is 06:17 AM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC