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