From 291be2c66cec385983cc751de65591cf2e13d6fb Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 13 Oct 2023 09:55:24 +0200 Subject: [PATCH] Swap TileMap and TileSet --- editor/plugins/tiles/tiles_editor_plugin.cpp | 8 ++++++-- 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 e50d21bbf85a..b96f3f21b8ae 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 1e7aabf00148..9a667d57758d 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(); EditorPlugins::add_by_type(); EditorPlugins::add_by_type(); - EditorPlugins::add_by_type(); EditorPlugins::add_by_type(); + EditorPlugins::add_by_type(); // For correct doc generation. GLOBAL_DEF("editor/run/main_run_args", "");