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; } }
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); }
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; } }
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; } }
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; } }