This is the minimal working example.
Core.lua:
Lua Code:
Addon = LibStub("AceAddon-3.0"):NewAddon("mwe3")
Addon.defaults = {
profile = {
mySituations = {
-- Default values for all situations.
["**"] = {
someValue = 0,
},
-- Specific values for single situations.
-- (No entries needed for minimal working example.)
["001"] = {},
["002"] = {},
["003"] = {},
["004"] = {},
["005"] = {},
["006"] = {},
["007"] = {},
["008"] = {},
["009"] = {},
["010"] = {},
},
},
}
function Addon:OnInitialize()
db = LibStub("AceDB-3.0"):New("myDB", self.defaults, true)
-- Normally calling this in a different context, but for the minimal
-- working example it suffices to call it here.
next(db.profile.mySituations)
end
After at least two /reload I get the following in my SavedVariables/<ACCOUNT>/mwe3.lua file:
Lua Code:
myDB = {
["profileKeys"] = {
["Mycharacter - Myrealm"] = "Default",
},
["profiles"] = {
["Default"] = {
["mySituations"] = {
["007"] = {
},
["005"] = {
},
["003"] = {
},
["008"] = {
},
["001"] = {
},
["006"] = {
},
["004"] = {
},
},
},
},
}
Only some seemingly random keys get entries here. Why?
I know this does not break anything, but I would like to understand what's going on.
Thanks!
These are my toc and embeds.xml files:
mwe3.toc:
Lua Code:
## Interface: 90001
## Title: mwe3
## SavedVariables: myDB
embeds.xml
Core.lua
embeds.xml:
Lua Code:
<?xml version="1.0" encoding="utf-8"?>
<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blizzard.com/wow/ui/" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="Libs\LibStub\LibStub.lua"/>
<Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="Libs\AceDB-3.0\AceDB-3.0.xml"/>
</Ui>