public override bool Initialize(params object[] p) { if (!base.Initialize(p)) { return(false); } excuteOne?.onClick.AddListener(OnExcuteOne); excuteMulti?.onClick.AddListener(OnExcuteMulti); resetSweepTimes?.onClick.AddListener(OnBuySweepTimes); sweepIconButton?.onClick.AddListener(() => moduleGlobal.UpdateGlobalTip(602)); if (p.Length > 0) { task = p[0] as ChaseTask; } else { task = parentWindow.chaseTask; } var exception = Module_Chase.CheckMoppingUp(task, SingleMoppingUpMax); excuteMulti.SetInteractable(exception != MoppingUpException.NoChallengeTimes); excuteMulti.SafeSetActive(exception != MoppingUpException.MaxNotEnough); RefreshMatrial(); EnableExcuteButton(true); return(true); }
private void OnExcuteOne() { var error = Module_Chase.CheckMoppingUp(task, 1); if (error == MoppingUpException.None) { //TODO: 开始扫荡 moduleChase.RequestMoppingUp((ushort)task.taskConfigInfo.ID, 1); } else { ProcessException(error); } }
private void OnExcuteMulti() { var error = Module_Chase.CheckMoppingUp(task, SingleMoppingUpMax); if (error == MoppingUpException.None) { Window_Alert.ShowAlertDefalut(Util.Format(ConfigText.GetDefalutString(TextForMatType.MoppingUpUI, 0), task.taskConfigInfo.fatigueCount * SingleMoppingUpMax, SingleMoppingUpMax), () => { //TODO: 开始扫荡 moduleChase.RequestMoppingUp((ushort)task.taskConfigInfo.ID, SingleMoppingUpMax); }, null, ConfigText.GetDefalutString(TextForMatType.MoppingUpUI, 1), ConfigText.GetDefalutString(TextForMatType.MoppingUpUI, 2)); } else { ProcessException(error); } }
private void ShowNormalPVESettlement(PReward reward) { if (modulePVE.isSendWin && modulePVE.needShowStar) { bgBtn.interactable = true; if (modulePVE.settlementTask.taskStarDetails?.Length > 0) { chaseStarpanel.gameObject.SetActive(true); chaseStarpanel.RefreshPanel(modulePVE.settlementTask, modulePVE.settlementStar); bgBtn.onClick.RemoveAllListeners(); bgBtn.onClick.AddListener(() => { OpenExceptChasePanel(reward); chaseStarpanel.gameObject.SetActive(false); bgBtn.interactable = false; OnInComplete(); }); } else { OpenExceptChasePanel(reward); OnInComplete(); } } else { OpenExceptChasePanel(reward); OnInComplete(); } m_againBtn.SafeSetActive((modulePVE?.currrentStage?.again ?? false) && Module_Chase.CheckChaseCondition(moduleChase.lastStartChase)); m_againBtn?.onClick.RemoveAllListeners(); m_againBtn?.onClick.AddListener(() => { moduleChase.SendStartChase(moduleChase.lastStartChase); }); }
private void EnableExcuteButton(bool rEnable) { excuteOne.SetInteractable(rEnable); excuteMulti.SetInteractable(rEnable && Module_Chase.CheckMoppingUp(task, SingleMoppingUpMax) != MoppingUpException.MaxNotEnough); }