add pref LockWheelAfterRandom
This commit is contained in:
@@ -1273,20 +1273,32 @@ void MusicWheel::StartRoulette()
|
|||||||
|
|
||||||
void MusicWheel::StartRandom()
|
void MusicWheel::StartRandom()
|
||||||
{
|
{
|
||||||
/* Shuffle the roulette wheel. */
|
if( PREFSMAN->m_bLockWheelAfterRandom )
|
||||||
RandomGen rnd;
|
{
|
||||||
random_shuffle( m_WheelItemDatas[SORT_ROULETTE].begin(), m_WheelItemDatas[SORT_ROULETTE].end(), rnd );
|
/* Shuffle the roulette wheel. */
|
||||||
|
RandomGen rnd;
|
||||||
|
random_shuffle( m_WheelItemDatas[SORT_ROULETTE].begin(), m_WheelItemDatas[SORT_ROULETTE].end(), rnd );
|
||||||
|
|
||||||
SetOpenGroup("", SongSortOrder(SORT_ROULETTE));
|
SetOpenGroup("", SongSortOrder(SORT_ROULETTE));
|
||||||
|
|
||||||
m_Moving = -1;
|
m_Moving = -1;
|
||||||
m_TimeBeforeMovingBegins = 0;
|
m_TimeBeforeMovingBegins = 0;
|
||||||
m_SpinSpeed = 1.0f/ROULETTE_SWITCH_SECONDS;
|
m_SpinSpeed = 1.0f/ROULETTE_SWITCH_SECONDS;
|
||||||
m_SpinSpeed *= 20.0f; /* faster! */
|
m_SpinSpeed *= 20.0f; /* faster! */
|
||||||
m_WheelState = STATE_RANDOM_SPINNING;
|
m_WheelState = STATE_RANDOM_SPINNING;
|
||||||
|
|
||||||
this->Select();
|
this->Select();
|
||||||
RebuildMusicWheelItems();
|
RebuildMusicWheelItems();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_iSelection = rand() % m_CurWheelItemData.size();
|
||||||
|
m_fPositionOffsetFromSelection = 0;
|
||||||
|
m_WheelState = STATE_SELECTING_MUSIC;
|
||||||
|
m_soundStart.Play();
|
||||||
|
SCREENMAN->PostMessageToTopScreen( SM_SongChanged, 0 );
|
||||||
|
RebuildMusicWheelItems();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MusicWheel::SetOpenGroup(CString group, SongSortOrder so)
|
void MusicWheel::SetOpenGroup(CString group, SongSortOrder so)
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ PrefsManager::PrefsManager()
|
|||||||
|
|
||||||
m_iAttractSoundFrequency = 1;
|
m_iAttractSoundFrequency = 1;
|
||||||
m_bAllowExtraStage = true;
|
m_bAllowExtraStage = true;
|
||||||
|
m_bLockWheelAfterRandom = true;
|
||||||
m_fPadStickSeconds = 0;
|
m_fPadStickSeconds = 0;
|
||||||
g_bAutoRestart = false;
|
g_bAutoRestart = false;
|
||||||
m_bSignProfileData = false;
|
m_bSignProfileData = false;
|
||||||
@@ -491,6 +492,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk()
|
|||||||
ini.GetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY );
|
ini.GetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY );
|
||||||
ini.GetValue( "Options", "AttractSoundFrequency", m_iAttractSoundFrequency );
|
ini.GetValue( "Options", "AttractSoundFrequency", m_iAttractSoundFrequency );
|
||||||
ini.GetValue( "Options", "AllowExtraStage", m_bAllowExtraStage );
|
ini.GetValue( "Options", "AllowExtraStage", m_bAllowExtraStage );
|
||||||
|
ini.GetValue( "Options", "LockWheelAfterRandom", m_bLockWheelAfterRandom );
|
||||||
ini.GetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
|
ini.GetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
|
||||||
ini.GetValue( "Options", "AutoRestart", g_bAutoRestart );
|
ini.GetValue( "Options", "AutoRestart", g_bAutoRestart );
|
||||||
ini.GetValue( "Options", "SignProfileData", m_bSignProfileData );
|
ini.GetValue( "Options", "SignProfileData", m_bSignProfileData );
|
||||||
@@ -703,6 +705,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
|
|||||||
ini.SetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY );
|
ini.SetValue( "Options", "CenterImageScaleY", m_fCenterImageScaleY );
|
||||||
ini.SetValue( "Options", "AttractSoundFrequency", m_iAttractSoundFrequency );
|
ini.SetValue( "Options", "AttractSoundFrequency", m_iAttractSoundFrequency );
|
||||||
ini.SetValue( "Options", "AllowExtraStage", m_bAllowExtraStage );
|
ini.SetValue( "Options", "AllowExtraStage", m_bAllowExtraStage );
|
||||||
|
ini.SetValue( "Options", "LockWheelAfterRandom", m_bLockWheelAfterRandom );
|
||||||
ini.SetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
|
ini.SetValue( "Options", "PadStickSeconds", m_fPadStickSeconds );
|
||||||
ini.SetValue( "Options", "AutoRestart", g_bAutoRestart );
|
ini.SetValue( "Options", "AutoRestart", g_bAutoRestart );
|
||||||
ini.SetValue( "Options", "SignProfileData", m_bSignProfileData );
|
ini.SetValue( "Options", "SignProfileData", m_bSignProfileData );
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ public:
|
|||||||
float m_fCenterImageScaleY;
|
float m_fCenterImageScaleY;
|
||||||
int m_iAttractSoundFrequency; // 0 = never, 1 = every time
|
int m_iAttractSoundFrequency; // 0 = never, 1 = every time
|
||||||
bool m_bAllowExtraStage;
|
bool m_bAllowExtraStage;
|
||||||
|
bool m_bLockWheelAfterRandom;
|
||||||
|
|
||||||
// Number of seconds it takes for a button on the controller to release
|
// Number of seconds it takes for a button on the controller to release
|
||||||
// after pressed.
|
// after pressed.
|
||||||
|
|||||||
Reference in New Issue
Block a user