From e7860c697e66d76b44a63e202b5833546a08c3f7 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sun, 8 Mar 2026 09:42:00 +0100 Subject: [PATCH] =?UTF-8?q?implementada=20la=20opci=C3=B3=20del=20mode=20q?= =?UTF-8?q?uiosco?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/core/input/global_inputs.cpp | 36 +++++++++++++++++++---------- source/game/scenes/game.cpp | 3 ++- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/source/core/input/global_inputs.cpp b/source/core/input/global_inputs.cpp index f0a3a90..110d77d 100644 --- a/source/core/input/global_inputs.cpp +++ b/source/core/input/global_inputs.cpp @@ -21,20 +21,32 @@ namespace GlobalInputs { // Funciones internas namespace { void handleQuit() { - const std::string CODE = SceneManager::current == SceneManager::Scene::GAME ? "PRESS AGAIN TO RETURN TO MENU" : "PRESS AGAIN TO EXIT"; - auto code_found = stringInVector(Notifier::get()->getCodes(), CODE); - if (code_found) { - // Si la notificación de salir está activa, cambia de sección - switch (SceneManager::current) { - case SceneManager::Scene::GAME: - SceneManager::current = SceneManager::Scene::TITLE; - break; - default: - SceneManager::current = SceneManager::Scene::QUIT; - break; + // En la escena GAME el comportamiento es siempre el mismo (con o sin modo kiosko) + if (SceneManager::current == SceneManager::Scene::GAME) { + const std::string CODE = "PRESS AGAIN TO RETURN TO MENU"; + if (stringInVector(Notifier::get()->getCodes(), CODE)) { + SceneManager::current = SceneManager::Scene::TITLE; + } else { + Notifier::get()->show({CODE}, Notifier::Style::DEFAULT, -1, true, CODE); } + 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 { - // Si la notificación de salir no está activa, muestra la notificación Notifier::get()->show({CODE}, Notifier::Style::DEFAULT, -1, true, CODE); } } diff --git a/source/game/scenes/game.cpp b/source/game/scenes/game.cpp index e48e5b0..075b3a2 100644 --- a/source/game/scenes/game.cpp +++ b/source/game/scenes/game.cpp @@ -640,7 +640,8 @@ void Game::killPlayer() { } // 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; }