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