add switch game code
This commit is contained in:
@@ -1823,7 +1823,11 @@ HoldNotes=Right,Left,Down,Up
|
|||||||
Dark=
|
Dark=
|
||||||
CancelAll=Left,Right,Left,Right,Left,Right,Left,Right
|
CancelAll=Left,Right,Left,Right,Left,Right,Left,Right
|
||||||
NextTheme=Left,Left,Left,Right,Right,Right,Left,Right
|
NextTheme=Left,Left,Left,Right,Right,Right,Left,Right
|
||||||
|
NextTheme2=MenuLeft,MenuLeft,MenuLeft,MenuRight,MenuRight,MenuRight,MenuLeft,MenuRight
|
||||||
NextAnnouncer=Left,Left,Right,Right,Left,Left,Right,Right
|
NextAnnouncer=Left,Left,Right,Right,Left,Left,Right,Right
|
||||||
|
NextAnnouncer2=MenuLeft,MenuLeft,MenuRight,MenuRight,MenuLeft,MenuLeft,MenuRight,MenuRight
|
||||||
|
NextGame=Left,Right,Left,Left,Right,Right,Left,Right
|
||||||
|
NextGame2=MenuLeft,MenuRight,MenuLeft,MenuLeft,MenuRight,MenuRight,MenuLeft,MenuRight
|
||||||
NextBannerGroup=MenuUp,MenuRight,MenuRight
|
NextBannerGroup=MenuUp,MenuRight,MenuRight
|
||||||
NextBannerGroup2=MenuUp,MenuDown,MenuUp,MenuDown
|
NextBannerGroup2=MenuUp,MenuDown,MenuUp,MenuDown
|
||||||
Hidden=
|
Hidden=
|
||||||
|
|||||||
@@ -47,7 +47,11 @@ const CString g_sCodeNames[CodeDetector::NUM_CODES] = {
|
|||||||
"RandomVanish",
|
"RandomVanish",
|
||||||
"CancelAll",
|
"CancelAll",
|
||||||
"NextTheme",
|
"NextTheme",
|
||||||
|
"NextTheme2",
|
||||||
"NextAnnouncer",
|
"NextAnnouncer",
|
||||||
|
"NextAnnouncer2",
|
||||||
|
"NextGame",
|
||||||
|
"NextGame2",
|
||||||
"NextBannerGroup",
|
"NextBannerGroup",
|
||||||
"NextBannerGroup2"
|
"NextBannerGroup2"
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ public:
|
|||||||
CODE_RANDOMVANISH,
|
CODE_RANDOMVANISH,
|
||||||
CODE_CANCEL_ALL,
|
CODE_CANCEL_ALL,
|
||||||
CODE_NEXT_THEME,
|
CODE_NEXT_THEME,
|
||||||
|
CODE_NEXT_THEME2,
|
||||||
CODE_NEXT_ANNOUNCER,
|
CODE_NEXT_ANNOUNCER,
|
||||||
|
CODE_NEXT_ANNOUNCER2,
|
||||||
|
CODE_NEXT_GAME,
|
||||||
|
CODE_NEXT_GAME2,
|
||||||
CODE_BW_NEXT_GROUP,
|
CODE_BW_NEXT_GROUP,
|
||||||
CODE_BW_NEXT_GROUP2,
|
CODE_BW_NEXT_GROUP2,
|
||||||
NUM_CODES // leave this at the end
|
NUM_CODES // leave this at the end
|
||||||
|
|||||||
@@ -1688,6 +1688,13 @@ void GameManager::GetEnabledGames( vector<Game>& aGamesOut )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GameManager::IsGameEnabled( Game game )
|
||||||
|
{
|
||||||
|
vector<Game> aGames;
|
||||||
|
GetEnabledGames( aGames );
|
||||||
|
return find( aGames.begin(), aGames.end(), game ) != aGames.end();
|
||||||
|
}
|
||||||
|
|
||||||
int GameManager::NotesTypeToNumTracks( StepsType nt )
|
int GameManager::NotesTypeToNumTracks( StepsType nt )
|
||||||
{
|
{
|
||||||
if(nt >= NUM_STEPS_TYPES)
|
if(nt >= NUM_STEPS_TYPES)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public:
|
|||||||
Style GetEditorStyleForNotesType( StepsType nt );
|
Style GetEditorStyleForNotesType( StepsType nt );
|
||||||
|
|
||||||
void GetEnabledGames( vector<Game>& aGamesOut );
|
void GetEnabledGames( vector<Game>& aGamesOut );
|
||||||
|
bool IsGameEnabled( Game game );
|
||||||
|
|
||||||
static int NotesTypeToNumTracks( StepsType nt );
|
static int NotesTypeToNumTracks( StepsType nt );
|
||||||
static StepsType StringToNotesType( CString sNotesType );
|
static StepsType StringToNotesType( CString sNotesType );
|
||||||
|
|||||||
@@ -272,7 +272,8 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty
|
|||||||
}
|
}
|
||||||
|
|
||||||
// detect codes
|
// detect codes
|
||||||
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME) )
|
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME) ||
|
||||||
|
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_THEME2) )
|
||||||
{
|
{
|
||||||
THEME->NextTheme();
|
THEME->NextTheme();
|
||||||
ApplyGraphicOptions(); // update window title and icon
|
ApplyGraphicOptions(); // update window title and icon
|
||||||
@@ -280,7 +281,8 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty
|
|||||||
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
||||||
TEXTUREMAN->DoDelayedDelete();
|
TEXTUREMAN->DoDelayedDelete();
|
||||||
}
|
}
|
||||||
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER) )
|
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER) ||
|
||||||
|
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_ANNOUNCER2) )
|
||||||
{
|
{
|
||||||
ANNOUNCER->NextAnnouncer();
|
ANNOUNCER->NextAnnouncer();
|
||||||
CString sName = ANNOUNCER->GetCurAnnouncerName();
|
CString sName = ANNOUNCER->GetCurAnnouncerName();
|
||||||
@@ -288,6 +290,20 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty
|
|||||||
SCREENMAN->SystemMessage( "Announcer: "+sName );
|
SCREENMAN->SystemMessage( "Announcer: "+sName );
|
||||||
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
||||||
}
|
}
|
||||||
|
if( CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME) ||
|
||||||
|
CodeDetector::EnteredCode(GameI.controller,CodeDetector::CODE_NEXT_GAME2) )
|
||||||
|
{
|
||||||
|
for( int i=0; i<NUM_GAMES; i++ )
|
||||||
|
{
|
||||||
|
GAMESTATE->m_CurGame = (Game)(GAMESTATE->m_CurGame+1);
|
||||||
|
wrap( (int&)GAMESTATE->m_CurGame, NUM_GAMES );
|
||||||
|
|
||||||
|
if( GAMEMAN->IsGameEnabled(GAMESTATE->m_CurGame) )
|
||||||
|
break; // found the first enabled game. Stop searching.
|
||||||
|
}
|
||||||
|
SCREENMAN->SystemMessage( ssprintf("Game: %s",GAMESTATE->GetCurrentGameDef()->m_szName) );
|
||||||
|
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
||||||
|
}
|
||||||
// Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
// Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user