Skip to content

Commit

Permalink
Tweak error messages for the Save Branch as Scene editor option
Browse files Browse the repository at this point in the history
  • Loading branch information
Calinou committed Mar 21, 2021
1 parent 07f076f commit 4c8f458
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -897,29 +897,29 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
Node *scene = editor_data->get_edited_scene_root();

if (!scene) {
accept->set_text(TTR("This operation can't be done without a scene."));
accept->set_text(TTR("Saving the branch as a scene requires having a scene open in the editor."));
accept->popup_centered();
break;
}

List<Node *> selection = editor_selection->get_selected_node_list();

if (selection.size() != 1) {
accept->set_text(TTR("This operation requires a single selected node."));
accept->set_text(vformat(TTR("Saving the branch as a scene requires selecting only one node, but you have selected %d nodes."), selection.size()));
accept->popup_centered();
break;
}

Node *tocopy = selection.front()->get();

if (tocopy == scene) {
accept->set_text(TTR("Can not perform with the root node."));
accept->set_text(TTR("Can't save the root node branch as an instanced scene.\nTo create an editable copy of the current scene, duplicate it using the FileSystem dock context menu\nor create an inherited scene using Scene > New Inherited Scene... instead."));
accept->popup_centered();
break;
}

if (tocopy != editor_data->get_edited_scene_root() && tocopy->get_filename() != "") {
accept->set_text(TTR("This operation can't be done on instanced scenes."));
accept->set_text(TTR("Can't save the branch of an already instanced scene.\nTo create a variation of a scene, you can make an inherited scene based on the instanced scene using Scene > New Inherited Scene... instead."));
accept->popup_centered();
break;
}
Expand Down

0 comments on commit 4c8f458

Please sign in to comment.