Merge pull request #70601 from vmedea/keep-terrain-choice

Keep terrain choice when changing layer in tilemap editor
This commit is contained in:
Rémi Verschelde 2023-01-13 18:04:02 +01:00
commit 228db366bf
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 9 additions and 5 deletions

View File

@ -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() {