This commit is contained in:
2025-10-27 11:53:12 +01:00
parent 231dcd4b3b
commit 5d8811026d
69 changed files with 899 additions and 888 deletions
+8 -8
View File
@@ -13,21 +13,21 @@
#include "game/ui/notifier.hpp" // Para Notifier, NotificationText
#include "utils/utils.hpp" // Para stringInVector
namespace globalInputs {
namespace GlobalInputs {
void quit() {
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);
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
SceneManager::current = SceneManager::current == SceneManager::Scene::GAME ? SceneManager::Scene::TITLE : SceneManager::Scene::QUIT;
} else {
// Si la notificación de salir no está activa, muestra la notificación
Notifier::get()->show({code}, NotificationText::CENTER, 2000, -1, true, code);
Notifier::get()->show({CODE}, NotificationText::CENTER, 2000, -1, true, CODE);
}
}
// Cambia de seccion
void skip_section() {
void skipSection() {
switch (SceneManager::current) {
case SceneManager::Scene::LOGO:
case SceneManager::Scene::LOADING_SCREEN:
@@ -52,7 +52,7 @@ void check() {
}
else if (Input::get()->checkInput(InputAction::ACCEPT, INPUT_DO_NOT_ALLOW_REPEAT)) {
skip_section();
skipSection();
}
else if (Input::get()->checkInput(InputAction::TOGGLE_BORDER, INPUT_DO_NOT_ALLOW_REPEAT)) {
@@ -62,7 +62,7 @@ void check() {
else if (Input::get()->checkInput(InputAction::TOGGLE_VIDEOMODE, INPUT_DO_NOT_ALLOW_REPEAT)) {
Screen::get()->toggleVideoMode();
Notifier::get()->show({"FULLSCREEN " + std::string(Options::video.fullscreen == 0 ? "DISABLED" : "ENABLED")}, NotificationText::CENTER);
Notifier::get()->show({"FULLSCREEN " + std::string(static_cast<int>(Options::video.fullscreen) == 0 ? "DISABLED" : "ENABLED")}, NotificationText::CENTER);
}
else if (Input::get()->checkInput(InputAction::WINDOW_DEC_ZOOM, INPUT_DO_NOT_ALLOW_REPEAT)) {
@@ -102,4 +102,4 @@ void check() {
Screen::get()->toggleDebugInfo();
}
}
} // namespace globalInputs
} // namespace GlobalInputs