Exemple #1
0
        private async void ReloadBeatmap()
        {
            string filePath  = Path.Combine(_currentLevel.customLevelPath, _currentDiffBeatmap.beatmapFilename);
            string leveljson = File.ReadAllText(filePath);
            //Load new beatmapdata asynchronously
            BeatmapData newBeatmap = await _levelLoader.LoadBeatmapDataAsync(_currentLevel.customLevelPath, _currentDiffBeatmap.beatmapFilename, _currentLevel.standardLevelInfoSaveData, _cancelSource.Token);

            GameplayCoreSceneSetupData     gameSetup = BS_Utils.Plugin.LevelData.GameplayCoreSceneSetupData;
            EnvironmentEffectsFilterPreset environmentEffectsFilterPreset = ((BeatmapDifficulty)(Enum.Parse(typeof(BeatmapDifficulty), _currentDiffBeatmap.difficulty)) == BeatmapDifficulty.ExpertPlus) ? gameSetup.playerSpecificSettings.environmentEffectsFilterExpertPlusPreset : gameSetup.playerSpecificSettings.environmentEffectsFilterDefaultPreset;

            newBeatmap = (BeatmapData)BeatmapDataTransformHelper.CreateTransformedBeatmapData(newBeatmap, _currentLevel, gameSetup.gameplayModifiers, gameSetup.practiceSettings, gameSetup.playerSpecificSettings.leftHanded, environmentEffectsFilterPreset, gameSetup.environmentInfo.environmentIntensityReductionOptions);
            //Hotswap Beatmap

            ResetTimeSync();
            DestroyObjects();
            ResetNoteCutSoundEffects();
            _callbackController.SetField("_spawningStartTime", _songStartTime);
            _callbackController.SetNewBeatmapData(newBeatmap);
            //Unpause
            if (_pauseController.GetField <bool>("_paused"))
            {
                CheckPracticePlugin();
                _pauseController.HandlePauseMenuManagerDidPressContinueButton();
            }
            _queuedLoad = false;
        }
Exemple #2
0
 public void Tick()
 {
     if (Input.GetKeyDown(_exitCode))
     {
         _pauseController.HandlePauseMenuManagerDidPressMenuButton();
         return;
     }
     if (Input.GetKeyDown(_restartCode))
     {
         _pauseController.HandlePauseMenuManagerDidPressRestartButton();
         return;
     }
     if (Input.GetKeyDown(_pauseToggleCode))
     {
         if (_isPaused)
         {
             _pauseController.HandlePauseMenuManagerDidPressContinueButton();
         }
         else
         {
             _pauseController.HandlePauseTriggered();
         }
         return;
     }
 }
Exemple #3
0
 private void Resume()
 {
     pauseController.HandlePauseMenuManagerDidPressContinueButton();
     onPausePressed   -= Resume;
     onPausePressed   += Pause;
     onQuitPressed    -= Quit;
     onRestartPressed -= Restart;
 }