- registered callback for media updates from LibSharedMedia so that the mod can be refreshed if necessary

This commit is contained in:
Parnic
2010-09-14 02:02:59 +00:00
parent 02d558dd36
commit d5f2ccb14a

View File

@ -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