diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2020-09-29 14:01:01 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2020-09-29 14:01:01 +0300 |
commit | 02c0edac60edda48a83cb007ad1e7bd2e58556ad (patch) | |
tree | 64048ba912e0ef9f062fddf9bf0880a1a82df184 /scene/resources | |
parent | aed16c8f84b67626b9a989ef24284fb92d569814 (diff) |
Improve appearance of [connection] and [editable] sections in .tscn files
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/resource_format_text.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index d4d8018d43..ba39593690 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -1763,6 +1763,10 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r } for (int i = 0; i < state->get_connection_count(); i++) { + if (i == 0) { + f->store_line(""); + } + String connstr = "[connection"; connstr += " signal=\"" + String(state->get_connection_signal(i)) + "\""; connstr += " from=\"" + String(state->get_connection_source(i).simplified()) + "\""; @@ -1786,7 +1790,10 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r Vector<NodePath> editable_instances = state->get_editable_instances(); for (int i = 0; i < editable_instances.size(); i++) { - f->store_line("\n[editable path=\"" + editable_instances[i].operator String() + "\"]"); + if (i == 0) { + f->store_line(""); + } + f->store_line("[editable path=\"" + editable_instances[i].operator String() + "\"]"); } } |