From 284548c4b74646c331a1a5e0b32c54d8929c3fc0 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 3 Sep 2019 23:14:59 +0200 Subject: Improve the node deletion confirmation message The confirmation message now displays the number of nodes to delete, or the node's name if only one node is selected. --- editor/scene_tree_dock.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'editor/scene_tree_dock.cpp') diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index f0114b393d..16f1575757 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -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(); } -- cgit v1.2.3