mirror of
https://github.com/godotengine/godot.git
synced 2024-12-15 10:12:40 +08:00
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:
commit
10245fb21c
@ -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() + "\"]");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user