diff options
| author | Jon Ross | 2017-05-19 14:49:37 -0700 |
|---|---|---|
| committer | Jon Ross | 2017-05-19 14:49:37 -0700 |
| commit | c97c733779e4061313ea57804f24f646c3b1228c (patch) | |
| tree | 6eb64b77d54b8582e8fa8b9866b1fa17f02f3393 /editor/plugins/tile_set_editor_plugin.cpp | |
| parent | a75623f436c215e107ede321afa08a1897552deb (diff) | |
| download | godot-c97c733779e4061313ea57804f24f646c3b1228c.tar.gz godot-c97c733779e4061313ea57804f24f646c3b1228c.tar.zst godot-c97c733779e4061313ea57804f24f646c3b1228c.zip | |
Diffstat (limited to 'editor/plugins/tile_set_editor_plugin.cpp')
| -rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index e79cbd0d3..0b088f717 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -37,24 +37,18 @@ void TileSetEditor::edit(const Ref<TileSet> &p_tileset) { tileset = p_tileset; } -void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_merge) { - - if (!p_merge) - p_library->clear(); +void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) { - for (int i = 0; i < scene->get_child_count(); i++) { + for (int i = 0; i < p_node->get_child_count(); i++) { - Node *child = scene->get_child(i); + Node *child = p_node->get_child(i); if (!child->cast_to<Sprite>()) { if (child->get_child_count() > 0) { - child = child->get_child(0); - if (!child->cast_to<Sprite>()) { - continue; - } + _import_node(child, p_library); + } - } else - continue; + continue; } Sprite *mi = child->cast_to<Sprite>(); @@ -138,6 +132,14 @@ void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_me } } +void TileSetEditor::_import_scene(Node *scene, Ref<TileSet> p_library, bool p_merge) { + + if (!p_merge) + p_library->clear(); + + _import_node(scene, p_library); +} + void TileSetEditor::_menu_confirm() { switch (option) { |
