Thread Tools Display Modes
05-31-15, 04:48 AM   #1
Kygo
A Theradrim Guardian
 
Kygo's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 64
Ace3 convertion

Greetings.
I wrote a small addon to assist me with my crappy memory and I got the brilliant idea to try to convert it into a Ace3 addon (Yay!). But as soon as I started I did encounter problems that I have absolutley no idea how to solve.

Source code for the whole addon can be found here > https://github.com/Kygos/kNameHider

It works, sort of. I can see the "kNameHider" tab in the interface addons panel but it does not show anything at all. Currently the "get" and "set" for the toggle are blanks because I havent found the correct function to call (yet!).

It does generate an error tho when I click "kNameHider" in the options panel about it expected a options table but got "kNameHider".

Lua Code:
  1. Message: ...nfig-3.0\AceConfigDialog-3.0\AceConfigDialog-3.0.lua:1803: AceConfigRegistry-3.0:ValidateOptionsTable(): kNameHider.handler: expected a table, got 'kNameHider'
  2. Time: 05/31/15 12:49:10
  3. Count: 1
  4. Stack: (tail call): ?
  5. [C]: ?
  6. ...-3.0\AceConfigRegistry-3.0\AceConfigRegistry-3.0.lua:50: in function <...-3.0\AceConfigRegistry-3.0\AceConfigRegistry-3.0.lua:45>
  7. ...-3.0\AceConfigRegistry-3.0\AceConfigRegistry-3.0.lua:187: in function <...-3.0\AceConfigRegistry-3.0\AceConfigRegistry-3.0.lua:182>
  8. ...-3.0\AceConfigRegistry-3.0\AceConfigRegistry-3.0.lua:221: in function <...-3.0\AceConfigRegistry-3.0\AceConfigRegistry-3.0.lua:196>
  9. ...-3.0\AceConfigRegistry-3.0\AceConfigRegistry-3.0.lua:259: in function `ValidateOptionsTable'
  10. ...-3.0\AceConfigRegistry-3.0\AceConfigRegistry-3.0.lua:301: in function `app'
  11. ...nfig-3.0\AceConfigDialog-3.0\AceConfigDialog-3.0.lua:1803: in function `Open'
  12. ...nfig-3.0\AceConfigDialog-3.0\AceConfigDialog-3.0.lua:1896: in function <...nfig-3.0\AceConfigDialog-3.0\AceConfigDialog-3.0.lua:1894>
  13. (tail call): ?
  14. [C]: ?
  15. [string "safecall Dispatcher[2]"]:9: in function <[string "safecall Dispatcher[2]"]:5>
  16. (tail call): ?
  17. ...ace\AddOns\AddOnSkins\Libs\AceGUI-3.0\AceGUI-3.0.lua:314: in function `Fire'
  18. ...GUI-3.0\widgets\AceGUIContainer-BlizOptionsGroup.lua:20: in function <...GUI-3.0\widgets\AceGUIContainer-BlizOptionsGroup.lua:19>
  19. [C]: in function `Show'
  20. Interface\FrameXML\InterfaceOptionsFrame.lua:28: in function `InterfaceOptionsList_DisplayPanel'
  21. Interface\FrameXML\InterfaceOptionsFrame.lua:46: in function `InterfaceOptionsListButton_OnClick'
  22. [string "*:OnClick"]:2: in function <[string "*:OnClick"]:1>
  23.  
  24. Locals: <none>

Cheers folks!

Last edited by Kygo : 05-31-15 at 04:50 AM. Reason: Spelling >.<
  Reply With Quote
05-31-15, 08:53 AM   #2
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 942
That error occured because you gave it a string instead of a table. You already have a table variable named kNameHider (created by AceAddon), so just remove the quotes from that field to use it.

Code:
local options = {
    name = "kNameHider",
    handler = kNameHider,
    type = "group",
    args = {
        ...
    }
}
If you haven't already, I recommend looking at the Ace3 docs.
__________________
Knowledge = Power; Be OP

  Reply With Quote
06-02-15, 02:18 AM   #3
Kygo
A Theradrim Guardian
 
Kygo's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 64
Originally Posted by Gethe View Post
That error occured because you gave it a string instead of a table. You already have a table variable named kNameHider (created by AceAddon), so just remove the quotes from that field to use it.

Code:
local options = {
    name = "kNameHider",
    handler = kNameHider,
    type = "group",
    args = {
        ...
    }
}
If you haven't already, I recommend looking at the Ace3 docs.
A simple solution to my pretty dumb problem. Thanks Gethe!
  Reply With Quote
06-02-15, 12:16 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Remember that Ace3 isn't "magic-sauce" that will make an addon better.
__________________
"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
06-02-15, 12:50 PM   #5
Kygo
A Theradrim Guardian
 
Kygo's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 64
Originally Posted by Seerah View Post
Remember that Ace3 isn't "magic-sauce" that will make an addon better.
I know Just thought it would be good practice to add it into a small non-complex addon
  Reply With Quote
06-02-15, 12:53 PM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Originally Posted by Kygo View Post
I know Just thought it would be good practice to add it into a small non-complex addon
That pretty much defeats the purpose of a small non-complex addon if it's not needed
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
06-02-15, 12:55 PM   #7
Kygo
A Theradrim Guardian
 
Kygo's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 64
Originally Posted by Fizzlemizz View Post
That pretty much defeats the purpose of a small non-complex addon if it's not needed
It's not needed at all to add Ace3 components to an addon such as this, just doing it because it's rather good practice for a person like me to learn even more on how stuff works ^^
  Reply With Quote
06-02-15, 07:48 PM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I only ever use AceConfig (and AceGUI, LibStub, and CallbackHandler as its dependencies) if my addon has more than just a few options. You don't really need anything else in most projects.
__________________
"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

WoWInterface » Developer Discussions » Lua/XML Help » Ace3 convertion


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