diff --git a/data/room/02.yaml b/data/room/02.yaml index 6cc5c52..9b3b3f7 100644 --- a/data/room/02.yaml +++ b/data/room/02.yaml @@ -1,6 +1,5 @@ room: bgColor: 0 - border: 0 tileSetFile: standard.gif # Conexiones de la habitación (null = sin conexión) diff --git a/data/room/04.yaml b/data/room/04.yaml index 28f5a08..6ea8bac 100644 --- a/data/room/04.yaml +++ b/data/room/04.yaml @@ -1,6 +1,5 @@ room: bgColor: 34 - border: 0 tileSetFile: standard.gif # Conexiones de la habitación (null = sin conexión) diff --git a/source/game/editor/map_editor.cpp b/source/game/editor/map_editor.cpp index 2c59cb5..e0a50e8 100644 --- a/source/game/editor/map_editor.cpp +++ b/source/game/editor/map_editor.cpp @@ -461,6 +461,30 @@ void MapEditor::handleEvent(const SDL_Event& event) { // NOLINT(readability-fun return; } + // Cursores: navegar a habitación adyacente + if (event.type == SDL_EVENT_KEY_DOWN && static_cast(event.key.repeat) == 0) { + std::string direction; + switch (event.key.key) { + case SDLK_UP: direction = "UP"; break; + case SDLK_DOWN: direction = "DOWN"; break; + case SDLK_LEFT: direction = "LEFT"; break; + case SDLK_RIGHT: direction = "RIGHT"; break; + default: break; + } + if (!direction.empty() && GameControl::get_adjacent_room) { + std::string adjacent = GameControl::get_adjacent_room(direction); + if (!adjacent.empty() && adjacent != "0") { + autosave(); + reenter_ = true; + if (GameControl::exit_editor) { GameControl::exit_editor(); } + if (GameControl::change_room && GameControl::change_room(adjacent)) { + if (GameControl::enter_editor) { GameControl::enter_editor(); } + } + return; + } + } + } + // Click derecho: abrir TilePicker if (event.type == SDL_EVENT_MOUSE_BUTTON_DOWN && event.button.button == SDL_BUTTON_RIGHT) { // Deseleccionar entidades @@ -1407,7 +1431,6 @@ auto MapEditor::createNewRoom(const std::string& direction) -> std::string { // file << " name_en: \"NO_NAME\"\n"; file << " name_ca: \"NO_NAME\"\n"; file << " bgColor: black\n"; - file << " border: magenta\n"; file << " tileSetFile: standard.gif\n"; file << "\n"; file << " connections:\n";