summaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r--tools/editor/editor_node.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 2d9decaaf9..9fe0409c0e 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -415,7 +415,7 @@ void EditorNode::_rebuild_import_menu()
{
PopupMenu* p = import_menu->get_popup();
p->clear();
- p->add_item("Sub-Scene", FILE_IMPORT_SUBSCENE);
+ p->add_item("Node from scene", FILE_IMPORT_SUBSCENE);
p->add_separator();
for (int i = 0; i < editor_import_export->get_import_plugin_count(); i++) {
p->add_item(editor_import_export->get_import_plugin(i)->get_visible_name(), IMPORT_PLUGIN_BASE + i);
@@ -1454,8 +1454,13 @@ void EditorNode::_dialog_action(String p_file) {
Ref<ConfigFile> config;
config.instance();
Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
- if (err!=OK && err!=ERR_FILE_NOT_FOUND) {
- return; //no config
+
+ if (err==ERR_CANT_OPEN) {
+ config.instance(); // new config
+ } else if (err!=OK) {
+ confirm_error->set_text("Error trying to save layout!");
+ confirm_error->popup_centered_minsize();
+ return;
}
_save_docks_to_config(config, p_file);
@@ -1480,11 +1485,8 @@ void EditorNode::_dialog_action(String p_file) {
Ref<ConfigFile> config;
config.instance();
Error err = config->load(EditorSettings::get_singleton()->get_settings_path().plus_file("editor_layouts.cfg"));
- if (err!=OK) {
- return; //no config
- }
- if (!config->has_section(p_file)) {
+ if (err!=OK || !config->has_section(p_file)) {
confirm_error->set_text("Layout name not found!");
confirm_error->popup_centered_minsize();
return;
@@ -3533,11 +3535,13 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo
}
- for(int i=0;i<editor_data.get_edited_scene_count();i++) {
+ if(!p_set_inherited) {
+ for(int i=0;i<editor_data.get_edited_scene_count();i++) {
- if (editor_data.get_scene_path(i)==p_scene) {
- _scene_tab_changed(i);
- return OK;
+ if (editor_data.get_scene_path(i)==p_scene) {
+ _scene_tab_changed(i);
+ return OK;
+ }
}
}