View Single Post
08-27-11, 03:00 AM   #3
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
First, I don't see you declaring your addon at the very top in Ace fashion. Ie:

Core.lua
Code:
local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon")
Config.lua
Code:
local MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon")

For getting DB, you'll want to put this line in:
Code:
self.db = LibStub("AceDB-3.0"):New("MyAddonDB", defaults, "Default")
I generally put my defaults table in Core.lua, along with the above line in the MyAddon:OnInitialize() function. MyAddonDB is the SavedVariable table name declared in .toc, and Default is the name of your initial profile.

To get the DB into a variable, something like this in a MyAddon:Anything() function.
Code:
db = self.db.profile

O also when using Ace3 were do I put the files and which ones do I use, or do I just place the whole Ace3 file in the addons?
For now, you can just install Ace3 like a regular addon, this will ensure you have all the components necessary. When you finalize your addon later on, you can set up dependencies and an Embeds.xml, as well as store required Ace folders inside your addon.

Last edited by Nibelheim : 08-27-11 at 03:21 AM.
  Reply With Quote