diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-09-29 13:21:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-29 13:21:43 +0200 |
commit | 10245fb21c1714853f9f4ec5c7d000658ac08e8f (patch) | |
tree | 9a1f45f27bbfb5cea1d0da4742f4c58981c55219 /scene/resources/resource_format_text.cpp | |
parent | 74da12b1a2c2283cef5b11c82fb506c805a8aec8 (diff) | |
parent | 02c0edac60edda48a83cb007ad1e7bd2e58556ad (diff) |
Merge pull request #42403 from dalexeev/tscn_connection_empty_line
Improve appearance of [connection] and [editable] sections in .tscn files
Diffstat (limited to 'scene/resources/resource_format_text.cpp')
-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() + "\"]"); } } |