|
@@ -119,7 +119,6 @@ void SceneTreeDock::instance(const String &p_file) {
|
|
if (!edited_scene) {
|
|
if (!edited_scene) {
|
|
|
|
|
|
current_option = -1;
|
|
current_option = -1;
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("No parent to instance a child at."));
|
|
accept->set_text(TTR("No parent to instance a child at."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return;
|
|
return;
|
|
@@ -142,7 +141,6 @@ void SceneTreeDock::instance_scenes(const Vector<String> &p_files, Node *p_paren
|
|
|
|
|
|
if (!parent || !edited_scene) {
|
|
if (!parent || !edited_scene) {
|
|
|
|
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("No parent to instance the scenes at."));
|
|
accept->set_text(TTR("No parent to instance the scenes at."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return;
|
|
return;
|
|
@@ -164,7 +162,6 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node
|
|
Ref<PackedScene> sdata = ResourceLoader::load(p_files[i]);
|
|
Ref<PackedScene> sdata = ResourceLoader::load(p_files[i]);
|
|
if (!sdata.is_valid()) {
|
|
if (!sdata.is_valid()) {
|
|
current_option = -1;
|
|
current_option = -1;
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(vformat(TTR("Error loading scene from %s"), p_files[i]));
|
|
accept->set_text(vformat(TTR("Error loading scene from %s"), p_files[i]));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
error = true;
|
|
error = true;
|
|
@@ -174,7 +171,6 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node
|
|
Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
|
|
Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
|
|
if (!instanced_scene) {
|
|
if (!instanced_scene) {
|
|
current_option = -1;
|
|
current_option = -1;
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(vformat(TTR("Error instancing scene from %s"), p_files[i]));
|
|
accept->set_text(vformat(TTR("Error instancing scene from %s"), p_files[i]));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
error = true;
|
|
error = true;
|
|
@@ -185,7 +181,6 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node
|
|
|
|
|
|
if (_cyclical_dependency_exists(edited_scene->get_filename(), instanced_scene)) {
|
|
if (_cyclical_dependency_exists(edited_scene->get_filename(), instanced_scene)) {
|
|
|
|
|
|
- accept->get_ok()->set_text(TTR("Ok"));
|
|
|
|
accept->set_text(vformat(TTR("Cannot instance the scene '%s' because the current scene exists within one of its nodes."), p_files[i]));
|
|
accept->set_text(vformat(TTR("Cannot instance the scene '%s' because the current scene exists within one of its nodes."), p_files[i]));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
error = true;
|
|
error = true;
|
|
@@ -233,7 +228,6 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node
|
|
void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base) {
|
|
void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base) {
|
|
Ref<PackedScene> sdata = ResourceLoader::load(p_file);
|
|
Ref<PackedScene> sdata = ResourceLoader::load(p_file);
|
|
if (!sdata.is_valid()) {
|
|
if (!sdata.is_valid()) {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(vformat(TTR("Error loading scene from %s"), p_file));
|
|
accept->set_text(vformat(TTR("Error loading scene from %s"), p_file));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return;
|
|
return;
|
|
@@ -241,7 +235,6 @@ void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base)
|
|
|
|
|
|
Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
|
|
Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
|
|
if (!instanced_scene) {
|
|
if (!instanced_scene) {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(vformat(TTR("Error instancing scene from %s"), p_file));
|
|
accept->set_text(vformat(TTR("Error instancing scene from %s"), p_file));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return;
|
|
return;
|
|
@@ -416,7 +409,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
|
if (scene_tree->get_selected() == edited_scene) {
|
|
if (scene_tree->get_selected() == edited_scene) {
|
|
|
|
|
|
current_option = -1;
|
|
current_option = -1;
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("This operation can't be done on the tree root."));
|
|
accept->set_text(TTR("This operation can't be done on the tree root."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
break;
|
|
break;
|
|
@@ -477,7 +469,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
|
if (editor_selection->is_selected(edited_scene)) {
|
|
if (editor_selection->is_selected(edited_scene)) {
|
|
|
|
|
|
current_option = -1;
|
|
current_option = -1;
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("This operation can't be done on the tree root."));
|
|
accept->set_text(TTR("This operation can't be done on the tree root."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
break;
|
|
break;
|
|
@@ -547,7 +538,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
|
if (editor_selection->is_selected(edited_scene)) {
|
|
if (editor_selection->is_selected(edited_scene)) {
|
|
|
|
|
|
current_option = -1;
|
|
current_option = -1;
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("This operation can't be done on the tree root."));
|
|
accept->set_text(TTR("This operation can't be done on the tree root."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
break;
|
|
break;
|
|
@@ -634,7 +624,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
|
Node *scene = editor_data->get_edited_scene_root();
|
|
Node *scene = editor_data->get_edited_scene_root();
|
|
|
|
|
|
if (!scene) {
|
|
if (!scene) {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("This operation can't be done without a scene."));
|
|
accept->set_text(TTR("This operation can't be done without a scene."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
break;
|
|
break;
|
|
@@ -643,7 +632,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
|
List<Node *> selection = editor_selection->get_selected_node_list();
|
|
List<Node *> selection = editor_selection->get_selected_node_list();
|
|
|
|
|
|
if (selection.size() != 1) {
|
|
if (selection.size() != 1) {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("This operation requires a single selected node."));
|
|
accept->set_text(TTR("This operation requires a single selected node."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
break;
|
|
break;
|
|
@@ -652,14 +640,12 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
|
Node *tocopy = selection.front()->get();
|
|
Node *tocopy = selection.front()->get();
|
|
|
|
|
|
if (tocopy == scene) {
|
|
if (tocopy == scene) {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("Can not perform with the root node."));
|
|
accept->set_text(TTR("Can not perform with the root node."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
if (tocopy != editor_data->get_edited_scene_root() && tocopy->get_filename() != "") {
|
|
if (tocopy != editor_data->get_edited_scene_root() && tocopy->get_filename() != "") {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("This operation can't be done on instanced scenes."));
|
|
accept->set_text(TTR("This operation can't be done on instanced scenes."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
break;
|
|
break;
|
|
@@ -1304,7 +1290,6 @@ bool SceneTreeDock::_validate_no_foreign() {
|
|
|
|
|
|
if (E->get() != edited_scene && E->get()->get_owner() != edited_scene) {
|
|
if (E->get() != edited_scene && E->get()->get_owner() != edited_scene) {
|
|
|
|
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("Can't operate on nodes from a foreign scene!"));
|
|
accept->set_text(TTR("Can't operate on nodes from a foreign scene!"));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return false;
|
|
return false;
|
|
@@ -1312,7 +1297,6 @@ bool SceneTreeDock::_validate_no_foreign() {
|
|
|
|
|
|
if (edited_scene->get_scene_inherited_state().is_valid() && edited_scene->get_scene_inherited_state()->find_node_by_path(edited_scene->get_path_to(E->get())) >= 0) {
|
|
if (edited_scene->get_scene_inherited_state().is_valid() && edited_scene->get_scene_inherited_state()->find_node_by_path(edited_scene->get_path_to(E->get())) >= 0) {
|
|
|
|
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("Can't operate on nodes the current scene inherits from!"));
|
|
accept->set_text(TTR("Can't operate on nodes the current scene inherits from!"));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return false;
|
|
return false;
|
|
@@ -1792,14 +1776,12 @@ void SceneTreeDock::_new_scene_from(String p_file) {
|
|
List<Node *> selection = editor_selection->get_selected_node_list();
|
|
List<Node *> selection = editor_selection->get_selected_node_list();
|
|
|
|
|
|
if (selection.size() != 1) {
|
|
if (selection.size() != 1) {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("This operation requires a single selected node."));
|
|
accept->set_text(TTR("This operation requires a single selected node."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
if (EditorNode::get_singleton()->is_scene_open(p_file)) {
|
|
if (EditorNode::get_singleton()->is_scene_open(p_file)) {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("Can't overwrite scene that is still open!"));
|
|
accept->set_text(TTR("Can't overwrite scene that is still open!"));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return;
|
|
return;
|
|
@@ -1817,7 +1799,6 @@ void SceneTreeDock::_new_scene_from(String p_file) {
|
|
memdelete(copy);
|
|
memdelete(copy);
|
|
|
|
|
|
if (err != OK) {
|
|
if (err != OK) {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("Couldn't save new scene. Likely dependencies (instances) couldn't be satisfied."));
|
|
accept->set_text(TTR("Couldn't save new scene. Likely dependencies (instances) couldn't be satisfied."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return;
|
|
return;
|
|
@@ -1829,14 +1810,12 @@ void SceneTreeDock::_new_scene_from(String p_file) {
|
|
|
|
|
|
err = ResourceSaver::save(p_file, sdata, flg);
|
|
err = ResourceSaver::save(p_file, sdata, flg);
|
|
if (err != OK) {
|
|
if (err != OK) {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("Error saving scene."));
|
|
accept->set_text(TTR("Error saving scene."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
_replace_with_branch_scene(p_file, base);
|
|
_replace_with_branch_scene(p_file, base);
|
|
} else {
|
|
} else {
|
|
- accept->get_ok()->set_text(TTR("OK"));
|
|
|
|
accept->set_text(TTR("Error duplicating scene to save it."));
|
|
accept->set_text(TTR("Error duplicating scene to save it."));
|
|
accept->popup_centered_minsize();
|
|
accept->popup_centered_minsize();
|
|
return;
|
|
return;
|