Пример #1
0
        public void OnProgress(Game.ProgressState progress)
        {
            switch (progress)
            {
            case Game.ProgressState.Preparing:
                Model.WaitingStatus = AppStrings.Race_Preparing;
                break;

            case Game.ProgressState.Launching:
                if (SettingsHolder.Drive.SelectedStarterType == SettingsHolder.DriveSettings.DeveloperStarterType)
                {
                    Model.WaitingStatus = "Now, run AC…";
                }
                else
                {
                    Model.WaitingStatus = _mode == GameMode.Race ? AppStrings.Race_LaunchingGame :
                                          _mode == GameMode.Replay ? AppStrings.Race_LaunchingReplay : AppStrings.Race_LaunchingBenchmark;
                }
                break;

            case Game.ProgressState.Waiting:
                Model.WaitingStatus = _mode == GameMode.Race ? AppStrings.Race_Waiting :
                                      _mode == GameMode.Replay ? AppStrings.Race_WaitingReplay : AppStrings.Race_WaitingBenchmark;
                break;

            case Game.ProgressState.Finishing:
                RevertSizeFix().Ignore();
                Model.WaitingStatus = AppStrings.Race_CleaningUp;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(progress), progress, null);
            }
        }
Пример #2
0
        void IGameUi.OnProgress(Game.ProgressState progress)
        {
            switch (progress)
            {
            case Game.ProgressState.Preparing:
                Model.WaitingStatus = AppStrings.Race_Preparing;
                break;

            case Game.ProgressState.Launching:
                Model.WaitingStatus = _mode == GameMode.Race ? AppStrings.Race_LaunchingGame :
                                      _mode == GameMode.Replay ? AppStrings.Race_LaunchingReplay : AppStrings.Race_LaunchingBenchmark;
                break;

            case Game.ProgressState.Waiting:
                Model.WaitingStatus = _mode == GameMode.Race ? AppStrings.Race_Waiting :
                                      _mode == GameMode.Replay ? AppStrings.Race_WaitingReplay : AppStrings.Race_WaitingBenchmark;
                break;

            case Game.ProgressState.Finishing:
                Model.WaitingStatus = AppStrings.Race_CleaningUp;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(progress), progress, null);
            }
        }
Пример #3
0
        public void OnProgress(Game.ProgressState progress)
        {
            switch (progress)
            {
            case Game.ProgressState.Preparing:
                Model.WaitingStatus = AppStrings.Race_Preparing;
                break;

            case Game.ProgressState.Launching:
                if (AcRootDirectory.CheckDirectory(MainExecutingFile.Directory) &&
                    MainExecutingFile.Name != "AssettoCorsa.exe" &&
                    new IniFile(AcPaths.GetCfgVideoFilename())["CAMERA"].GetNonEmpty("MODE") == "OCULUS" &&
                    MessageDialog.Show(
                        "Oculus Rift might not work properly with Content Manager is in AC root folder. It’s better to move it to avoid potential issues.",
                        "Important note", new MessageDialogButton {
                    [MessageBoxResult.Yes] = "Move it now",
                    [MessageBoxResult.No] = "Ignore"
                }, "oculusRiftWarningMessage") == MessageBoxResult.Yes)
                {
                    try {
                        var newLocation = FilesStorage.Instance.GetFilename(MainExecutingFile.Name);
                        File.Copy(MainExecutingFile.Location, newLocation, true);
                        WindowsHelper.ViewFile(newLocation);
                        ProcessExtension.Start(newLocation, new[] { @"--restart", @"--move-app=" + MainExecutingFile.Location });
                        Environment.Exit(0);
                    } catch (Exception e) {
                        NonfatalError.Notify("Failed to move Content Manager executable", "I’m afraid you’ll have to do it manually.", e);
                    }
                }

                if (SettingsHolder.Drive.SelectedStarterType == SettingsHolder.DriveSettings.DeveloperStarterType)
                {
                    Model.WaitingStatus = "Now, run AC…";
                }
                else
                {
                    Model.WaitingStatus = _mode == GameMode.Race ? AppStrings.Race_LaunchingGame :
                                          _mode == GameMode.Replay ? AppStrings.Race_LaunchingReplay : AppStrings.Race_LaunchingBenchmark;
                }
                break;

            case Game.ProgressState.Waiting:
                Model.WaitingStatus = _mode == GameMode.Race ? AppStrings.Race_Waiting :
                                      _mode == GameMode.Replay ? AppStrings.Race_WaitingReplay : AppStrings.Race_WaitingBenchmark;
                break;

            case Game.ProgressState.Finishing:
                RevertSizeFix().Ignore();
                Model.WaitingStatus = AppStrings.Race_CleaningUp;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(progress), progress, null);
            }
        }
Пример #4
0
 void IGameUi.OnProgress(Game.ProgressState progress)
 {
 }