Add native restart menu button
It should replace Simply Love restart hack. Now it is possible to assign any button to restart.
This commit is contained in:
committed by
teejusb
parent
7cf2501214
commit
705cd55a04
@@ -729,6 +729,13 @@ bool ScreenEvaluation::Input( const InputEventPlus &input )
|
||||
if( IsTransitioning() )
|
||||
return false;
|
||||
|
||||
if (input.MenuI == GAME_BUTTON_RESTART && input.type == IET_FIRST_PRESS &&
|
||||
GAMESTATE->IsEventMode() && !GAMESTATE->IsCourseMode())
|
||||
{
|
||||
return MenuRestart(input);
|
||||
}
|
||||
|
||||
|
||||
if( input.GameI.IsValid() )
|
||||
{
|
||||
if( CodeDetector::EnteredCode(input.GameI.controller, CODE_SAVE_SCREENSHOT1) ||
|
||||
@@ -795,6 +802,16 @@ bool ScreenEvaluation::MenuStart( const InputEventPlus &input )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScreenEvaluation::MenuRestart( const InputEventPlus &input )
|
||||
{
|
||||
if( IsTransitioning() )
|
||||
return false;
|
||||
|
||||
SCREENMAN->GetTopScreen()->SetNextScreenName("ScreenGameplay");
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScreenEvaluation::HandleMenuStart()
|
||||
{
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
|
||||
Reference in New Issue
Block a user