Created GameLoop::ChangeGame analogous to GameLoop::ChangeTheme. Changed ChangeTheme to use the AfterThemeChangeScreen metric instead of a passed in screen name from the theme being changed away from. ChangeGame uses the AfterGameChangeScreen and AfterGameAndThemeChangeScreen metrics to pick the screen to load after the change. New metrics are optional and default to InitialScreen. Changed ScreenManager::ThemeChanged to not duplicate the code in ReloadOverlayScreens. Fixed ScreenManager::IsScreenNameValid to check with HasMetric before using GetMetric. Changed game ConfOption logic to set the preference and work in a similar way to the theme ConfOption. Added THEME:SetTheme lua function.

This commit is contained in:
Kyzentun
2014-07-20 20:59:12 -06:00
committed by Jonathan Payne
parent 5828b2529b
commit 9b08ab5b52
13 changed files with 173 additions and 80 deletions
+3 -1
View File
@@ -54,10 +54,12 @@ bool ScreenTitleMenu::Input( const InputEventPlus &input )
if( input.type == IET_FIRST_PRESS )
{
// detect codes
// Theme changing pad codes are marked as deprecated in _fallback's
// metrics.ini, remove them after SM5? -Kyz
if( CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_THEME) ||
CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_THEME2) )
{
GameLoop::ChangeTheme( THEME->GetNextSelectableTheme(), m_sName );
GameLoop::ChangeTheme(THEME->GetNextSelectableTheme());
bHandled = true;
}
if( CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_ANNOUNCER) ||