diff --git a/Assets/Script/Gameplay/GameManager.cs b/Assets/Script/Gameplay/GameManager.cs index 3180069b1..325e27812 100644 --- a/Assets/Script/Gameplay/GameManager.cs +++ b/Assets/Script/Gameplay/GameManager.cs @@ -494,9 +494,7 @@ private bool EndSong() public void ForceQuitSong() { - var speed = GlobalVariables.State.SongSpeed; GlobalVariables.State = PersistentState.Default; - GlobalVariables.State.SongSpeed = speed; GlobalVariables.Instance.LoadScene(SceneIndex.Menu); } diff --git a/Assets/Script/Menu/DifficultySelect/DifficultySelectMenu.cs b/Assets/Script/Menu/DifficultySelect/DifficultySelectMenu.cs index 7810122da..d38038c67 100644 --- a/Assets/Script/Menu/DifficultySelect/DifficultySelectMenu.cs +++ b/Assets/Script/Menu/DifficultySelect/DifficultySelectMenu.cs @@ -21,6 +21,11 @@ namespace YARG.Menu.DifficultySelect { public class DifficultySelectMenu : MonoBehaviour { + /// + /// The saved song speed value + /// + private static float _songSpeed = 1f; + private enum State { Main, @@ -100,7 +105,7 @@ private void OnEnable() }) }, false)); - _speedInput.text = $"{(int)(GlobalVariables.State.SongSpeed * 100f)}%"; + _speedInput.text = $"{(int)(_songSpeed * 100f)}%"; // ChangePlayer(0) will update for the current player _playerIndex = 0; @@ -377,6 +382,7 @@ private void ChangePlayer(int add) // The max speed that the game can keep up with is 4995% float speed = float.Parse(_speedInput.text.TrimEnd('%')) / 100f; speed = Mathf.Clamp(speed, 0.1f, 49.95f); + _songSpeed = speed; GlobalVariables.State.SongSpeed = speed; GlobalVariables.Instance.LoadScene(SceneIndex.Gameplay);