- faltava propietat mirror

- al fer clic es tanca la consola
This commit is contained in:
2026-04-02 13:02:35 +02:00
parent 273d9304dc
commit fc28586940
5 changed files with 143 additions and 5 deletions

View File

@@ -712,6 +712,22 @@ static auto cmd_set(const std::vector<std::string>& args) -> std::string {
if (args.size() < 2) { return "usage: set <animation|color|vx|vy|flip> <value>"; }
return MapEditor::get()->setEnemyProperty(args[0], args[1]);
}
// ENEMY [ADD|DELETE|DUPLICATE]
static auto cmd_enemy(const std::vector<std::string>& args) -> std::string {
if (!MapEditor::get() || !MapEditor::get()->isActive()) { return "Editor not active"; }
if (args.empty()) { return "usage: enemy <add|delete|duplicate>"; }
if (args[0] == "ADD") { return MapEditor::get()->addEnemy(); }
if (args[0] == "DELETE") {
if (!MapEditor::get()->hasSelectedEnemy()) { return "No enemy selected"; }
return MapEditor::get()->deleteEnemy();
}
if (args[0] == "DUPLICATE") {
if (!MapEditor::get()->hasSelectedEnemy()) { return "No enemy selected"; }
return MapEditor::get()->duplicateEnemy();
}
return "usage: enemy <add|delete|duplicate>";
}
#endif
// SHOW [INFO|NOTIFICATION|CHEEVO]
@@ -914,6 +930,7 @@ void CommandRegistry::registerHandlers() {
handlers_["cmd_scene"] = cmd_scene;
handlers_["cmd_edit"] = cmd_edit;
handlers_["cmd_set"] = cmd_set;
handlers_["cmd_enemy"] = cmd_enemy;
#endif
// HELP se registra en load() como lambda que captura this