mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- registered callback for media updates from LibSharedMedia so that the mod can be refreshed if necessary
This commit is contained in:
19
IceHUD.lua
19
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
|
||||
|
Reference in New Issue
Block a user