Exemplo n.º 1
0
        private void ButtonDownload_Click(object sender, EventArgs e)
        {
            switch (CurrentState)
            {
            case State.Idle:
                CurrentState = State.RTPatch;
                _nextState   = NextState.Download;
                RTPatcher.Run(ComboBoxLanguages.SelectedItem as Language);

                break;

            case State.Download:
                ButtonDownload.Text = StringLoader.GetText("button_cancelling");
                Downloader.Cancel();

                break;

            case State.Patch:
                ButtonDownload.Text = StringLoader.GetText("button_cancelling");
                Patcher.Cancel();

                break;

            case State.RTPatch:
                ButtonDownload.Text = StringLoader.GetText("button_cancelling");
                RTPatcher.Cancel();

                break;
            }
        }
Exemplo n.º 2
0
        private void ForceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Language language = ComboBoxLanguages.SelectedItem as Language;

            ResetTranslation(language);

            CurrentState = State.RTPatch;
            _nextState   = NextState.Download;
            RTPatcher.Run(language);
        }
Exemplo n.º 3
0
        private void ButtonStartRaw_Click(object sender, EventArgs e)
        {
            switch (CurrentState)
            {
            case State.Idle:
                CurrentState = State.RTPatch;
                _nextState   = NextState.PlayRaw;
                RTPatcher.Run(ComboBoxLanguages.SelectedItem as Language);

                break;
            }
        }
Exemplo n.º 4
0
        private void ButtonPlay_Click(object sender, EventArgs e)
        {
            switch (CurrentState)
            {
            case State.Idle:
                CurrentState = State.RTPatch;
                _nextState   = NextState.Play;
                RTPatcher.Run(ComboBoxLanguages.SelectedItem as Language);

                break;

            case State.WaitClient:
                ButtonPlay.Text = StringLoader.GetText("button_cancelling");
                GameStarter.Cancel();

                break;
            }
        }
Exemplo n.º 5
0
        private void GameStarter_GameStarterCompleted(object sender, GameStarterCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                Logger.Debug($"{sender.ToString()} cancelled.");
            }
            else if (e.Error != null)
            {
                Logger.Error(e.Error);
                MsgBox.Error(e.Error.Message);
            }
            else if (e.NeedsForcePatch)
            {
                MsgBox.Notice(StringLoader.GetText("notice_outdated_translation"));
                ResetTranslation(e.Language);

                CurrentState = State.RTPatch;
                _nextState   = NextState.Download;
                RTPatcher.Run(e.Language);

                return;
            }
            else
            {
                Logger.Debug($"{sender.ToString()} successfuly completed");
                RestoreFromTray();
            }

            try
            {
                RestoreBackup(e.Language);
            }
            finally
            {
                CurrentState = State.Idle;
            }
        }