fix: editor encara posava border en el yaml
new: en el editor pots mouret d'habitació amb cursors
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
room:
|
room:
|
||||||
bgColor: 0
|
bgColor: 0
|
||||||
border: 0
|
|
||||||
tileSetFile: standard.gif
|
tileSetFile: standard.gif
|
||||||
|
|
||||||
# Conexiones de la habitación (null = sin conexión)
|
# Conexiones de la habitación (null = sin conexión)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
room:
|
room:
|
||||||
bgColor: 34
|
bgColor: 34
|
||||||
border: 0
|
|
||||||
tileSetFile: standard.gif
|
tileSetFile: standard.gif
|
||||||
|
|
||||||
# Conexiones de la habitación (null = sin conexión)
|
# Conexiones de la habitación (null = sin conexión)
|
||||||
|
|||||||
@@ -461,6 +461,30 @@ void MapEditor::handleEvent(const SDL_Event& event) { // NOLINT(readability-fun
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cursores: navegar a habitación adyacente
|
||||||
|
if (event.type == SDL_EVENT_KEY_DOWN && static_cast<int>(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
|
// Click derecho: abrir TilePicker
|
||||||
if (event.type == SDL_EVENT_MOUSE_BUTTON_DOWN && event.button.button == SDL_BUTTON_RIGHT) {
|
if (event.type == SDL_EVENT_MOUSE_BUTTON_DOWN && event.button.button == SDL_BUTTON_RIGHT) {
|
||||||
// Deseleccionar entidades
|
// Deseleccionar entidades
|
||||||
@@ -1407,7 +1431,6 @@ auto MapEditor::createNewRoom(const std::string& direction) -> std::string { //
|
|||||||
file << " name_en: \"NO_NAME\"\n";
|
file << " name_en: \"NO_NAME\"\n";
|
||||||
file << " name_ca: \"NO_NAME\"\n";
|
file << " name_ca: \"NO_NAME\"\n";
|
||||||
file << " bgColor: black\n";
|
file << " bgColor: black\n";
|
||||||
file << " border: magenta\n";
|
|
||||||
file << " tileSetFile: standard.gif\n";
|
file << " tileSetFile: standard.gif\n";
|
||||||
file << "\n";
|
file << "\n";
|
||||||
file << " connections:\n";
|
file << " connections:\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user