Fix overriding fail mode.

This commit is contained in:
Glenn Maynard
2003-06-23 07:27:51 +00:00
parent 088c6b4ca0
commit 77dd9b9080
4 changed files with 25 additions and 29 deletions
+1
View File
@@ -59,6 +59,7 @@ void GameState::Reset()
// m_iCoins = 0; // don't reset coin count!
m_MasterPlayerNumber = PLAYER_INVALID;
m_sPreferredGroup = GROUP_ALL_MUSIC;
m_bChangedFailMode = false;
for( p=0; p<NUM_PLAYERS; p++ )
m_PreferredDifficulty[p] = DIFFICULTY_INVALID;
m_SongSortOrder = SORT_PREFERRED;
+1
View File
@@ -99,6 +99,7 @@ public:
CString m_sLoadingMessage; // used in loading screen
CString m_sPreferredGroup; // GROUP_ALL_MUSIC denotes no preferred group
bool m_bChangedFailMode; // true if the fail mode was changed in the song options screen
Difficulty m_PreferredDifficulty[NUM_PLAYERS];
SongSortOrder m_SongSortOrder; // used by MusicWheel
bool m_bEditing; // NoteField does special stuff when this is true
+17 -28
View File
@@ -521,36 +521,25 @@ void ScreenSelectMusic::AdjustOptions()
dc = min(dc, GAMESTATE->m_pCurNotes[p]->GetDifficulty());
}
/* This can still interfere a bit with the song options menu; eg. if a
* player changes to a mode easier than the preference setting, we might
* reset it to the preference later. XXX */
LOG->Trace( "AdjustOptions: difficulty %i", dc );
if( !GAMESTATE->m_bChangedFailMode )
{
GAMESTATE->m_SongOptions.m_FailType = SongOptions::FAIL_ARCADE;
/* Never set the FailType harder than the preference. */
SongOptions::FailType ft = SongOptions::FAIL_ARCADE;
/* Easy and beginner are never harder than FAIL_END_OF_SONG. */
if(dc <= DIFFICULTY_EASY)
{
LOG->Trace( "AdjustOptions: EOS" );
GAMESTATE->m_SongOptions.m_FailType = SongOptions::FAIL_END_OF_SONG;
}
/* Easy and beginner are never harder than FAIL_END_OF_SONG. */
if(dc <= DIFFICULTY_EASY)
ft = SongOptions::FAIL_END_OF_SONG;
/* If beginner's steps were chosen, and this is the first stage,
* turn off failure completely--always give a second try. */
if(dc == DIFFICULTY_BEGINNER &&
PREFSMAN->m_bEventMode && /* stage index is meaningless in event mode */
GAMESTATE->m_iCurrentStageIndex == 0)
ft = SongOptions::FAIL_OFF;
// Redundant. -Chris
// else if(GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2())
// {
// /* Extra stage. We need to make sure we undo any changes above from
// * previous rounds; eg. where one player is on beginner and the other
// * is on hard, we've changed the fail mode in previous rounds and we
// * want to reset it for the extra stage.
// *
// * Besides, extra stage should probably always be FAIL_ARCADE anyway,
// * unless the extra stage course says otherwise. */
// ft = SongOptions::FAIL_ARCADE;
// }
GAMESTATE->m_SongOptions.m_FailType = max( ft, GAMESTATE->m_SongOptions.m_FailType );
/* If beginner's steps were chosen, and this is the first stage,
* turn off failure completely--always give a second try. */
if(dc == DIFFICULTY_BEGINNER &&
!PREFSMAN->m_bEventMode && /* stage index is meaningless in event mode */
GAMESTATE->m_iCurrentStageIndex == 0)
GAMESTATE->m_SongOptions.m_FailType = SongOptions::FAIL_OFF;
}
}
void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
+6 -1
View File
@@ -101,7 +101,12 @@ void ScreenSongOptions::ExportOptions()
so.m_LifeType = (SongOptions::LifeType)m_iSelectedOption[0][SO_LIFE];
so.m_DrainType = (SongOptions::DrainType)m_iSelectedOption[0][SO_DRAIN];
so.m_iBatteryLives = m_iSelectedOption[0][SO_BAT_LIVES]+1;
so.m_FailType = (SongOptions::FailType)m_iSelectedOption[0][SO_FAIL];
if( so.m_FailType != (SongOptions::FailType)m_iSelectedOption[0][SO_FAIL] )
{
/* The user is changing the fail mode explicitly; stop messing with it. */
GAMESTATE->m_bChangedFailMode = true;
so.m_FailType = (SongOptions::FailType)m_iSelectedOption[0][SO_FAIL];
}
so.m_bAssistTick = !!m_iSelectedOption[0][SO_ASSIST];
so.m_bAutoSync = !!m_iSelectedOption[0][SO_AUTOSYNC];