forked from jaildesigner-jailgames/jaildoctors_dilemma
corregit el case en algunes respostes de console
This commit is contained in:
@@ -202,11 +202,11 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
}
|
}
|
||||||
return "usage: ss [on|off|size|upscale [nearest|linear]|downscale [bilinear|lanczos2|lanczos3]]";
|
return "usage: ss [on|off|size|upscale [nearest|linear]|downscale [bilinear|lanczos2|lanczos3]]";
|
||||||
},
|
},
|
||||||
.completions = {
|
.completions = {
|
||||||
{"SS", {"ON", "OFF", "SIZE", "UPSCALE", "DOWNSCALE"}},
|
{"SS", {"ON", "OFF", "SIZE", "UPSCALE", "DOWNSCALE"}},
|
||||||
{"SS UPSCALE", {"NEAREST", "LINEAR"}},
|
{"SS UPSCALE", {"NEAREST", "LINEAR"}},
|
||||||
{"SS DOWNSCALE", {"BILINEAR", "LANCZOS2", "LANCZOS3"}},
|
{"SS DOWNSCALE", {"BILINEAR", "LANCZOS2", "LANCZOS3"}},
|
||||||
}},
|
}},
|
||||||
|
|
||||||
// SHADER [ON|OFF|NEXT [PRESET]|POSTFX|CRTPI] — Toggle/cicla/selecciona shader (F4 / Shift+F4)
|
// SHADER [ON|OFF|NEXT [PRESET]|POSTFX|CRTPI] — Toggle/cicla/selecciona shader (F4 / Shift+F4)
|
||||||
{.keyword = "SHADER", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "SHADER", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -226,11 +226,11 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
}
|
}
|
||||||
if (args[0] == "POSTFX") {
|
if (args[0] == "POSTFX") {
|
||||||
Screen::get()->setActiveShader(Rendering::ShaderType::POSTFX);
|
Screen::get()->setActiveShader(Rendering::ShaderType::POSTFX);
|
||||||
return "Shader: POSTFX";
|
return "Shader: PostFX";
|
||||||
}
|
}
|
||||||
if (args[0] == "CRTPI") {
|
if (args[0] == "CRTPI") {
|
||||||
Screen::get()->setActiveShader(Rendering::ShaderType::CRTPI);
|
Screen::get()->setActiveShader(Rendering::ShaderType::CRTPI);
|
||||||
return "Shader: CRTPI";
|
return "Shader: CrtPi";
|
||||||
}
|
}
|
||||||
if (args[0] == "NEXT") {
|
if (args[0] == "NEXT") {
|
||||||
// SHADER NEXT PRESET → cicla presets del shader activo
|
// SHADER NEXT PRESET → cicla presets del shader activo
|
||||||
@@ -252,21 +252,20 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
return "PostFX preset: " +
|
return "PostFX preset: " +
|
||||||
Options::postfx_presets[static_cast<size_t>(Options::current_postfx_preset)].name;
|
Options::postfx_presets[static_cast<size_t>(Options::current_postfx_preset)].name;
|
||||||
}
|
}
|
||||||
// SHADER NEXT → cicla entre tipos de shader (POSTFX ↔ CRTPI)
|
// SHADER NEXT → cicla entre tipos de shader (PostFX ↔ CrtPi)
|
||||||
Screen::get()->nextShader();
|
Screen::get()->nextShader();
|
||||||
return std::string("Shader: ") +
|
return std::string("Shader: ") +
|
||||||
(Options::current_shader == Rendering::ShaderType::CRTPI ? "CRTPI" : "POSTFX");
|
(Options::current_shader == Rendering::ShaderType::CRTPI ? "CrtPi" : "PostFX");
|
||||||
}
|
}
|
||||||
return "usage: shader [on|off|next [preset]|postfx|crtpi]";
|
return "usage: shader [on|off|next [preset]|postfx|crtpi]";
|
||||||
},
|
},
|
||||||
.completions = {
|
.completions = {
|
||||||
{"SHADER", {"ON", "OFF", "NEXT", "POSTFX", "CRTPI"}},
|
{"SHADER", {"ON", "OFF", "NEXT", "POSTFX", "CRTPI"}},
|
||||||
{"SHADER NEXT", {"PRESET"}},
|
{"SHADER NEXT", {"PRESET"}},
|
||||||
}},
|
}},
|
||||||
|
|
||||||
// BORDER [ON|OFF] — Borde decorativo (B)
|
// BORDER [ON|OFF] — Borde decorativo (B)
|
||||||
{.keyword = "BORDER", .execute = BOOL_TOGGLE_CMD("Border", Options::video.border.enabled, Screen::get()->toggleBorder()),
|
{.keyword = "BORDER", .execute = BOOL_TOGGLE_CMD("Border", Options::video.border.enabled, Screen::get()->toggleBorder()), .completions = {{"BORDER", {"ON", "OFF"}}}},
|
||||||
.completions = {{"BORDER", {"ON", "OFF"}}}},
|
|
||||||
|
|
||||||
// FULLSCREEN [ON|OFF [PLEASE]] — Pantalla completa (F3); OFF bloqueado en kiosk sin PLEASE
|
// FULLSCREEN [ON|OFF [PLEASE]] — Pantalla completa (F3); OFF bloqueado en kiosk sin PLEASE
|
||||||
{.keyword = "FULLSCREEN", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "FULLSCREEN", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -295,7 +294,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
}
|
}
|
||||||
return "usage: fullscreen [on|off]";
|
return "usage: fullscreen [on|off]";
|
||||||
},
|
},
|
||||||
.completions = {{"FULLSCREEN", {"ON", "OFF"}}}},
|
.completions = {{"FULLSCREEN", {"ON", "OFF"}}}},
|
||||||
|
|
||||||
// ZOOM UP/DOWN — Zoom de ventana (F1/F2)
|
// ZOOM UP/DOWN — Zoom de ventana (F1/F2)
|
||||||
{.keyword = "ZOOM", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "ZOOM", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -310,7 +309,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
}
|
}
|
||||||
return "usage: zoom [up|down]";
|
return "usage: zoom [up|down]";
|
||||||
},
|
},
|
||||||
.completions = {{"ZOOM", {"UP", "DOWN"}}}},
|
.completions = {{"ZOOM", {"UP", "DOWN"}}}},
|
||||||
|
|
||||||
// INTSCALE [ON|OFF] — Escalado entero (F7)
|
// INTSCALE [ON|OFF] — Escalado entero (F7)
|
||||||
{.keyword = "INTSCALE", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "INTSCALE", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -326,11 +325,10 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
Screen::get()->setVideoMode(Options::video.fullscreen);
|
Screen::get()->setVideoMode(Options::video.fullscreen);
|
||||||
return std::string("IntScale ") + (Options::video.integer_scale ? "ON" : "OFF");
|
return std::string("IntScale ") + (Options::video.integer_scale ? "ON" : "OFF");
|
||||||
},
|
},
|
||||||
.completions = {{"INTSCALE", {"ON", "OFF"}}}},
|
.completions = {{"INTSCALE", {"ON", "OFF"}}}},
|
||||||
|
|
||||||
// VSYNC [ON|OFF] — Sincronización vertical
|
// VSYNC [ON|OFF] — Sincronización vertical
|
||||||
{.keyword = "VSYNC", .execute = BOOL_TOGGLE_CMD("VSync", Options::video.vertical_sync, Screen::get()->toggleVSync()),
|
{.keyword = "VSYNC", .execute = BOOL_TOGGLE_CMD("VSync", Options::video.vertical_sync, Screen::get()->toggleVSync()), .completions = {{"VSYNC", {"ON", "OFF"}}}},
|
||||||
.completions = {{"VSYNC", {"ON", "OFF"}}}},
|
|
||||||
|
|
||||||
// DRIVER [LIST|AUTO|<nombre>] — Driver GPU (aplica en el próximo arranque)
|
// DRIVER [LIST|AUTO|<nombre>] — Driver GPU (aplica en el próximo arranque)
|
||||||
{.keyword = "DRIVER", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "DRIVER", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -387,23 +385,30 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
Options::saveToFile();
|
Options::saveToFile();
|
||||||
return "Driver: " + driver_lower + " (restart)";
|
return "Driver: " + driver_lower + " (restart)";
|
||||||
},
|
},
|
||||||
.completions = {{"DRIVER", {"LIST", "AUTO", "NONE"}}}},
|
.completions = {{"DRIVER", {"LIST", "AUTO", "NONE"}}}},
|
||||||
|
|
||||||
// PALETTE NEXT/PREV/<nombre> — Paleta de colores (F5/F6 o por nombre)
|
// PALETTE NEXT/PREV/<nombre> — Paleta de colores (F5/F6 o por nombre)
|
||||||
{.keyword = "PALETTE", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "PALETTE", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
|
const auto palName = []() -> std::string {
|
||||||
|
std::string name = Options::video.palette;
|
||||||
|
std::ranges::transform(name, name.begin(), ::tolower);
|
||||||
|
return name;
|
||||||
|
};
|
||||||
if (args.empty()) { return "usage: palette [next|prev|<name>]"; }
|
if (args.empty()) { return "usage: palette [next|prev|<name>]"; }
|
||||||
if (args[0] == "NEXT") {
|
if (args[0] == "NEXT") {
|
||||||
Screen::get()->nextPalette();
|
Screen::get()->nextPalette();
|
||||||
return "Palette: " + Options::video.palette;
|
return "Palette: " + palName();
|
||||||
}
|
}
|
||||||
if (args[0] == "PREV") {
|
if (args[0] == "PREV") {
|
||||||
Screen::get()->previousPalette();
|
Screen::get()->previousPalette();
|
||||||
return "Palette: " + Options::video.palette;
|
return "Palette: " + palName();
|
||||||
}
|
}
|
||||||
if (!Screen::get()->setPaletteByName(args[0])) {
|
if (!Screen::get()->setPaletteByName(args[0])) {
|
||||||
return "Unknown palette: " + args[0];
|
std::string arg_lower = args[0];
|
||||||
|
std::ranges::transform(arg_lower, arg_lower.begin(), ::tolower);
|
||||||
|
return "Unknown palette: " + arg_lower;
|
||||||
}
|
}
|
||||||
return "Palette: " + Options::video.palette;
|
return "Palette: " + palName();
|
||||||
}},
|
}},
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
@@ -426,7 +431,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
GameControl::toggle_debug_mode();
|
GameControl::toggle_debug_mode();
|
||||||
return std::string("Debug mode ") + (Debug::get()->isEnabled() ? "ON" : "OFF");
|
return std::string("Debug mode ") + (Debug::get()->isEnabled() ? "ON" : "OFF");
|
||||||
},
|
},
|
||||||
.completions = {{"DEBUG", {"ON", "OFF"}}}},
|
.completions = {{"DEBUG", {"ON", "OFF"}}}},
|
||||||
|
|
||||||
// ROOM <num>|NEXT|PREV — Cambia a la habitación indicada (1-60); solo en escena GAME
|
// ROOM <num>|NEXT|PREV — Cambia a la habitación indicada (1-60); solo en escena GAME
|
||||||
{.keyword = "ROOM", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "ROOM", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -453,7 +458,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
}
|
}
|
||||||
return std::string("Room not found: ") + buf;
|
return std::string("Room not found: ") + buf;
|
||||||
},
|
},
|
||||||
.completions = {{"ROOM", {"NEXT", "PREV"}}}},
|
.completions = {{"ROOM", {"NEXT", "PREV"}}}},
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -476,13 +481,13 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
RenderInfo::get()->toggle();
|
RenderInfo::get()->toggle();
|
||||||
return "Info overlay ON";
|
return "Info overlay ON";
|
||||||
},
|
},
|
||||||
.completions = {
|
.completions = {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
{"SHOW", {"INFO", "NOTIFICATION", "CHEEVO"}},
|
{"SHOW", {"INFO", "NOTIFICATION", "CHEEVO"}},
|
||||||
#else
|
#else
|
||||||
{"SHOW", {"INFO"}},
|
{"SHOW", {"INFO"}},
|
||||||
#endif
|
#endif
|
||||||
}},
|
}},
|
||||||
|
|
||||||
// HIDE INFO — disponible en Release
|
// HIDE INFO — disponible en Release
|
||||||
{.keyword = "HIDE", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "HIDE", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -491,7 +496,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
RenderInfo::get()->toggle();
|
RenderInfo::get()->toggle();
|
||||||
return "Info overlay OFF";
|
return "Info overlay OFF";
|
||||||
},
|
},
|
||||||
.completions = {{"HIDE", {"INFO"}}}},
|
.completions = {{"HIDE", {"INFO"}}}},
|
||||||
|
|
||||||
// CHEAT <subcomando> — Trucos de juego; solo en escena GAME; no aparece en ayuda en builds Release
|
// CHEAT <subcomando> — Trucos de juego; solo en escena GAME; no aparece en ayuda en builds Release
|
||||||
{.keyword = "CHEAT", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "CHEAT", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -558,14 +563,14 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
},
|
},
|
||||||
.hidden = CHEAT_HIDDEN,
|
.hidden = CHEAT_HIDDEN,
|
||||||
.completions = {
|
.completions = {
|
||||||
{"CHEAT", {"INFINITE", "INVINCIBILITY", "OPEN", "CLOSE"}},
|
{"CHEAT", {"INFINITE", "INVINCIBILITY", "OPEN", "CLOSE"}},
|
||||||
{"CHEAT INFINITE", {"LIVES"}},
|
{"CHEAT INFINITE", {"LIVES"}},
|
||||||
{"CHEAT INFINITE LIVES", {"ON", "OFF"}},
|
{"CHEAT INFINITE LIVES", {"ON", "OFF"}},
|
||||||
{"CHEAT INVINCIBILITY", {"ON", "OFF"}},
|
{"CHEAT INVINCIBILITY", {"ON", "OFF"}},
|
||||||
{"CHEAT OPEN", {"THE"}},
|
{"CHEAT OPEN", {"THE"}},
|
||||||
{"CHEAT OPEN THE", {"JAIL"}},
|
{"CHEAT OPEN THE", {"JAIL"}},
|
||||||
{"CHEAT CLOSE", {"THE"}},
|
{"CHEAT CLOSE", {"THE"}},
|
||||||
{"CHEAT CLOSE THE", {"JAIL"}},
|
{"CHEAT CLOSE THE", {"JAIL"}},
|
||||||
}},
|
}},
|
||||||
|
|
||||||
// SET PLAYER SKIN <1|2> — Cambia la skin del jugador (disponible en todos los builds, GAME)
|
// SET PLAYER SKIN <1|2> — Cambia la skin del jugador (disponible en todos los builds, GAME)
|
||||||
@@ -592,27 +597,29 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
if (args.size() >= 3) {
|
if (args.size() >= 3) {
|
||||||
if (args[2] == "GAME") {
|
if (args[2] == "GAME") {
|
||||||
target = SceneManager::Scene::GAME;
|
target = SceneManager::Scene::GAME;
|
||||||
name = "GAME";
|
name = "game";
|
||||||
} else if (args[2] == "LOGO") {
|
} else if (args[2] == "LOGO") {
|
||||||
target = SceneManager::Scene::LOGO;
|
target = SceneManager::Scene::LOGO;
|
||||||
name = "LOGO";
|
name = "logo";
|
||||||
} else if (args[2] == "LOADING") {
|
} else if (args[2] == "LOADING") {
|
||||||
target = SceneManager::Scene::LOADING_SCREEN;
|
target = SceneManager::Scene::LOADING_SCREEN;
|
||||||
name = "LOADING";
|
name = "loading";
|
||||||
} else if (args[2] == "TITLE") {
|
} else if (args[2] == "TITLE") {
|
||||||
target = SceneManager::Scene::TITLE;
|
target = SceneManager::Scene::TITLE;
|
||||||
name = "TITLE";
|
name = "title";
|
||||||
} else if (args[2] == "CREDITS") {
|
} else if (args[2] == "CREDITS") {
|
||||||
target = SceneManager::Scene::CREDITS;
|
target = SceneManager::Scene::CREDITS;
|
||||||
name = "CREDITS";
|
name = "credits";
|
||||||
} else if (args[2] == "ENDING") {
|
} else if (args[2] == "ENDING") {
|
||||||
target = SceneManager::Scene::ENDING;
|
target = SceneManager::Scene::ENDING;
|
||||||
name = "ENDING";
|
name = "ending";
|
||||||
} else if (args[2] == "ENDING2") {
|
} else if (args[2] == "ENDING2") {
|
||||||
target = SceneManager::Scene::ENDING2;
|
target = SceneManager::Scene::ENDING2;
|
||||||
name = "ENDING2";
|
name = "ending2";
|
||||||
} else {
|
} else {
|
||||||
return "Unknown scene: " + args[2];
|
std::string scene_lower = args[2];
|
||||||
|
std::ranges::transform(scene_lower, scene_lower.begin(), ::tolower);
|
||||||
|
return "Unknown scene: " + scene_lower;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Debug::get()->setInitialScene(target);
|
Debug::get()->setInitialScene(target);
|
||||||
@@ -654,17 +661,17 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
return "usage: set player skin <1|2>";
|
return "usage: set player skin <1|2>";
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
.completions = {
|
.completions = {
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
{"SET", {"PLAYER", "INITIAL", "ITEMS"}},
|
{"SET", {"PLAYER", "INITIAL", "ITEMS"}},
|
||||||
{"SET PLAYER", {"SKIN"}},
|
{"SET PLAYER", {"SKIN"}},
|
||||||
{"SET INITIAL", {"ROOM", "POS", "SCENE"}},
|
{"SET INITIAL", {"ROOM", "POS", "SCENE"}},
|
||||||
{"SET INITIAL SCENE", {"LOGO", "LOADING", "TITLE", "CREDITS", "GAME", "ENDING", "ENDING2"}},
|
{"SET INITIAL SCENE", {"LOGO", "LOADING", "TITLE", "CREDITS", "GAME", "ENDING", "ENDING2"}},
|
||||||
#else
|
#else
|
||||||
{"SET", {"PLAYER"}},
|
{"SET", {"PLAYER"}},
|
||||||
{"SET PLAYER", {"SKIN"}},
|
{"SET PLAYER", {"SKIN"}},
|
||||||
#endif
|
#endif
|
||||||
}},
|
}},
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// SCENE [LOGO|LOADING|TITLE|CREDITS|GAME|ENDING|ENDING2|RESTART] — Cambiar o reiniciar escena; solo en Debug
|
// SCENE [LOGO|LOADING|TITLE|CREDITS|GAME|ENDING|ENDING2|RESTART] — Cambiar o reiniciar escena; solo en Debug
|
||||||
@@ -699,7 +706,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
if (args[0] == "ENDING2") { return GO_TO(SceneManager::Scene::ENDING2, "Ending 2"); }
|
if (args[0] == "ENDING2") { return GO_TO(SceneManager::Scene::ENDING2, "Ending 2"); }
|
||||||
return "Unknown scene: " + args[0];
|
return "Unknown scene: " + args[0];
|
||||||
},
|
},
|
||||||
.completions = {{"SCENE", {"LOGO", "LOADING", "TITLE", "CREDITS", "GAME", "ENDING", "ENDING2", "RESTART"}}}},
|
.completions = {{"SCENE", {"LOGO", "LOADING", "TITLE", "CREDITS", "GAME", "ENDING", "ENDING2", "RESTART"}}}},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// RESTART — Reiniciar desde el principio (equivale a SCENE LOGO)
|
// RESTART — Reiniciar desde el principio (equivale a SCENE LOGO)
|
||||||
@@ -729,7 +736,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
}
|
}
|
||||||
return "usage: kiosk [on]";
|
return "usage: kiosk [on]";
|
||||||
},
|
},
|
||||||
.completions = {{"KIOSK", {"ON"}}}},
|
.completions = {{"KIOSK", {"ON"}}}},
|
||||||
|
|
||||||
// AUDIO [ON|OFF|VOL <0-100>] — Audio maestro (estado + volumen)
|
// AUDIO [ON|OFF|VOL <0-100>] — Audio maestro (estado + volumen)
|
||||||
{.keyword = "AUDIO", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "AUDIO", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -761,7 +768,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
}
|
}
|
||||||
return "usage: audio [on|off|vol n]";
|
return "usage: audio [on|off|vol n]";
|
||||||
},
|
},
|
||||||
.completions = {{"AUDIO", {"ON", "OFF", "VOL"}}}},
|
.completions = {{"AUDIO", {"ON", "OFF", "VOL"}}}},
|
||||||
|
|
||||||
// MUSIC [ON|OFF|VOL <0-100>] — Volumen e interruptor de música
|
// MUSIC [ON|OFF|VOL <0-100>] — Volumen e interruptor de música
|
||||||
{.keyword = "MUSIC", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "MUSIC", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -797,7 +804,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
}
|
}
|
||||||
return "usage: music [on|off|vol n]";
|
return "usage: music [on|off|vol n]";
|
||||||
},
|
},
|
||||||
.completions = {{"MUSIC", {"ON", "OFF", "VOL"}}}},
|
.completions = {{"MUSIC", {"ON", "OFF", "VOL"}}}},
|
||||||
|
|
||||||
// SOUND [ON|OFF|VOL <0-100>] — Volumen e interruptor de efectos de sonido
|
// SOUND [ON|OFF|VOL <0-100>] — Volumen e interruptor de efectos de sonido
|
||||||
{.keyword = "SOUND", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "SOUND", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -833,7 +840,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
|||||||
}
|
}
|
||||||
return "usage: sound [on|off|vol n]";
|
return "usage: sound [on|off|vol n]";
|
||||||
},
|
},
|
||||||
.completions = {{"SOUND", {"ON", "OFF", "VOL"}}}},
|
.completions = {{"SOUND", {"ON", "OFF", "VOL"}}}},
|
||||||
|
|
||||||
// EXIT / QUIT — Cerrar la aplicacion (bloqueado en kiosk)
|
// EXIT / QUIT — Cerrar la aplicacion (bloqueado en kiosk)
|
||||||
{.keyword = "EXIT", .execute = [](const std::vector<std::string>& args) -> std::string {
|
{.keyword = "EXIT", .execute = [](const std::vector<std::string>& args) -> std::string {
|
||||||
@@ -1215,7 +1222,7 @@ void Console::handleEvent(const SDL_Event& event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const std::string base_cmd = upper.substr(0, space_pos);
|
const std::string base_cmd = upper.substr(0, space_pos);
|
||||||
const std::string sub_prefix = upper.substr(space_pos + 1);
|
const std::string sub_prefix = upper.substr(space_pos + 1);
|
||||||
if (base_cmd == "PALETTE" && Screen::get() != nullptr) {
|
if (base_cmd == "PALETTE" && Screen::get() != nullptr) {
|
||||||
// NEXT/PREV primero, luego todos los nombres de paleta disponibles
|
// NEXT/PREV primero, luego todos los nombres de paleta disponibles
|
||||||
@@ -1281,7 +1288,11 @@ void Console::processCommand() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) { result = "Unknown: " + cmd; }
|
if (!found) {
|
||||||
|
std::string cmd_lower = cmd;
|
||||||
|
std::ranges::transform(cmd_lower, cmd_lower.begin(), ::tolower);
|
||||||
|
result = "Unknown: " + cmd_lower;
|
||||||
|
}
|
||||||
|
|
||||||
// Word-wrap automático según el ancho disponible en píxeles
|
// Word-wrap automático según el ancho disponible en píxeles
|
||||||
msg_lines_ = wrapText(result);
|
msg_lines_ = wrapText(result);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class Console {
|
|||||||
std::string saved_input_; // guarda input_line_ al empezar a navegar
|
std::string saved_input_; // guarda input_line_ al empezar a navegar
|
||||||
|
|
||||||
// Estado de autocompletado (TAB)
|
// Estado de autocompletado (TAB)
|
||||||
std::vector<std::string> tab_matches_; // Comandos que coinciden con el prefijo actual
|
std::vector<std::string> tab_matches_; // Comandos que coinciden con el prefijo actual
|
||||||
int tab_index_{-1}; // Índice actual en tab_matches_
|
int tab_index_{-1}; // Índice actual en tab_matches_
|
||||||
std::unordered_map<std::string, std::vector<std::string>> tab_completions_; // Mapa pre-calculado en constructor
|
std::unordered_map<std::string, std::vector<std::string>> tab_completions_; // Mapa pre-calculado en constructor
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user