diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-03-02 11:41:48 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-03-02 11:41:48 +0100 |
commit | 7e11cc8aa0b88caf30cae4e7b98290ee5f941d7b (patch) | |
tree | 312e77655b6a34d58dbc91bbb02051aa702309d0 /editor | |
parent | 0885e4b931995f6302e219709d8610e336ab1baf (diff) | |
parent | 66374c8dcee3eab1e0878e892be32cd257b43a5b (diff) | |
download | redot-engine-7e11cc8aa0b88caf30cae4e7b98290ee5f941d7b.tar.gz |
Merge pull request #74039 from daBlesr/tilemap-remember-previosuly-selected-tile
Remember previously selected TileMap tile.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/tiles/tiles_editor_plugin.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index 78522dfa73..1682d07e13 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -145,7 +145,10 @@ void TilesEditorPlugin::_tile_map_changed() { void TilesEditorPlugin::_update_editors() { // If tile_map is not edited, we change the edited only if we are not editing a tile_set. - tileset_editor->edit(tile_set); + if (tile_set.is_valid()) { + tileset_editor->edit(tile_set); + } + TileMap *tile_map = Object::cast_to<TileMap>(ObjectDB::get_instance(tile_map_id)); if (tile_map) { tilemap_editor->edit(tile_map); @@ -158,6 +161,7 @@ void TilesEditorPlugin::_update_editors() { // Make sure the tile set editor is visible if we have one assigned. tileset_editor_button->set_visible(is_visible && tile_set.is_valid()); + tilemap_editor_button->set_visible(is_visible && tile_map); // Update visibility of bottom panel buttons. if (tileset_editor_button->is_pressed() && !tile_set.is_valid()) { |