local MaterialLevel_Controller = {} local private = {} local EventSystem = require('Event/EventSystem') function MaterialLevel_Controller.OnStartup() EventSystem.Regist(EventID.FunctionUnlockUpdate, private.AutoRefineRefreshByGMS) end function MaterialLevel_Controller.OnShutdown() end function private.AutoRefineRefreshByGMS(funcID, isUnlock) if funcID == MDL.Unlock.FunctionType.MaterialLevelAutoRefine then if not isUnlock then UIManager.CloseView(Const_UI_Lua.UIEnum.UIMaterialLevelSweepPanel) end end end function MaterialLevel_Controller.OpenMaterialLevelMainPanel() UIManager.OpenView(Const_UI_Lua.UIEnum.UIMaterialLevelMainPanel) end function MaterialLevel_Controller.OpenTimeUpView(id) if MDL.Purchase.GetAvailablePurchaseTimes(id) > 0 then UIManager.OpenView(Const_UI_Lua.UIEnum.UIItemBuyPanel, { type = id }) else local desc = MDL.OfficialPosition.GetPurchaseTimesDesc(id) if desc then CTL.Tips.AddTipsMsg(desc) else CTL.Tips.AddTipsMsg(Const_IDS.IDS_HeroBiography_NoPayTime) end end end function MaterialLevel_Controller.PopSweepChallengeConfirm(levelID) UTL.MessageBox.ShowOKCancelBox( nil, UIUtils.GetLocalizedTxt(Const_IDS["IDS_ResourcesChapter_Sweep4"]), MDL.MaterialLevel.OneKeySweepResourceLevelReq, --OKFunc function() UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIMaterialLevel, {id = levelID}, nil, Const_UI_Lua.UIEnum.UIMaterialLevelMainPanel) end, --CancelFunc UIUtils.GetLocalizedTxt(Const_IDS["IDS_ResourcesChapter_Sweep5"]), UIUtils.GetLocalizedTxt(Const_IDS["IDS_ResourcesChapter_Sweep6"]) ) end return MaterialLevel_Controller