mes comandos en Console

This commit is contained in:
2026-03-28 13:37:46 +01:00
parent ea421b4e17
commit 637df23bc7

View File

@@ -14,6 +14,7 @@
#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
@@ -98,7 +99,7 @@ static void printHelp() {
SDL_Log(" SCENE [LOGO|LOADING|TITLE|CREDITS|GAME|ENDING|ENDING2|RESTART]");
SDL_Log(" KIOSK [ON] Enable kiosk mode");
SDL_Log(" EXIT / QUIT Quit application");
SDL_Log(" SHOW [FPS|INFO|NOTIFICATION] Show debug overlay or test notification");
SDL_Log(" SHOW [FPS|INFO|NOTIFICATION|CHEEVO] Show debug overlay or test notification");
SDL_Log(" HIDE [FPS|INFO] Hide debug overlay");
SDL_Log(" HELP/? Show this help in terminal");
}
@@ -327,13 +328,17 @@ static const std::vector<ConsoleCommand> COMMANDS = {
return std::string("Debug mode ") + (Debug::get()->isEnabled() ? "ON" : "OFF");
}},
// SHOW FPS / SHOW INFO / SHOW NOTIFICATION / HIDE FPS / HIDE INFO
// SHOW FPS / SHOW INFO / SHOW NOTIFICATION / SHOW CHEEVO / HIDE FPS / HIDE INFO
{.keyword = "SHOW", .execute = [](const std::vector<std::string>& args) -> std::string {
if (!args.empty() && args[0] == "NOTIFICATION") {
Notifier::get()->show({"NOTIFICATION"});
return "Notification shown";
}
if (args.empty() || (args[0] != "FPS" && args[0] != "INFO")) { return "Usage: SHOW [FPS|INFO|NOTIFICATION]"; }
if (!args.empty() && args[0] == "CHEEVO") {
Notifier::get()->show({Locale::get()->get("achievements.header"), Locale::get()->get("achievements.c1")}, Notifier::Style::CHEEVO, -1, false); // NOLINT(readability-static-accessed-through-instance)
return "Cheevo notification shown";
}
if (args.empty() || (args[0] != "FPS" && args[0] != "INFO")) { return "Usage: SHOW [FPS|INFO|NOTIFICATION|CHEEVO]"; }
if (RenderInfo::get()->isActive()) { return "Info overlay already ON"; }
RenderInfo::get()->toggle();
return "Info overlay ON";