Merge pull request #42403 from dalexeev/tscn_connection_empty_line

Improve appearance of [connection] and [editable] sections in .tscn files
This commit is contained in:
Rémi Verschelde 2020-09-29 13:21:43 +02:00 committed by GitHub
commit 10245fb21c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() + "\"]");
}
}