diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-13 11:47:55 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-13 11:47:55 +0200 |
commit | 37ee293be82e625e68704a78477b841d0ba17b8f (patch) | |
tree | 7d8f7328a2d7ff696dc6885d93371e7df4b15262 | |
parent | 577fbd8841dbcdf16e6b8db38b2f6354e18166e6 (diff) | |
parent | 291be2c66cec385983cc751de65591cf2e13d6fb (diff) | |
download | redot-engine-37ee293be82e625e68704a78477b841d0ba17b8f.tar.gz |
Merge pull request #83244 from KoBeWi/tile_map_is_now_tile_set_and_vice_versa
Swap TileMap and TileSet buttons
-rw-r--r-- | editor/plugins/tiles/tiles_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/register_editor_types.cpp | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index e50d21bbf8..b96f3f21b8 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -413,7 +413,9 @@ bool TileMapEditorPlugin::is_editor_visible() const { } TileMapEditorPlugin::TileMapEditorPlugin() { - memnew(TilesEditorUtils); + if (!TilesEditorUtils::get_singleton()) { + memnew(TilesEditorUtils); + } tile_map_plugin_singleton = this; editor = memnew(TileMapEditor); @@ -462,7 +464,9 @@ ObjectID TileSetEditorPlugin::get_edited_tileset() const { } TileSetEditorPlugin::TileSetEditorPlugin() { - DEV_ASSERT(tile_map_plugin_singleton); + if (!TilesEditorUtils::get_singleton()) { + memnew(TilesEditorUtils); + } tile_set_plugin_singleton = this; editor = memnew(TileSetEditor); diff --git a/editor/register_editor_types.cpp b/editor/register_editor_types.cpp index 1e7aabf001..9a667d5775 100644 --- a/editor/register_editor_types.cpp +++ b/editor/register_editor_types.cpp @@ -257,8 +257,8 @@ void register_editor_types() { EditorPlugins::add_by_type<Cast2DEditorPlugin>(); EditorPlugins::add_by_type<Skeleton2DEditorPlugin>(); EditorPlugins::add_by_type<Sprite2DEditorPlugin>(); - EditorPlugins::add_by_type<TileMapEditorPlugin>(); EditorPlugins::add_by_type<TileSetEditorPlugin>(); + EditorPlugins::add_by_type<TileMapEditorPlugin>(); // For correct doc generation. GLOBAL_DEF("editor/run/main_run_args", ""); |