Afegida confirmació per eixir del joc

This commit is contained in:
2024-09-25 09:19:12 +02:00
parent 2f152915ed
commit 6ad1bca29f
14 changed files with 156 additions and 16 deletions

View File

@@ -196,8 +196,7 @@ void Intro::checkInput()
// Comprueba si se sale con el teclado
if (input->checkInput(input_exit, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
{
section->name = SECTION_PROG_QUIT;
section->options = SECTION_OPTIONS_QUIT_NORMAL;
quit(SECTION_OPTIONS_QUIT_NORMAL);
return;
}
@@ -209,9 +208,16 @@ void Intro::checkInput()
section->options = SECTION_OPTIONS_TITLE_1;
return;
}
for (int i = 0; i < input->getNumControllers(); ++i)
{
{
// Comprueba si se sale con el mando
if (input->checkModInput(input_service, input_exit, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
{
quit(SECTION_OPTIONS_QUIT_SHUTDOWN);
return;
}
// Comprueba si se va a resetear el juego
if (input->checkModInput(input_service, input_reset, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
{
@@ -455,3 +461,17 @@ void Intro::run()
render();
}
}
// Termina
void Intro::quit(int code)
{
if (screen->notificationsAreActive())
{
section->name = SECTION_PROG_QUIT;
section->options = code;
}
else
{
screen->showNotification("Torna a polsar per eixir");
}
}