local FunctionUpdateNotice_Controller = {} local private = {} local EventSystem = require('Event/EventSystem') function FunctionUpdateNotice_Controller.OnStartup() EventSystem.Regist(EventID.FunctionUnlockUpdate, private.RefreshInfoByFunction) EventSystem.Regist(EventID.UI_OperationActivity_InfoChanged, private.CheckFuncOpenIssue) private.ActivityType = MDL.OperationActivity.ActivityType.FunctionUpdateNotice private.FunctionType = MDL.Unlock.FunctionType.FunctionUpdateNotice private.lastTabIndex = 1 --1~4 end --是否显示入口 function FunctionUpdateNotice_Controller.IsCanShowEntrance() return CTL.OperationActivity.IsOperationActivityTypeOpen(private.ActivityType) and CTL.OperationActivity.IsOperationActivityTypeUnlock(private.ActivityType) and MDL.Unlock.IsUnlock(MDL.Unlock.FunctionType.FunctionUpdateNotice) end --GMS开关变化时刷新 function private.RefreshInfoByFunction(funcId, isUnlock) if funcId == private.FunctionType then if not isUnlock then private.ForceCloseActivityView() end end end function FunctionUpdateNotice_Controller.SetLastTabIndex(index) private.lastTabIndex = index end function FunctionUpdateNotice_Controller.GetLastTabIndex() return private.lastTabIndex end -- 关闭活动界面 function private.ForceCloseActivityView() logging.log(LTAG.LOG, "FunctionUpdateNotice Function(include GMS) ActivityEnd ") if UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIFunctionUpdateNotice) then CTL.Tips.AddTipsMsg(Const_IDS.IDS_Monopoly_EndTips) end UIManager.CloseView(Const_UI_Lua.UIEnum.UIFunctionUpdateNotice) private.lastTabIndex = 1 end function private.CheckFuncOpenIssue() if not FunctionUpdateNotice_Controller.IsCanShowEntrance() then private.ForceCloseActivityView() return end end return FunctionUpdateNotice_Controller