From 13a4cccfb5dc3809a35908f567045f04db73d88f Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Wed, 12 Feb 2014 15:49:51 -0700 Subject: [PATCH 1/2] Added resetspeed mod to PlayerOptions. --- src/PlayerOptions.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index f0e908b79e..e35b437785 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -366,6 +366,14 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut } else if( sBit == "clearall" ) Init(); + else if( sBit == "resetspeed" ) + { + // Copied from Init. + m_fMaxScrollBPM = 0; m_SpeedfMaxScrollBPM = 1.0f; + m_fTimeSpacing = 0; m_SpeedfTimeSpacing = 1.0f; + m_fScrollSpeed = 1.0f; m_SpeedfScrollSpeed = 1.0f; + m_fScrollBPM = 200; m_SpeedfScrollBPM = 1.0f; + } else if( sBit == "boost" ) SET_FLOAT( fAccels[ACCEL_BOOST] ) else if( sBit == "brake" || sBit == "land" ) SET_FLOAT( fAccels[ACCEL_BRAKE] ) else if( sBit == "wave" ) SET_FLOAT( fAccels[ACCEL_WAVE] ) From 0c9728a8a9324ada5895ae3b0f4f160a8089d88e Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Fri, 14 Feb 2014 22:26:03 -0700 Subject: [PATCH 2/2] Changed resetspeed to use SET_FLOAT so it can be tweened to the way other mods can. --- src/PlayerOptions.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index e35b437785..a2f1a496fa 100644 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -368,11 +368,16 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut else if( sBit == "clearall" ) Init(); else if( sBit == "resetspeed" ) { - // Copied from Init. - m_fMaxScrollBPM = 0; m_SpeedfMaxScrollBPM = 1.0f; - m_fTimeSpacing = 0; m_SpeedfTimeSpacing = 1.0f; - m_fScrollSpeed = 1.0f; m_SpeedfScrollSpeed = 1.0f; - m_fScrollBPM = 200; m_SpeedfScrollBPM = 1.0f; + /* level is set to the values from Init() because all speed related + fields are being reset to initial values, and they each have different + initial values. -kyz */ + level= 0; + SET_FLOAT(fMaxScrollBPM); + SET_FLOAT(fTimeSpacing); + level= 1.0f; + SET_FLOAT(fScrollSpeed); + level= 200.0f; + SET_FLOAT(fScrollBPM) } else if( sBit == "boost" ) SET_FLOAT( fAccels[ACCEL_BOOST] ) else if( sBit == "brake" || sBit == "land" ) SET_FLOAT( fAccels[ACCEL_BRAKE] )