fix: simplifica cmdCheat infinite lives, elimina getActionName mort

This commit is contained in:
2026-05-14 20:21:45 +02:00
parent 6d90b79260
commit 1b40c90a00
3 changed files with 3 additions and 18 deletions

View File

@@ -652,19 +652,6 @@ auto Title::isKeyDuplicate(SDL_Scancode scancode, int current_step) -> bool { /
} }
// Retorna el nombre de la accion para el paso actual // Retorna el nombre de la accion para el paso actual
auto Title::getActionName(int step) -> std::string { // NOLINT(readability-convert-member-functions-to-static)
switch (step) {
case 0:
return "LEFT";
case 1:
return "RIGHT";
case 2:
return "JUMP";
default:
return "UNKNOWN";
}
}
// Aplica y guarda las teclas redefinidas // Aplica y guarda las teclas redefinidas
void Title::applyKeyboardRemap() { // NOLINT(readability-convert-member-functions-to-static) void Title::applyKeyboardRemap() { // NOLINT(readability-convert-member-functions-to-static)
// Guardar las nuevas teclas en Options::controls // Guardar las nuevas teclas en Options::controls

View File

@@ -88,7 +88,6 @@ class Title : public Scene {
auto isButtonDuplicate(int button, int current_step) -> bool; // Valida si un boton esta duplicado auto isButtonDuplicate(int button, int current_step) -> bool; // Valida si un boton esta duplicado
void applyKeyboardRemap(); // Aplica y guarda las teclas redefinidas void applyKeyboardRemap(); // Aplica y guarda las teclas redefinidas
void applyJoystickRemap(); // Aplica y guarda los botones del gamepad redefinidos void applyJoystickRemap(); // Aplica y guarda los botones del gamepad redefinidos
static auto getActionName(int step) -> std::string; // Retorna el nombre de la accion (LEFT/RIGHT/JUMP)
static auto getButtonName(int button) -> std::string; // Retorna el nombre amigable del boton del gamepad static auto getButtonName(int button) -> std::string; // Retorna el nombre amigable del boton del gamepad
void createCheevosTexture(); // Crea y rellena la surface para mostrar los logros void createCheevosTexture(); // Crea y rellena la surface para mostrar los logros
void resetCheevosScroll(); // Resetea el scroll de la lista de logros void resetCheevosScroll(); // Resetea el scroll de la lista de logros

View File

@@ -836,13 +836,12 @@ static auto cmdCheat(const std::vector<std::string>& args) -> std::string { //
if (args.size() < 2 || args[1] != "LIVES") { return "usage: cheat infinite lives [on|off]"; } if (args.size() < 2 || args[1] != "LIVES") { return "usage: cheat infinite lives [on|off]"; }
auto& cheat = Options::cheats.infinite_lives; auto& cheat = Options::cheats.infinite_lives;
using State = Options::Cheat::State; using State = Options::Cheat::State;
const std::vector<std::string> REST(args.begin() + 2, args.end()); if (args.size() == 2) {
if (REST.empty()) {
cheat = (cheat == State::ENABLED) ? State::DISABLED : State::ENABLED; cheat = (cheat == State::ENABLED) ? State::DISABLED : State::ENABLED;
} else if (REST[0] == "ON") { } else if (args[2] == "ON") {
if (cheat == State::ENABLED) { return "Infinite lives already ON"; } if (cheat == State::ENABLED) { return "Infinite lives already ON"; }
cheat = State::ENABLED; cheat = State::ENABLED;
} else if (REST[0] == "OFF") { } else if (args[2] == "OFF") {
if (cheat == State::DISABLED) { return "Infinite lives already OFF"; } if (cheat == State::DISABLED) { return "Infinite lives already OFF"; }
cheat = State::DISABLED; cheat = State::DISABLED;
} else { } else {