From 6c4e1650fb8b7e06c8657ca1a5de167184fda6c0 Mon Sep 17 00:00:00 2001 From: Dana Olson Date: Sat, 10 Jan 2015 12:55:12 -0500 Subject: add option to automatically reload changed scripts --- tools/editor/plugins/script_editor_plugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 55957887dc..20aeb05a50 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -630,7 +630,10 @@ bool ScriptEditor::_test_script_times_on_disk() { if (!all_ok) - disk_changed->call_deferred("popup_centered_ratio",0.5); + if (bool(EDITOR_DEF("text_editor/autoreload_changed_scripts",false))) + script_editor->_reload_scripts(); + else + disk_changed->call_deferred("popup_centered_ratio",0.5); return all_ok; } -- cgit v1.2.3 From 2fd9292b12b6a5d8455ab3d7305ee55ebae64c9b Mon Sep 17 00:00:00 2001 From: Nathan Warden Date: Fri, 16 Jan 2015 23:17:12 -0500 Subject: Changed the "Start the scene (F5)." tooltip to say "Play the project (F5)." --- tools/editor/editor_node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index f859d19504..692eeb77b8 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -3552,7 +3552,7 @@ EditorNode::EditorNode() { play_button->set_icon(gui_base->get_icon("MainPlay","EditorIcons")); play_button->set_focus_mode(Control::FOCUS_NONE); play_button->connect("pressed", this,"_menu_option",make_binds(RUN_PLAY)); - play_button->set_tooltip("Start the scene (F5)."); + play_button->set_tooltip("Play the project (F5)."); -- cgit v1.2.3 From 5a4ef1c2cc400ff7fe67714435cadb070dc9cdd5 Mon Sep 17 00:00:00 2001 From: Dana Olson Date: Sat, 17 Jan 2015 14:05:26 -0500 Subject: fixes --- tools/editor/plugins/script_editor_plugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 20aeb05a50..3070079fa1 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -630,7 +630,7 @@ bool ScriptEditor::_test_script_times_on_disk() { if (!all_ok) - if (bool(EDITOR_DEF("text_editor/autoreload_changed_scripts",false))) + if (bool(EDITOR_DEF("text_editor/auto_reload_changed_scripts",false))) script_editor->_reload_scripts(); else disk_changed->call_deferred("popup_centered_ratio",0.5); @@ -1805,6 +1805,7 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { script_editor->hide(); + EDITOR_DEF("text_editor/auto_reload_changed_scripts",false); EDITOR_DEF("external_editor/use_external_editor",false); EDITOR_DEF("external_editor/exec_path",""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_GLOBAL_FILE)); -- cgit v1.2.3 From 92cc7b840eff99e90b64caad6883aefbe4c3dd1e Mon Sep 17 00:00:00 2001 From: Nathan Warden Date: Mon, 19 Jan 2015 15:47:50 -0500 Subject: Fixed a bug where a user could add a cyclical dependency, causing a crash. --- tools/editor/scene_tree_dock.cpp | 29 ++++++++++++++++++++++++++++- tools/editor/scene_tree_dock.h | 1 + 2 files changed, 29 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index cff3913579..d8d713ee40 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -79,7 +79,15 @@ Node* SceneTreeDock::instance(const String& p_file) { //accept->get_cancel()->hide(); accept->get_ok()->set_text("Ugh"); accept->set_text(String("Error loading scene from ")+p_file); - accept->popup_centered(Size2(300,70));; + accept->popup_centered(Size2(300,70)); + return NULL; + } + + if (_cyclical_dependency_exists(edited_scene->get_filename(), instanced_scene)) { + + accept->get_ok()->set_text("Ok"); + accept->set_text(String("Cannot instance the scene '")+p_file+String("' because the current scene exists within one of its' nodes.")); + accept->popup_centered(Size2(300,90)); return NULL; } @@ -100,6 +108,25 @@ Node* SceneTreeDock::instance(const String& p_file) { } +bool SceneTreeDock::_cyclical_dependency_exists(const String& p_target_scene_path, Node* p_desired_node) { + int childCount = p_desired_node->get_child_count(); + + if (p_desired_node->get_filename()==p_target_scene_path) { + return true; + } + + for (int i=0;iget_child(i); + + if(_cyclical_dependency_exists(p_target_scene_path,child)) { + return true; + } + } + + return false; +} + + static String _get_name_num_separator() { switch(EditorSettings::get_singleton()->get("scenetree_editor/duplicate_node_name_num_separator").operator int()) { case 0: return ""; diff --git a/tools/editor/scene_tree_dock.h b/tools/editor/scene_tree_dock.h index ac5391f3b9..92ebfc5bee 100644 --- a/tools/editor/scene_tree_dock.h +++ b/tools/editor/scene_tree_dock.h @@ -102,6 +102,7 @@ class SceneTreeDock : public VBoxContainer { void _load_request(const String& p_path); void _script_open_request(const Ref