From ebb5821bcec8cde79c9e1491878f7259fed186b0 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Tue, 29 Sep 2020 14:01:01 +0300 Subject: [PATCH] Improve appearance of [connection] and [editable] sections in .tscn files (cherry picked from commit 02c0edac60edda48a83cb007ad1e7bd2e58556ad) --- scene/resources/resource_format_text.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index eb05defddd8..285f5037aa4 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -1741,6 +1741,9 @@ 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)) + "\""; @@ -1765,7 +1768,10 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r Vector 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() + "\"]"); } }