diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-13 18:04:02 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-13 18:04:02 +0100 |
commit | 228db366bf7eee5cc1623f009d27e88ed80b5d7d (patch) | |
tree | fd8934edc462a00ed865d904533ec3014fb81224 /editor/plugins/tiles | |
parent | 3e5ee125556ea69a0318ef9870bb9ab9d4bfa5cc (diff) | |
parent | 5380e685d891712bc51aec83c024495a18d20acd (diff) |
Merge pull request #70601 from vmedea/keep-terrain-choice
Keep terrain choice when changing layer in tilemap editor
Diffstat (limited to 'editor/plugins/tiles')
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index dd4daa45b7..e9c313a372 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -3303,12 +3303,16 @@ void TileMapEditorTerrainsPlugin::_update_theme() { void TileMapEditorTerrainsPlugin::edit(ObjectID p_tile_map_id, int p_tile_map_layer) { _stop_dragging(); // Avoids staying in a wrong drag state. - tile_map_id = p_tile_map_id; - tile_map_layer = p_tile_map_layer; + if (tile_map_id != p_tile_map_id) { + tile_map_id = p_tile_map_id; - _update_terrains_cache(); - _update_terrains_tree(); - _update_tiles_list(); + // Clear the selection. + _update_terrains_cache(); + _update_terrains_tree(); + _update_tiles_list(); + } + + tile_map_layer = p_tile_map_layer; } TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() { |