local EffectLibrary_Controller = {} local private = {} local EventSystem = require("Event/EventSystem") function EffectLibrary_Controller.OnStartup() private.params = { oldLevelCfg = nil, newLevelCfg = nil } EventSystem.Regist(EventID.AcquireSystemRedAfterUnlock, private.RefreshRedPoint) EventSystem.Regist(EventID.UI_LightEffect_Refresh, private.RefreshRedPoint) EventSystem.Regist(EventID.UI_LightEffect_LightEffectPictorial_Refresh, private.RefreshRedPoint) EventSystem.Regist(EventID.UI_Decoration_Book_RedPoint_Refresh, private.RefreshRedPoint) end function EffectLibrary_Controller.OnShutdown() private.params = nil end function EffectLibrary_Controller.OpenMainPanel() local isUnlock = MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.EffectLibrary) if isUnlock then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIEffectIllustratedBase, nil, Const_UI_Lua.UIEnum.UIHeroIllustratedBase) end end function EffectLibrary_Controller.CheckUnlock() local isUnlock, _ = MDL.Unlock.IsClientUnlockWithText(MDL.Unlock.FunctionType.EffectLibrary, "IDS_Activity_Condition_01") return isUnlock end function EffectLibrary_Controller.ShowLevelUpTipPanel(oldLevel, newLevel, type) if oldLevel and newLevel > oldLevel then private.params.newLevelCfg = DataSheetManager.LightEffectPictorialScore:GetDataByLevelID(newLevel) local _, oldCfg = DataSheetManager.LightEffectPictorialScore:TryGetDataByLevelID(oldLevel) if oldCfg then private.params.oldLevelCfg = oldCfg else private.params.oldLevelCfg = nil end private.params.type = LuaConst.PictorialType.LightEffect UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroIllustratedLevelUpTip, private.params) end end function EffectLibrary_Controller.CheckRedPoint() if not MDL.LightEffect.IsInfoInit() then return end local rpKey = CTL.RedPoint.RedPointKey.Library_LightEffect if not MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.EffectLibrary) then CTL.RedPoint.RemoveRedPoint(rpKey) return end if MDL.EffectLibrary.IsShowRP() then CTL.RedPoint.AddRedPoint(rpKey) return end CTL.RedPoint.RemoveRedPoint(rpKey) end function private.RefreshRedPoint() CTL.RedPoint.AddOneRedPointFunc(EffectLibrary_Controller.CheckRedPoint) end return EffectLibrary_Controller