implementada la opció del mode quiosco
This commit is contained in:
@@ -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:
|
||||
// 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;
|
||||
break;
|
||||
default:
|
||||
SceneManager::current = SceneManager::Scene::QUIT;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Si la notificación de salir no está activa, muestra la notificación
|
||||
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 {
|
||||
Notifier::get()->show({CODE}, Notifier::Style::DEFAULT, -1, true, CODE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user