View Single Post
02-19-17, 11:06 PM   #21
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by briskman3000 View Post
I took a quick look at the acedb3 info, and from what I can tell (I never used Ace so my complete understanding might be off), you have 2 issues.
Tested with your suggestions, but seems it's not working.

Lua Code:
  1. local N, T = ...;
  2.  
  3. Tracker = LibStub("AceAddon-3.0"):NewAddon(N, "AceEvent-3.0");
  4.  
  5. function Tracker:OnInitialize()
  6.     self.db = LibStub("AceDB-3.0"):New(N .. "DB", defaults, true);
  7. end

I am not quite sure why, but It didn't even run :OnInitialize() function.


Just had a look at some other addons using Ace3 framework (ElvUI & HandyNotes) and they had two different initialization style.

Lua Code:
  1. -- ElvUI
  2. local AddOnName, Engine = ...;
  3. local AddOn = LibStub("AceAddon-3.0"):NewAddon(AddOnName, "AceConsole-3.0", "AceEvent-3.0", 'AceTimer-3.0', 'AceHook-3.0');
  4.  
  5. -- HandyNotes
  6. HandyNotes = LibStub("AceAddon-3.0"):NewAddon("HandyNotes", "AceConsole-3.0", "AceEvent-3.0")
  7. local HandyNotes = HandyNotes

I am using an approach that is close to ElvUI while HandyNotes is using the method that you've told me.


------------------------------------------------------


Originally Posted by Ketho View Post
I don't see anything wrong when looking through your code, but it's a bit confusing to read this thread
The AceDB example by myrroddin (#11) should be good

Can you zip it up, paste, or push it to a repository so we can test it?
Sure thing!

Just had to pull out some media, functions and libs from my core addon.

Please check out the attachment.

Thank you.
Attached Files
File Type: zip Tracker.zip (1.72 MB, 90 views)

Last edited by Layback_ : 02-19-17 at 11:09 PM.
  Reply With Quote