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