efa81bc: don't filter NoteSkins at a PrefsManager/NoteSkinManager level. Leave the NoteSkin sorting and filtering up to the theme. [Chris Danford]
ScreenWithMenuElements.cpp - add Cancel command, so actors can react to Cancel. GameState.cpp - cleanup
This commit is contained in:
@@ -741,7 +741,6 @@ void GameState::FinishStage()
|
||||
{
|
||||
// Increment the stage counter.
|
||||
const int iOldStageIndex = m_iCurrentStageIndex;
|
||||
|
||||
++m_iCurrentStageIndex;
|
||||
|
||||
m_iNumStagesOfThisSong = 0;
|
||||
|
||||
+2
-11
@@ -189,18 +189,9 @@ void NoteSkinManager::GetNoteSkinNames( vector<RString> &AddTo )
|
||||
GetNoteSkinNames( GAMESTATE->m_pCurGame, AddTo );
|
||||
}
|
||||
|
||||
void NoteSkinManager::GetNoteSkinNames( const Game* pGame, vector<RString> &AddTo, bool bFilterDefault )
|
||||
void NoteSkinManager::GetNoteSkinNames( const Game* pGame, vector<RString> &AddTo )
|
||||
{
|
||||
GetAllNoteSkinNamesForGame( pGame, AddTo );
|
||||
|
||||
/* Move "default" to the front if it exists. */
|
||||
vector<RString>::iterator iter = find( AddTo.begin(), AddTo.end(), GAME_BASE_NOTESKIN_NAME );
|
||||
if( iter != AddTo.end() )
|
||||
{
|
||||
AddTo.erase( iter );
|
||||
if( !bFilterDefault || !PREFSMAN->m_bHideDefaultNoteSkin )
|
||||
AddTo.insert( AddTo.begin(), GAME_BASE_NOTESKIN_NAME );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +216,7 @@ void NoteSkinManager::GetAllNoteSkinNamesForGame( const Game *pGame, vector<RStr
|
||||
{
|
||||
if( pGame == m_pCurGame )
|
||||
{
|
||||
/* Faster: */
|
||||
// Faster:
|
||||
for( map<RString,NoteSkinData>::const_iterator iter = g_mapNameToData.begin();
|
||||
iter != g_mapNameToData.end(); ++iter )
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
~NoteSkinManager();
|
||||
|
||||
void RefreshNoteSkinData( const Game* game );
|
||||
void GetNoteSkinNames( const Game* game, vector<RString> &AddTo, bool bFilterDefault=true );
|
||||
void GetNoteSkinNames( const Game* game, vector<RString> &AddTo );
|
||||
void GetNoteSkinNames( vector<RString> &AddTo ); // looks up current const Game* in GAMESTATE
|
||||
bool DoesNoteSkinExist( const RString &sNoteSkin ); // looks up current const Game* in GAMESTATE
|
||||
bool DoNoteSkinsExistForGame( const Game *pGame );
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ void OptionRow::LoadExit()
|
||||
|
||||
void OptionRow::ChoicesChanged( RowType type )
|
||||
{
|
||||
ASSERT( !m_pHand->m_Def.m_vsChoices.empty() );
|
||||
ASSERT_M( !m_pHand->m_Def.m_vsChoices.empty(), m_pHand->m_Def.m_sName + " has no choices" );
|
||||
|
||||
// Remove the NextRow marker before reloading choices
|
||||
if( m_pHand->m_Def.m_vsChoices[0] == NEXT_ROW_NAME )
|
||||
|
||||
@@ -239,7 +239,6 @@ PrefsManager::PrefsManager() :
|
||||
m_fCenterImageAddHeight ( "CenterImageAddHeight", 0 ),
|
||||
m_AttractSoundFrequency ( "AttractSoundFrequency", ASF_EVERY_TIME ),
|
||||
m_bAllowExtraStage ( "AllowExtraStage", true ),
|
||||
m_bHideDefaultNoteSkin ( "HideDefaultNoteSkin", false ),
|
||||
m_iMaxHighScoresPerListForMachine ( "MaxHighScoresPerListForMachine", 10 ),
|
||||
m_iMaxHighScoresPerListForPlayer ( "MaxHighScoresPerListForPlayer", 3 ),
|
||||
m_bAllowMultipleHighScoreWithSameName ( "AllowMultipleHighScoreWithSameName", true ),
|
||||
@@ -439,6 +438,7 @@ void PrefsManager::ReadGamePrefsFromIni( const RString &sIni )
|
||||
RString sGame = section->GetName().Right( section->GetName().length() - GAME_SECTION_PREFIX.length() );
|
||||
GamePrefs &gp = m_mapGameNameToGamePrefs[ sGame ];
|
||||
|
||||
// todo: read more prefs here? -aj
|
||||
ini.GetValue( section->GetName(), "Announcer", gp.m_sAnnouncer );
|
||||
ini.GetValue( section->GetName(), "Theme", gp.m_sTheme );
|
||||
ini.GetValue( section->GetName(), "DefaultModifiers", gp.m_sDefaultModifiers );
|
||||
@@ -486,6 +486,7 @@ void PrefsManager::SavePrefsToIni( IniFile &ini )
|
||||
{
|
||||
RString sSection = "Game-" + RString( iter->first );
|
||||
|
||||
// todo: write more values here? -aj
|
||||
ini.SetValue( sSection, "Announcer", iter->second.m_sAnnouncer );
|
||||
ini.SetValue( sSection, "Theme", iter->second.m_sTheme );
|
||||
ini.SetValue( sSection, "DefaultModifiers", iter->second.m_sDefaultModifiers );
|
||||
|
||||
@@ -225,7 +225,6 @@ public:
|
||||
Preference<int> m_fCenterImageAddHeight;
|
||||
Preference<AttractSoundFrequency> m_AttractSoundFrequency;
|
||||
Preference<bool> m_bAllowExtraStage;
|
||||
Preference<bool> m_bHideDefaultNoteSkin;
|
||||
Preference<int> m_iMaxHighScoresPerListForMachine;
|
||||
Preference<int> m_iMaxHighScoresPerListForPlayer;
|
||||
Preference<bool> m_bAllowMultipleHighScoreWithSameName;
|
||||
|
||||
@@ -313,6 +313,8 @@ void ScreenWithMenuElements::Cancel( ScreenMessage smSendWhenDone )
|
||||
return;
|
||||
}
|
||||
|
||||
this->PlayCommand( "Cancel" );
|
||||
|
||||
if( m_Cancel.IsTransitioning() )
|
||||
return; // ignore
|
||||
|
||||
|
||||
Reference in New Issue
Block a user