summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/x11/os_x11.cpp4
-rw-r--r--tools/editor/editor_node.cpp8
-rw-r--r--tools/editor/editor_node.h3
-rw-r--r--tools/editor/groups_editor.cpp30
-rw-r--r--tools/editor/import_settings.cpp220
-rw-r--r--tools/editor/import_settings.h82
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp2
-rw-r--r--tools/editor/scenes_dock.cpp3
8 files changed, 36 insertions, 316 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 12957b81b7..846c61fd1f 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -116,7 +116,9 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
x11_display = XOpenDisplay(NULL);
char * modifiers = XSetLocaleModifiers ("@im=none");
- ERR_FAIL_COND( modifiers == NULL );
+ if (modifiers==NULL) {
+ WARN_PRINT("Error setting locale modifiers");
+ }
const char* err;
xrr_get_monitors = NULL;
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 0233b6e9d6..001a94f251 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -508,8 +508,6 @@ void EditorNode::_rebuild_import_menu()
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);
}
- //p->add_separator();
- //p->add_item(TTR("Re-Import.."), SETTINGS_IMPORT);
}
void EditorNode::_node_renamed() {
@@ -2779,10 +2777,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
settings_config_dialog->popup_edit_settings();
} break;
- case SETTINGS_IMPORT: {
-
- import_settings->popup_import_settings();
- } break;
case SETTINGS_OPTIMIZED_PRESETS: {
//optimized_presets->popup_centered_ratio();
@@ -6289,8 +6283,6 @@ EditorNode::EditorNode() {
open_recent_confirmation->connect("confirmed",this,"_open_recent_scene_confirm");
- import_settings= memnew(ImportSettingsDialog(this));
- gui_base->add_child(import_settings);
run_settings_dialog = memnew( RunSettingsDialog );
gui_base->add_child( run_settings_dialog );
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index f694c65db8..c4414d5c36 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -74,7 +74,6 @@
#include "tools/editor/editor_sub_scene.h"
#include "editor_import_export.h"
#include "editor_reimport_dialog.h"
-#include "import_settings.h"
#include "tools/editor/editor_plugin.h"
#include "tools/editor/editor_name_dialog.h"
@@ -177,7 +176,6 @@ private:
RUN_RELOAD_SCRIPTS,
SETTINGS_UPDATE_ALWAYS,
SETTINGS_UPDATE_CHANGES,
- SETTINGS_IMPORT,
SETTINGS_EXPORT_PREFERENCES,
SETTINGS_PREFERENCES,
SETTINGS_OPTIMIZED_PRESETS,
@@ -338,7 +336,6 @@ private:
Vector<EditorPlugin*> editor_table;
EditorReImportDialog *reimport_dialog;
- ImportSettingsDialog *import_settings;
ProgressDialog *progress_dialog;
BackgroundProgress *progress_hb;
diff --git a/tools/editor/groups_editor.cpp b/tools/editor/groups_editor.cpp
index 898e1e115e..5b7bc1da78 100644
--- a/tools/editor/groups_editor.cpp
+++ b/tools/editor/groups_editor.cpp
@@ -31,7 +31,7 @@
#include "scene/gui/box_container.h"
#include "scene/gui/label.h"
#include "editor_node.h"
-
+#include "scene/resources/packed_scene.h"
void GroupsEditor::_add_group(const String& p_group) {
if (!node)
@@ -107,9 +107,35 @@ void GroupsEditor::update_tree() {
if (!gi.persistent)
continue;
+ Node *n = node;
+ bool can_be_deleted=true;
+
+ while(n) {
+
+ Ref<SceneState> ss = (n==EditorNode::get_singleton()->get_edited_scene()) ? n->get_scene_inherited_state() : n->get_scene_instance_state();
+
+ if (ss.is_valid()) {
+
+ int path = ss->find_node_by_path(n->get_path_to(node));
+ if (path!=-1) {
+ if (ss->is_node_in_group(path,gi.name)) {
+ can_be_deleted=false;
+ }
+ }
+ }
+
+ n=n->get_owner();
+ }
+
+
TreeItem *item=tree->create_item(root);
item->set_text(0, gi.name);
- item->add_button(0, get_icon("Remove", "EditorIcons"), 0);
+ if (can_be_deleted) {
+ item->add_button(0, get_icon("Remove", "EditorIcons"), 0);
+ } else {
+ item->set_selectable(0,false);
+ }
+
}
}
diff --git a/tools/editor/import_settings.cpp b/tools/editor/import_settings.cpp
deleted file mode 100644
index 53bbd2a878..0000000000
--- a/tools/editor/import_settings.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/*************************************************************************/
-/* import_settings.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* http://www.godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-#include "import_settings.h"
-#include "os/os.h"
-#include "editor_node.h"
-
-void ImportSettingsDialog::_item_pressed(int p_idx) {
-
- if (!edited)
- return;
-
- String p=edited->get_metadata(0);
-}
-
-void ImportSettingsDialog::_item_edited() {
-
- if (updating)
- return;
- TreeItem *it=tree->get_selected();
-
- String p=it->get_metadata(0);
-}
-
-
-void ImportSettingsDialog::_button_pressed(Object *p_button, int p_col, int p_id) {
-
- TreeItem *ti=p_button->cast_to<TreeItem>();
- if (!ti)
- return;
- String path = ti->get_metadata(0);
- print_line("PATH: "+path);
- Ref<ResourceImportMetadata> rimd = ResourceLoader::load_import_metadata(path);
- ERR_FAIL_COND(rimd.is_null());
- Ref<EditorImportPlugin> rimp = EditorImportExport::get_singleton()->get_import_plugin_by_name(rimd->get_editor());
- ERR_FAIL_COND(!rimp.is_valid());
- rimp->import_dialog(path);
- hide();
-}
-
-bool ImportSettingsDialog::_generate_fs(TreeItem *p_parent,EditorFileSystemDirectory *p_dir) {
-
- bool valid=false;
-
-
- for(int i=0;i<p_dir->get_subdir_count();i++) {
-
- EditorFileSystemDirectory *sd=p_dir->get_subdir(i);
- TreeItem *ti = tree->create_item(p_parent);
- ti->set_text(0,sd->get_name()+"/");
- ti->set_icon(0,get_icon("Folder","EditorIcons"));
-
- if (!_generate_fs(ti,sd)) {
- memdelete(ti);
- } else {
- valid=true;
- }
- }
-
-
- for(int i=0;i<p_dir->get_file_count();i++) {
-
- String path=p_dir->get_file_path(i);
- if (!p_dir->get_file_meta(i))
- continue;
-
- valid=true;
-
- String f = p_dir->get_file(i);
- TreeItem *ti = tree->create_item(p_parent);
- String type = p_dir->get_file_type(i);
- Ref<Texture> t;
- if (has_icon(type,"EditorIcons"))
- t = get_icon(type,"EditorIcons");
- else
- t = get_icon("Object","EditorIcons");
-
-
- ti->set_icon(0,t);
- ti->set_text(0,f);
-// ti->add_button(0,get_icon("Reload","EditorIcons"));
- ti->set_metadata(0,p_dir->get_file_path(i));
- String tt = p_dir->get_file_path(i);
-
- if (p_dir->is_missing_sources(i)) {
- ti->set_icon(1,get_icon("ImportFail","EditorIcons"));
- Vector<String> missing = p_dir->get_missing_sources(i);
- for(int j=0;j<missing.size();j++) {
- tt+="\nmissing: "+missing[j];
- }
-
- } else
- ti->set_icon(1,get_icon("ImportCheck","EditorIcons"));
-
- ti->set_tooltip(0,tt);
- ti->set_tooltip(1,tt);
-
- }
-
- return valid;
-}
-
-void ImportSettingsDialog::update_tree() {
-
- updating=true;
- tree->clear();
- edited=NULL;
-
-
- TreeItem *root = tree->create_item();
- EditorFileSystemDirectory *fs = EditorFileSystem::get_singleton()->get_filesystem();
-
- _generate_fs(root,fs);
- updating=false;
-
-
-}
-
-void ImportSettingsDialog::_notification(int p_what) {
-
- if (p_what==NOTIFICATION_ENTER_TREE) {
-
- EditorFileSystem::get_singleton()->connect("filesystem_changed",this,"update_tree");
- }
-}
-
-
-void ImportSettingsDialog::_bind_methods() {
-
- ObjectTypeDB::bind_method("update_tree",&ImportSettingsDialog::update_tree);
- ObjectTypeDB::bind_method("_item_edited",&ImportSettingsDialog::_item_edited);
- ObjectTypeDB::bind_method("_item_pressed",&ImportSettingsDialog::_item_pressed);
- ObjectTypeDB::bind_method("_button_pressed",&ImportSettingsDialog::_button_pressed);
-
-
-}
-
-
-void ImportSettingsDialog::popup_import_settings() {
-
- update_tree();
- popup_centered_ratio();
-}
-
-void ImportSettingsDialog::ok_pressed() {
-
-
- TreeItem *ti = tree->get_selected();
- if (!ti)
- return;
-
- String path = ti->get_metadata(0);
- print_line("PATH: "+path);
- Ref<ResourceImportMetadata> rimd = ResourceLoader::load_import_metadata(path);
- ERR_FAIL_COND(rimd.is_null());
- Ref<EditorImportPlugin> rimp = EditorImportExport::get_singleton()->get_import_plugin_by_name(rimd->get_editor());
- ERR_FAIL_COND(!rimp.is_valid());
- rimp->import_dialog(path);
- hide();
-
-
-}
-
-ImportSettingsDialog::ImportSettingsDialog(EditorNode *p_editor) {
-
- editor=p_editor;
-
- get_ok()->set_text(TTR("Close"));
-
- tree = memnew( Tree );
- add_child(tree);
- set_child_rect(tree);
- set_title(TTR("Imported Resources"));
-
-// texformat="Keep,None,Disk,VRAM";
-
- tree->set_hide_root(true);
- tree->set_columns(2);
- tree->set_column_expand(1,false);
- tree->set_column_min_width(1,20);
-
- tree->connect("item_edited",this,"_item_edited");
- tree->connect("button_pressed",this,"_button_pressed");
-
-// add_button("Re-Import","reimport");
- get_ok()->set_text(TTR("Re-Import"));
- get_cancel()->set_text(TTR("Close"));
-
- updating=false;
- edited=NULL;
- set_hide_on_ok(false);
-
-
-}
-
diff --git a/tools/editor/import_settings.h b/tools/editor/import_settings.h
deleted file mode 100644
index 5a383a1a1a..0000000000
--- a/tools/editor/import_settings.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*************************************************************************/
-/* import_settings.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* http://www.godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-#ifndef IMPORT_SETTINGS_H
-#define IMPORT_SETTINGS_H
-
-#include "object.h"
-#include "scene/gui/dialogs.h"
-#include "scene/gui/tree.h"
-#include "scene/gui/label.h"
-#include "scene/gui/option_button.h"
-#include "scene/gui/line_edit.h"
-#include "scene/gui/file_dialog.h"
-#include "scene/gui/progress_bar.h"
-#include "scene/gui/slider.h"
-#include "scene/gui/spin_box.h"
-#include "scene/resources/mesh.h"
-#include "editor_import_export.h"
-#include "editor_file_system.h"
-#include "editor_dir_dialog.h"
-class EditorNode;
-
-
-class ImportSettingsDialog : public ConfirmationDialog {
-
- OBJ_TYPE(ImportSettingsDialog,ConfirmationDialog);
-
- TreeItem *edited;
- EditorNode *editor;
- Tree *tree;
- bool updating;
-
- void _button_pressed(Object *p_button, int p_col, int p_id);
- void _item_pressed(int p_idx);
- bool _generate_fs(TreeItem *p_parent,EditorFileSystemDirectory *p_dir);
-
- String texformat;
-
- void _item_edited();
- virtual void ok_pressed();
-
-protected:
-
-
- void _notification(int p_what);
- static void _bind_methods();
-public:
-
- void update_tree();
-
-
- void popup_import_settings();
- ImportSettingsDialog(EditorNode *p_editor);
-
-};
-
-#endif // IMPORT_SETTINGS_H
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index aa0f52d574..d7d495ff5d 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -2411,6 +2411,8 @@ void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {
for(int i=0;i<scripts.size();i++) {
String path = scripts[i];
+ if (!FileAccess::exists(path))
+ continue;
Ref<Script> scr = ResourceLoader::load(path);
if (scr.is_valid()) {
edit(scr);
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index c46178345c..75c983994e 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -59,6 +59,9 @@ bool ScenesDock::_create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_di
item->select(0);
}
+ for(int i=0;i<p_dir->get_subdir_count();i++)
+ _create_tree(item,p_dir->get_subdir(i));
+
return true;
}