merdes varies

This commit is contained in:
2025-11-08 13:21:59 +01:00
parent 85d34fb907
commit 1f01268dcf
8 changed files with 47 additions and 26 deletions
+18
View File
@@ -12,6 +12,10 @@
#include "game/ui/notifier.hpp" // Para Notifier, NotificationText
#include "utils/utils.hpp" // Para stringInVector
#ifdef _DEBUG
#include "core/system/debug.hpp" // Para Debug
#endif
namespace GlobalInputs {
// Funciones internas
@@ -101,10 +105,17 @@ void handleToggleVSync() {
Notifier::get()->show({"V-SYNC " + std::string(Options::video.vertical_sync ? "ENABLED" : "DISABLED")}, NotificationText::CENTER);
}
#ifdef _DEBUG
void handleShowDebugInfo() {
Screen::get()->toggleDebugInfo();
}
void handleToggleDebug() {
Debug::get()->toggleEnabled();
Notifier::get()->show({"DEBUG " + std::string(Debug::get()->getEnabled() ? "ENABLED" : "DISABLED")}, NotificationText::CENTER);
}
#endif
// Detecta qué acción global ha sido presionada (si alguna)
auto getPressedAction() -> InputAction {
if (Input::get()->checkAction(InputAction::EXIT, Input::DO_NOT_ALLOW_REPEAT)) {
@@ -140,6 +151,9 @@ auto getPressedAction() -> InputAction {
if (Input::get()->checkAction(InputAction::TOGGLE_VSYNC, Input::DO_NOT_ALLOW_REPEAT)) {
return InputAction::TOGGLE_VSYNC;
}
if (Input::get()->checkAction(InputAction::TOGGLE_DEBUG, Input::DO_NOT_ALLOW_REPEAT)) {
return InputAction::TOGGLE_DEBUG;
}
if (Input::get()->checkAction(InputAction::SHOW_DEBUG_INFO, Input::DO_NOT_ALLOW_REPEAT)) {
return InputAction::SHOW_DEBUG_INFO;
}
@@ -201,6 +215,10 @@ void handle() {
handleToggleVSync();
break;
case InputAction::TOGGLE_DEBUG:
handleToggleDebug();
break;
case InputAction::SHOW_DEBUG_INFO:
handleShowDebugInfo();
break;