View Single Post
01-22-18, 05:36 AM   #1
gempir
A Black Drake
 
gempir's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2015
Posts: 84
AceDB-3.0 not saving

This thread is similar to my previous one, but I just can't figure out why AceDB is not working correctly.

I have followed the AceDB Tutorial here like 5 times and have read others but can't get AceDB working correctly. https://www.wowace.com/projects/ace3...b-3-0-tutorial

Currently I have this menu:


It has toggles, sliders, dropdowns everything working nicely actually. Even the profiles tab works and i can see different profiles. (Like Realm, Default, Char etc.)

But nothing saves correctly. After reloading or logging out NOTHING is saved. I have deleted the saved variables probably 10x now and tried restarting, logging out, reloading etc. Nothing seems to work.

This is how the saved variables file looks like:


Lua Code:
  1. gempDB = {
  2.     ["profileKeys"] = {
  3.         ["Wraths - Proudmoore"] = "Default",
  4.     },
  5.     ["profiles"] = {
  6.         ["Default"] = {
  7.         },
  8.     },
  9. }

Which makes sense, the Menu in the screenshot is just filled with my default values.

This is my Initialization:

Lua Code:
  1. G.ace = LibStub("AceAddon-3.0"):NewAddon("gempUI", "AceConsole-3.0", "AceEvent-3.0")
  2.  
  3. function G.ace:OnInitialize()
  4.     self.db = LibStub("AceDB-3.0"):New("gempDB", defaults, true)
  5.     options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db)
  6.  
  7.  
  8.     LibStub("AceConfig-3.0"):RegisterOptionsTable("gempUI", options)
  9.     self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("gempUI", "gempUI")
  10. end

If you want to see the full addon you can see it here:
https://github.com/gempir/gempUI/blo...9a1/config.lua

"gempDB" is my Saved Variables Variables references in the .toc file

Code:
## SavedVariables: gempDB
At this point I'm reading the AceDB code and trying to debug my way through it wanting to find out where I am doing something wrong.

I even copy pasted this example https://wow.gamepedia.com/WelcomeHom...3_to_the_Party

and tried it out and can't get it working in my current setup. Which makes me think I am loading the libraries wrong or something? I have no clue at this point.
I'm running 0 addons besides my own addon so there is no interference with other libraries.


Has anyone struggled in a similar way with AceDB? I've tried not using acedb and saving into gempDB directly in the getters/setters. This works without a problem, but I really would like the Profile solution of AceDB and not write my own Profile management.
  Reply With Quote