diff options
| author | Matthias Hoelzl | 2017-12-08 15:05:15 +0100 |
|---|---|---|
| committer | Matthias Hoelzl | 2017-12-16 17:58:17 +0100 |
| commit | ced1ff63a8267773bf440610792ce3ab4eb2f8ec (patch) | |
| tree | 826dc4d17ed0d5cf8586e25703788a52d77e1ad3 /scene/resources/scene_format_text.cpp | |
| parent | caf3a405ab1d7831a03dabc04b5fe2301e82c28e (diff) | |
| download | godot-ced1ff63a8267773bf440610792ce3ab4eb2f8ec.tar.gz godot-ced1ff63a8267773bf440610792ce3ab4eb2f8ec.tar.zst godot-ced1ff63a8267773bf440610792ce3ab4eb2f8ec.zip | |
Diffstat (limited to 'scene/resources/scene_format_text.cpp')
| -rw-r--r-- | scene/resources/scene_format_text.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index aebbb5b56..7bf5f2426 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -198,6 +198,7 @@ Ref<PackedScene> ResourceInteractiveLoaderText::_parse_node_tag(VariantParser::R int type = -1; int name = -1; int instance = -1; + int index = -1; //int base_scene=-1; if (next_tag.fields.has("name")) { @@ -249,7 +250,11 @@ Ref<PackedScene> ResourceInteractiveLoaderText::_parse_node_tag(VariantParser::R owner = 0; //if no owner, owner is root } - int node_id = packed_scene->get_state()->add_node(parent, owner, type, name, instance); + if (next_tag.fields.has("index")) { + index = next_tag.fields["index"]; + } + + int node_id = packed_scene->get_state()->add_node(parent, owner, type, name, instance, index); if (next_tag.fields.has("groups")) { @@ -1609,6 +1614,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r StringName type = state->get_node_type(i); StringName name = state->get_node_name(i); + int index = state->get_node_index(i); NodePath path = state->get_node_path(i, true); NodePath owner = state->get_node_owner_path(i); Ref<PackedScene> instance = state->get_node_instance(i); @@ -1626,6 +1632,9 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r if (owner != NodePath() && owner != NodePath(".")) { header += " owner=\"" + String(owner.simplified()) + "\""; } + if (index >= 0) { + header += " index=\"" + itos(index) + "\""; + } if (groups.size()) { String sgroups = " groups=[\n"; |
