les tecles de funcio ja tornena a funcionar amb la consola oberta

This commit is contained in:
2026-03-28 14:03:41 +01:00
parent ed21a47f92
commit 854a5f04b2
4 changed files with 35 additions and 17 deletions

View File

@@ -8,13 +8,13 @@
#include <vector> // Para vector
#include "core/audio/audio.hpp" // Para Audio
#include "core/locale/locale.hpp" // Para Locale
#include "core/rendering/render_info.hpp" // Para RenderInfo
#include "core/rendering/screen.hpp" // Para Screen
#include "core/rendering/sprite/sprite.hpp" // Para Sprite
#include "core/rendering/surface.hpp" // Para Surface
#include "core/rendering/text.hpp" // Para Text
#include "core/resources/resource_cache.hpp" // Para Resource
#include "core/locale/locale.hpp" // Para Locale
#include "game/options.hpp" // Para Options
#include "game/scene_manager.hpp" // Para SceneManager
#include "game/ui/notifier.hpp" // Para Notifier
@@ -97,6 +97,7 @@ static void printHelp() {
SDL_Log(" MUSIC [ON|OFF|VOL <0-100>] Music volume");
SDL_Log(" SOUND [ON|OFF|VOL <0-100>] Sound volume");
SDL_Log(" SCENE [LOGO|LOADING|TITLE|CREDITS|GAME|ENDING|ENDING2|RESTART]");
SDL_Log(" SIZE Window size in pixels");
SDL_Log(" KIOSK [ON] Enable kiosk mode");
SDL_Log(" EXIT / QUIT Quit application");
SDL_Log(" SHOW [FPS|INFO|NOTIFICATION|CHEEVO] Show debug overlay or test notification");
@@ -355,7 +356,9 @@ static const std::vector<ConsoleCommand> COMMANDS = {
if (SceneManager::current != SceneManager::Scene::GAME) { return "Only available in GAME scene"; }
if (args.empty()) { return "Usage: ROOM <1-60>"; }
int num = 0;
try { num = std::stoi(args[0]); } catch (...) { return "Usage: ROOM <1-60>"; }
try {
num = std::stoi(args[0]);
} catch (...) { return "Usage: ROOM <1-60>"; }
if (num < 1 || num > 60) { return "Room must be between 1 and 60"; }
char buf[16];
std::snprintf(buf, sizeof(buf), "%02d.yaml", num);
@@ -602,6 +605,14 @@ static const std::vector<ConsoleCommand> COMMANDS = {
return "Quitting...";
}},
// SIZE — Devuelve el tamaño actual de la ventana en píxeles
{.keyword = "SIZE", .execute = [](const std::vector<std::string>&) -> std::string {
int w = 0;
int h = 0;
SDL_GetWindowSize(SDL_GetRenderWindow(Screen::get()->getRenderer()), &w, &h);
return std::to_string(w) + "x" + std::to_string(h);
}},
// HELP / ? — Muestra ayuda en la terminal del sistema
{.keyword = "HELP", .execute = [](const std::vector<std::string>&) -> std::string {
printHelp();