implementada la opció del mode quiosco

This commit is contained in:
2026-03-08 09:42:00 +01:00
parent a8240a5d82
commit e7860c697e
2 changed files with 26 additions and 13 deletions

View File

@@ -21,20 +21,32 @@ namespace GlobalInputs {
// Funciones internas // Funciones internas
namespace { namespace {
void handleQuit() { void handleQuit() {
const std::string CODE = SceneManager::current == SceneManager::Scene::GAME ? "PRESS AGAIN TO RETURN TO MENU" : "PRESS AGAIN TO EXIT"; // En la escena GAME el comportamiento es siempre el mismo (con o sin modo kiosko)
auto code_found = stringInVector(Notifier::get()->getCodes(), CODE); if (SceneManager::current == SceneManager::Scene::GAME) {
if (code_found) { const std::string CODE = "PRESS AGAIN TO RETURN TO MENU";
// Si la notificación de salir está activa, cambia de sección if (stringInVector(Notifier::get()->getCodes(), CODE)) {
switch (SceneManager::current) { SceneManager::current = SceneManager::Scene::TITLE;
case SceneManager::Scene::GAME: } else {
SceneManager::current = SceneManager::Scene::TITLE; Notifier::get()->show({CODE}, Notifier::Style::DEFAULT, -1, true, CODE);
break;
default:
SceneManager::current = SceneManager::Scene::QUIT;
break;
} }
return;
}
// En modo kiosko, fuera de GAME: mostrar el texto del kiosko y no salir nunca
if (Options::kiosk.enabled) {
const std::string KIOSK_CODE = "KIOSK_EXIT";
if (!stringInVector(Notifier::get()->getCodes(), KIOSK_CODE)) {
Notifier::get()->show({Options::kiosk.text}, Notifier::Style::DEFAULT, -1, true, KIOSK_CODE);
}
// Segunda pulsación: notificación ya activa → no hacer nada
return;
}
// Comportamiento normal fuera del modo kiosko
const std::string CODE = "PRESS AGAIN TO EXIT";
if (stringInVector(Notifier::get()->getCodes(), CODE)) {
SceneManager::current = SceneManager::Scene::QUIT;
} else { } else {
// Si la notificación de salir no está activa, muestra la notificación
Notifier::get()->show({CODE}, Notifier::Style::DEFAULT, -1, true, CODE); Notifier::get()->show({CODE}, Notifier::Style::DEFAULT, -1, true, CODE);
} }
} }

View File

@@ -640,7 +640,8 @@ void Game::killPlayer() {
} }
// Resta una vida al jugador // Resta una vida al jugador
if (Options::cheats.infinite_lives == Options::Cheat::State::DISABLED) { if (Options::cheats.infinite_lives == Options::Cheat::State::DISABLED &&
!(Options::kiosk.enabled && Options::kiosk.infinite_lives)) {
--scoreboard_data_->lives; --scoreboard_data_->lives;
} }