Hello!
I'm trying to finish up my addon with adding profile functionality and I'm pretty sure it's almost good too. The only issue is when I use the copy profile functionality, the values from the profile I'm trying to copy from aren't being applied to the profile of the character that's currently logged in.
core.lua
Lua Code:
function Ace3:OnInitialize()
local about_panel = LibStub:GetLibrary("LibAboutPanel", true)
if about_panel then
self.optionsFrame = about_panel.new(nil, "AutoTracker")
end
self.db = LibStub("AceDB-3.0"):New("ATP_db", ATP.defaults, true)
self.db.RegisterCallback(self, "OnNewProfile", "OnProfileUpdate")
self.db.RegisterCallback(self, "OnProfileChanged", "OnProfileUpdate")
self.db.RegisterCallback(self, "OnProfileCopied", "OnProfileUpdate")
self.db.RegisterCallback(self, "OnProfileReset", "OnProfileUpdate")
self:SetupOptions()
self.myname = UnitName("player")
self.myrealm = GetRealmName()
end
config.lua
Lua Code:
function Ace3:SetupOptions()
local ACFG = LibStub("AceConfigRegistry-3.0")
local ACD = LibStub("AceConfigDialog-3.0")
ACFG:RegisterOptionsTable("AutoTracker Profiles", LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db,true))
ACD:AddToBlizOptions("AutoTracker Profiles", "Profiles", "AutoTracker")
end
defaults.lua
Lua Code:
local ATP, Ace3, LSM = unpack(select(2,...))
local defaults = {
profile = {
continents = {
-- table contents
},
},
char = {
continents = {
-- table contents
},
}
}
ATP.defaults = defaults
Any ideas?