Beispiel #1
0
    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);
    }
Beispiel #2
0
    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);
        }
    }
Beispiel #3
0
    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);
        }
    }
Beispiel #4
0
 private void EnableExcuteButton(bool rEnable)
 {
     excuteOne.SetInteractable(rEnable);
     excuteMulti.SetInteractable(rEnable && Module_Chase.CheckMoppingUp(task, SingleMoppingUpMax) != MoppingUpException.MaxNotEnough);
 }