diff --git a/Main/include/GameConfig.hpp b/Main/include/GameConfig.hpp index 1852dc6f2..4fc541909 100644 --- a/Main/include/GameConfig.hpp +++ b/Main/include/GameConfig.hpp @@ -23,6 +23,7 @@ DefineEnum(GameConfigKeys, HiSpeed, SpeedMod, ModSpeed, + AutoSaveSpeed, SkipScore, GlobalOffset, InputOffset, diff --git a/Main/src/Game.cpp b/Main/src/Game.cpp index 100f59537..e33a3f5db 100644 --- a/Main/src/Game.cpp +++ b/Main/src/Game.cpp @@ -71,6 +71,7 @@ class Game_Impl : public Game bool m_paused = false; bool m_ended = false; bool m_transitioning = false; + bool m_saveSpeed = false; bool m_renderDebugHUD = false; @@ -207,7 +208,10 @@ class Game_Impl : public Game if (m_fxSamples) delete[] m_fxSamples; // Save hispeed - g_gameConfig.Set(GameConfigKeys::HiSpeed, m_hispeed); + if (m_saveSpeed) + { + g_gameConfig.Set(GameConfigKeys::HiSpeed, m_hispeed); + } //g_rootCanvas->Remove(m_canvas.As()); @@ -326,6 +330,7 @@ class Game_Impl : public Game m_audioOffset = g_gameConfig.GetInt(GameConfigKeys::GlobalOffset); m_playback.audioOffset = m_audioOffset; + m_saveSpeed = g_gameConfig.GetBool(GameConfigKeys::AutoSaveSpeed); /// TODO: Check if debugmute is enabled g_audio->SetGlobalVolume(g_gameConfig.GetFloat(GameConfigKeys::MasterVolume)); @@ -608,7 +613,10 @@ class Game_Impl : public Game m_hispeed = Math::Clamp(m_hispeed, 0.1f, 16.f); if ((m_speedMod != SpeedMods::XMod) && change != 0.0f) { - g_gameConfig.Set(GameConfigKeys::ModSpeed, m_hispeed * (float)m_currentTiming->GetBPM()); + if (m_saveSpeed) + { + g_gameConfig.Set(GameConfigKeys::ModSpeed, m_hispeed * (float)m_currentTiming->GetBPM()); + } m_modSpeed = m_hispeed * (float)m_currentTiming->GetBPM(); m_playback.cModSpeed = m_modSpeed; } diff --git a/Main/src/GameConfig.cpp b/Main/src/GameConfig.cpp index 74567d3de..27b118187 100644 --- a/Main/src/GameConfig.cpp +++ b/Main/src/GameConfig.cpp @@ -42,6 +42,7 @@ void GameConfig::InitDefaults() Set(GameConfigKeys::GaugeDrainNormal, 180); Set(GameConfigKeys::GaugeDrainHalf, 300); Set(GameConfigKeys::ModSpeed, 300.0f); + Set(GameConfigKeys::AutoSaveSpeed, true); Set(GameConfigKeys::SongFolder, "songs"); Set(GameConfigKeys::Skin, "Default"); Set(GameConfigKeys::Laser0Color, 200.0f); diff --git a/Main/src/SettingsScreen.cpp b/Main/src/SettingsScreen.cpp index af3b467bb..fdf9d2ecf 100644 --- a/Main/src/SettingsScreen.cpp +++ b/Main/src/SettingsScreen.cpp @@ -555,7 +555,7 @@ class SettingsScreen_Impl : public SettingsScreen EnumSetting(GameConfigKeys::SpeedMod, "Speed mod:"); FloatSetting(GameConfigKeys::HiSpeed, "HiSpeed (%f):", 0.25, 20, 0.05); FloatSetting(GameConfigKeys::ModSpeed, "ModSpeed (%f):", 50, 1500, 0.5); - + ToggleSetting(GameConfigKeys::AutoSaveSpeed, "Save hispeed changes during gameplay"); nk_layout_row_dynamic(m_nctx, 150, 2); if (nk_group_begin(m_nctx, "Hidden", NK_WINDOW_NO_SCROLLBAR)) {