local GodBeastLibrary_Controller = {} local EventSystem = require('Event/EventSystem') local private = {} function GodBeastLibrary_Controller.OnStartup() EventSystem.Regist(EventID.FunctionUnlockUpdate, GodBeastLibrary_Controller.CheckRedPoint) EventSystem.Regist(EventID.UI_GodBeast_RefreshDevelopRed, GodBeastLibrary_Controller.CheckRedPoint) private.params = { oldLevelCfg = nil, newLevelCfg = nil } end function GodBeastLibrary_Controller.OnShutdown() private.params = nil end function GodBeastLibrary_Controller.CheckUnlock() local isUnlock, _ = MDL.Unlock.IsClientUnlockWithText(MDL.Unlock.FunctionType.GodBeastLibrary, "IDS_Activity_Condition_01") return isUnlock end function GodBeastLibrary_Controller.OpenMainPanel() local isUnlock, _ = MDL.Unlock.IsClientUnlockWithText(MDL.Unlock.FunctionType.GodBeastLibrary, "IDS_Activity_Condition_01") if isUnlock then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIGodBeastIllustratedBase, nil, Const_UI_Lua.UIEnum.UIHeroIllustratedBase) end end function GodBeastLibrary_Controller.ShowLeveUpTipPanel(oldLevel, newLevel) if oldLevel and newLevel > oldLevel then private.params.newLevelCfg = DataSheetManager.GodBeastPictorialScore:GetDataByLevelID(newLevel) local _, oldCfg = DataSheetManager.GodBeastPictorialScore:TryGetDataByLevelID(oldLevel) if oldCfg then private.params.oldLevelCfg = oldCfg else private.params.oldLevelCfg = nil end private.params.type = LuaConst.PictorialType.GodBeast UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroIllustratedLevelUpTip, private.params) end end function GodBeastLibrary_Controller.CheckRedPoint() if not MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.GodBeastLibrary) then CTL.RedPoint.RemoveRedPoint(CTL.RedPoint.RedPointKey.Library_GodBeast) return end if MDL.GodBeastLibrary.IsShowRP() then CTL.RedPoint.AddRedPoint(CTL.RedPoint.RedPointKey.Library_GodBeast) return end CTL.RedPoint.RemoveRedPoint(CTL.RedPoint.RedPointKey.Library_GodBeast) end return GodBeastLibrary_Controller