local HeroLibrary_Controller = {} local private = {} local EventSystem = require('Event/EventSystem') function HeroLibrary_Controller.OnStartup() EventSystem.Regist(EventID.FunctionUnlockUpdate, HeroLibrary_Controller.CheckRedPoint) private.params = { oldLevelCfg = nil, newLevelCfg = nil } end function HeroLibrary_Controller.OnShutdown() private.params = nil end function HeroLibrary_Controller.OpenMainPanel() local isUnlock, content = MDL.Unlock.IsClientUnlockWithText(MDL.Unlock.FunctionType.HeroLibrary, "IDS_Activity_Condition_01") if isUnlock then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIHeroIllustratedBase) end end function HeroLibrary_Controller.CheckUnlock() local isUnlock, content = MDL.Unlock.IsClientUnlockWithText(MDL.Unlock.FunctionType.HeroLibrary, "IDS_Activity_Condition_01") return isUnlock end function HeroLibrary_Controller.ShowLeveUpTipPanel(oldLevel, newLevel) if oldLevel and newLevel > oldLevel then private.params.newLevelCfg = DataSheetManager.HeroPictorialScore:GetDataByLevelID(newLevel) local _, oldCfg = DataSheetManager.HeroPictorialScore:TryGetDataByLevelID(oldLevel) if oldCfg then private.params.oldLevelCfg = oldCfg else private.params.oldLevelCfg = nil end private.params.type = LuaConst.PictorialType.Hero UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroIllustratedLevelUpTip, private.params) end end function HeroLibrary_Controller.CheckRedPoint() if not MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.HeroLibrary) then CTL.RedPoint.RemoveRedPoint(CTL.RedPoint.RedPointKey.Library_Hero) return end for i = 0, 3 do if MDL.HeroLibrary.IsShowRPByTab(i) then CTL.RedPoint.AddRedPoint(CTL.RedPoint.RedPointKey.Library_Hero) return end end CTL.RedPoint.RemoveRedPoint(CTL.RedPoint.RedPointKey.Library_Hero) end return HeroLibrary_Controller