summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-03 12:34:11 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-03 12:34:25 -0300
commit2ca4995a6f934b9d849679e3bbcf5722d5e238f0 (patch)
tree7d1d8712256f67dc191201595b3f95ac66ff3f87 /tools/editor/plugins
parenta0a16aec3ae3a1df90ef8b5d1f041eca5e476f08 (diff)
Cleaned up remote menu
-Merged fileserver & deploy dumb clients option -Live Script Reloading can now happen automatically on script save -Changed Live to Mirror term to differentiate from Unity and Unreal, as what Godot does is not the same thing.
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp21
-rw-r--r--tools/editor/plugins/script_editor_plugin.h6
2 files changed, 27 insertions, 0 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 2453ff3190..39b350eb4e 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -887,8 +887,19 @@ void ScriptEditor::_res_saved_callback(const Ref<Resource>& p_res) {
_update_script_names();
+
+ if (!pending_auto_reload && auto_reload_running_scripts) {
+ call_deferred("_live_auto_reload_running_scripts");
+ pending_auto_reload=true;
+ }
+}
+
+void ScriptEditor::_live_auto_reload_running_scripts() {
+ pending_auto_reload=false;
+ debugger->reload_scripts();
}
+
bool ScriptEditor::_test_script_times_on_disk() {
@@ -2475,6 +2486,11 @@ void ScriptEditor::set_scene_root_script( Ref<Script> p_script ) {
}
}
+void ScriptEditor::set_live_auto_reload_running_scripts(bool p_enabled) {
+
+ auto_reload_running_scripts=p_enabled;
+}
+
void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_file_dialog_action",&ScriptEditor::_file_dialog_action);
@@ -2505,6 +2521,8 @@ void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_request_help",&ScriptEditor::_help_class_open);
ObjectTypeDB::bind_method("_history_forward",&ScriptEditor::_history_forward);
ObjectTypeDB::bind_method("_history_back",&ScriptEditor::_history_back);
+ ObjectTypeDB::bind_method("_live_auto_reload_running_scripts",&ScriptEditor::_live_auto_reload_running_scripts);
+
}
ScriptEditor::ScriptEditor(EditorNode *p_editor) {
@@ -2514,6 +2532,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
completion_cache = memnew( EditorScriptCodeCompletionCache );
restoring_layout=false;
waiting_update_names=false;
+ auto_reload_running_scripts=false;
editor=p_editor;
menu_hb = memnew( HBoxContainer );
@@ -2875,6 +2894,8 @@ void ScriptEditorPlugin::edited_scene_changed() {
script_editor->edited_scene_changed();
}
+
+
ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
editor=p_node;
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index cbcfd9a77e..4eb3519059 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -236,6 +236,10 @@ class ScriptEditor : public VBoxContainer {
bool grab_focus_block;
+ bool pending_auto_reload;
+ bool auto_reload_running_scripts;
+ void _live_auto_reload_running_scripts();
+
ScriptEditorQuickOpen *quick_open;
EditorScriptCodeCompletionCache *completion_cache;
@@ -322,6 +326,7 @@ public:
virtual void edited_scene_changed();
ScriptEditorDebugger *get_debugger() { return debugger; }
+ void set_live_auto_reload_running_scripts(bool p_enabled);
ScriptEditor(EditorNode *p_editor);
~ScriptEditor();
@@ -357,6 +362,7 @@ public:
virtual void get_breakpoints(List<String> *p_breakpoints);
+
virtual void edited_scene_changed();
ScriptEditorPlugin(EditorNode *p_node);