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

@@ -107,8 +107,7 @@ void Logo::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;
}
@@ -126,8 +125,7 @@ void Logo::checkInput()
// Comprueba si se sale con el mando
if (input->checkModInput(input_service, input_exit, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
{
section->name = SECTION_PROG_QUIT;
section->options = SECTION_OPTIONS_QUIT_SHUTDOWN;
quit(SECTION_OPTIONS_QUIT_SHUTDOWN);
return;
}
@@ -335,4 +333,18 @@ void Logo::run()
checkEvents(); // Tiene que ir antes del render
render();
}
}
// Termina
void Logo::quit(int code)
{
if (screen->notificationsAreActive())
{
section->name = SECTION_PROG_QUIT;
section->options = code;
}
else
{
screen->showNotification("Torna a polsar per eixir");
}
}