From 4c7ae9b91825db31ee7808b51df20db1db090cae Mon Sep 17 00:00:00 2001 From: Xinhuan Date: Sat, 1 Nov 2008 22:59:29 +0800 Subject: [PATCH] Apply a whole list of configuration settings that were forgotten on changing profiles. --- Omen.lua | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/Omen.lua b/Omen.lua index 3ed1014..75b9e94 100644 --- a/Omen.lua +++ b/Omen.lua @@ -566,12 +566,40 @@ function Omen:OnProfileChanged(event, database, newProfileKey) self:ReAnchorBars() self:ReAnchorLabels() self:UpdateBarLabelSettings() - self:UpdateVisible() - self:UpdateBars() self:UpdateFuBarSettings() + -- These remainder settings were not placed in functions + -- and were just updated directly from the config code. if LDBIcon then LDBIcon:Refresh("Omen", db.MinimapIcon) end + if db.ShowWith.HideWhenOOC then + self:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateVisible") + self:RegisterEvent("PLAYER_REGEN_ENABLED", "UpdateVisible") + else + self:UnregisterEvent("PLAYER_REGEN_DISABLED") + self:UnregisterEvent("PLAYER_REGEN_ENABLED") + end + if db.UseFocus then + self:RegisterEvent("UNIT_TARGET") + else + self:UnregisterEvent("UNIT_TARGET") + end + local f = self.TPSUpdateFrame + if f then + if db.Bar.ShowTPS then f:Show() else f:Hide() end + end + if db.Bar.ShowValue and db.Bar.ShowPercent then + bar.Text2:SetText(L["Threat [%]"]) + else + bar.Text2:SetText(L["Threat"]) + end + local texturepath = LSM:Fetch("statusbar", db.Bar.Texture) + for i = 0, #bars do + bars[i].texture:SetTexture(texturepath) + end + + self:UpdateVisible() + self:UpdateBars() end function Omen:SetAnchors(useDB)