diff --git a/data/locale/ca.yaml b/data/locale/ca.yaml index cb46f7d..47a059d 100644 --- a/data/locale/ca.yaml +++ b/data/locale/ca.yaml @@ -141,3 +141,5 @@ game: cheat_jail_open: "JAIL OBERTA" debug_enabled: "DEBUG ACTIVAT" debug_disabled: "DEBUG DESACTIVAT" + editor_enabled: "EDITOR ACTIVAT" + editor_disabled: "EDITOR DESACTIVAT" diff --git a/data/locale/en.yaml b/data/locale/en.yaml index 8748fc1..3d87fac 100644 --- a/data/locale/en.yaml +++ b/data/locale/en.yaml @@ -141,3 +141,5 @@ game: cheat_jail_open: "JAIL IS OPEN" debug_enabled: "DEBUG ENABLED" debug_disabled: "DEBUG DISABLED" + editor_enabled: "EDITOR ENABLED" + editor_disabled: "EDITOR DISABLED" diff --git a/data/room/03.yaml b/data/room/03.yaml index b08fe88..a150d9f 100644 --- a/data/room/03.yaml +++ b/data/room/03.yaml @@ -3,15 +3,15 @@ enemies: animation: code.yaml boundaries: position1: - x: 5 - y: 13 + x: 3 + y: 2 position2: - x: 16 - y: 13 + x: 20 + y: 2 color: yellow position: - x: 11 - y: 13 + x: 8 + y: 2 velocity: x: 24.0 y: 0 diff --git a/source/game/scenes/game.cpp b/source/game/scenes/game.cpp index eee4d7c..daadc11 100644 --- a/source/game/scenes/game.cpp +++ b/source/game/scenes/game.cpp @@ -168,7 +168,16 @@ void Game::handleEvents() { GlobalEvents::handle(event); #ifdef _DEBUG if (!Console::get()->isActive()) { - if (MapEditor::get()->isActive()) { + // Tecla 9: toggle editor (funciona tanto dentro como fuera del editor) + if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_9 && static_cast(event.key.repeat) == 0) { + if (MapEditor::get()->isActive()) { + GameControl::exit_editor(); + Notifier::get()->show({Locale::get()->get("game.editor_disabled")}); // NOLINT(readability-static-accessed-through-instance) + } else { + GameControl::enter_editor(); + Notifier::get()->show({Locale::get()->get("game.editor_enabled")}); // NOLINT(readability-static-accessed-through-instance) + } + } else if (MapEditor::get()->isActive()) { MapEditor::get()->handleEvent(event); } else { handleDebugEvents(event);