You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Keep terrain choice when changing layer in tilemap editor
Make `TileMapEditorTerrainsPlugin::edit` logic analogous to `TileMapEditorTilesPlugin::edit`, in that the selection is only cleared when switching to another tilemap. Closes #70033.
This commit is contained in:
@@ -3301,14 +3301,18 @@ 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.
|
||||
|
||||
if (tile_map_id != p_tile_map_id) {
|
||||
tile_map_id = p_tile_map_id;
|
||||
tile_map_layer = p_tile_map_layer;
|
||||
|
||||
// Clear the selection.
|
||||
_update_terrains_cache();
|
||||
_update_terrains_tree();
|
||||
_update_tiles_list();
|
||||
}
|
||||
|
||||
tile_map_layer = p_tile_map_layer;
|
||||
}
|
||||
|
||||
TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
|
||||
main_vbox_container = memnew(VBoxContainer);
|
||||
main_vbox_container->connect("tree_entered", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_theme));
|
||||
|
||||
Reference in New Issue
Block a user