From d5f2ccb14ac8f675dff6c332f03f9c725c151d8e Mon Sep 17 00:00:00 2001 From: Parnic Date: Tue, 14 Sep 2010 02:02:59 +0000 Subject: [PATCH] - registered callback for media updates from LibSharedMedia so that the mod can be refreshed if necessary --- IceHUD.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/IceHUD.lua b/IceHUD.lua index d9962b7..3a26c0b 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -897,6 +897,9 @@ function IceHUD:OnInitialize() self:SyncSettingsVersions() self:InitLDB() + if SML then + SML.RegisterCallback(self, "LibSharedMedia_Registered", "UpdateMedia") + end end @@ -1230,3 +1233,19 @@ function IceHUD:RegisterPendingModules() end pendingModuleLoads = {} end + +function IceHUD:UpdateMedia(event, mediatype, key) + if not self.db.profile or not self.IceCore.enabled then + return + end + + if mediatype == "font" then + if key == self.db.profile.fontFamily then + IceHUD.IceCore:SetFontFamily(key) + end + elseif mediatype == "statusbar" then + if self.TargetOfTarget and self.TargetOfTarget.enabled and key == self.TargetOfTarget.moduleSettings.texture then + self.TargetOfTarget:Redraw() + end + end +end