diff options
author | kobewi <kobewi4e@gmail.com> | 2023-10-13 09:55:24 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2023-10-13 09:55:24 +0200 |
commit | 291be2c66cec385983cc751de65591cf2e13d6fb (patch) | |
tree | f219a45f101f0be5ab1f3a79919e9546f01b5b5e | |
parent | ee118e7ffd97f478de73f4b344fddc0203ef7cca (diff) | |
download | redot-engine-291be2c66cec385983cc751de65591cf2e13d6fb.tar.gz |
Swap TileMap and TileSet
-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", ""); |