Hi,
Having an error with oUF layout that has Ace profiles in the config. I have it set up like so:
Code:
Henna = LibStub("AceAddon-3.0"):NewAddon("Henna", "AceConsole-3.0", "AceEvent-3.0")
function Henna:OnInitialize()
self.db = LibStub("AceDB-3.0"):New("HennaDB", defaults, "Default")
self.db.RegisterCallback(self, "OnProfileChanged", "UpdateDisplay")
self.db.RegisterCallback(self, "OnProfileCopied", "UpdateDisplay")
self.db.RegisterCallback(self, "OnProfileReset", "UpdateDisplay")
--Options
LibStub("AceConfig-3.0"):RegisterOptionsTable("Henna-Options", Henna_Options)
self.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Henna-Options", "Henna")
-- Profiles
LibStub("AceConfig-3.0"):RegisterOptionsTable("Henna-Profiles", LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db))
self.profilesFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("Henna-Profiles", "Profiles", "Henna")
end
function Henna:OnEnable()
self:SpawnCore()
end
function Henna:UpdateDisplay()
self:SpawnCore()
end
function Henna:SpawnCore(self)
oUF:RegisterStyle("HennaPlayer", LayoutPlayer)
oUF:SetActiveStyle("HennaPlayer")
oUF:Spawn("player", "oUF_player")
oUF:RegisterStyle("HennaTarget", LayoutTarget)
oUF:SetActiveStyle("HennaTarget")
oUF:Spawn("target", "oUF_target")
oUF:RegisterStyle("HennaPet", LayoutPet)
oUF:SetActiveStyle("HennaPet")
oUF:Spawn("pet", "oUF_pet")
end
The problem is, when switching profiles, it should not try to re-register the oUF styles, because that makes an error. In oUF.lua, function oUF:RegisterStyle it provokes the error that says "Style already registered."
UpdateDisplay is called when changing profiles. So I removed the line in UpdateDisplay for Spawn Core, but then nothing at all happens. Is there a function I can call to redraw the oUF objects, which is not SpawnCore?