Thread Tools Display Modes
12-02-10, 07:33 AM   #1
Lyelu
A Cyclonian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 44
oUF and Ace Profiles

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?
  Reply With Quote
12-02-10, 09:06 AM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
You have to do some of that updating yourself. The rest you can do through :UpdateAllElements().
__________________
「貴方は1人じゃないよ」
  Reply With Quote
12-03-10, 11:18 AM   #3
Lyelu
A Cyclonian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 44
I tried and still end up with two healthbars per unit... What would you suggest that I attach that function to exactly?
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF and Ace Profiles


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off