Merge pull request #31942 from Calinou/improve-delete-node-confirmation

Improve the node deletion confirmation message
This commit is contained in:
Rémi Verschelde 2019-09-04 01:13:34 +02:00 committed by GitHub
commit fede9ba52e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -759,7 +759,16 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
_delete_confirm();
} else {
delete_dialog->set_text(TTR("Delete Node(s)?"));
if (remove_list.size() > 1) {
delete_dialog->set_text(vformat(TTR("Delete %d nodes?"), remove_list.size()));
} else {
delete_dialog->set_text(vformat(TTR("Delete node \"%s\"?"), remove_list[0]->get_name()));
}
// Resize the dialog to its minimum size.
// This prevents the dialog from being too wide after displaying
// a deletion confirmation for a node with a long name.
delete_dialog->set_size(Size2());
delete_dialog->popup_centered_minsize();
}