diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-01 20:22:02 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-01 20:31:42 -0300 |
commit | 9e745b920fec25f1088ae0377a8d87a87136a5f7 (patch) | |
tree | 67c35840fb0eee8b380fafdbe46b696925d0f1fd /tools/editor | |
parent | 45752eaae4a97b93c794651aa1b8dfec3c4f4d95 (diff) |
Ability to reload scripts on running game
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/editor_node.cpp | 6 | ||||
-rw-r--r-- | tools/editor/editor_node.h | 1 | ||||
-rw-r--r-- | tools/editor/script_editor_debugger.cpp | 10 | ||||
-rw-r--r-- | tools/editor/script_editor_debugger.h | 2 |
4 files changed, 19 insertions, 0 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 40dce6cbaa..a0251936bd 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -2795,6 +2795,10 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { run_native->set_debug_navigation(!ischecked); editor_run.set_debug_navigation(!ischecked); } break; + case RUN_RELOAD_SCRIPTS: { + + ScriptEditor::get_singleton()->get_debugger()->reload_scripts(); + } break; case SETTINGS_UPDATE_ALWAYS: { update_menu->get_popup()->set_item_checked(0,true); @@ -5717,6 +5721,8 @@ EditorNode::EditorNode() { p->add_separator(); p->add_check_item(TTR("Visible Collision Shapes"),RUN_DEBUG_COLLISONS); p->add_check_item(TTR("Visible Navigation"),RUN_DEBUG_NAVIGATION); + p->add_separator(); + p->add_item(TTR("Reload Scripts"),RUN_RELOAD_SCRIPTS); p->connect("item_pressed",this,"_menu_option"); /* diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index e580931df3..5ffd7b964a 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -174,6 +174,7 @@ private: RUN_DEBUG_COLLISONS, RUN_DEBUG_NAVIGATION, RUN_DEPLOY_REMOTE_DEBUG, + RUN_RELOAD_SCRIPTS, SETTINGS_UPDATE_ALWAYS, SETTINGS_UPDATE_CHANGES, SETTINGS_IMPORT, diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 2f4846d63a..37a90ba7be 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -1573,6 +1573,16 @@ void ScriptEditorDebugger::set_breakpoint(const String& p_path,int p_line,bool p } +void ScriptEditorDebugger::reload_scripts() { + + if (connection.is_valid()) { + Array msg; + msg.push_back("reload_scripts"); + ppeer->put_var(msg); + } +} + + void ScriptEditorDebugger::_error_selected(int p_idx) { error_stack->clear(); diff --git a/tools/editor/script_editor_debugger.h b/tools/editor/script_editor_debugger.h index 128ca16173..c4a7cea1b7 100644 --- a/tools/editor/script_editor_debugger.h +++ b/tools/editor/script_editor_debugger.h @@ -217,6 +217,8 @@ public: void set_tool_button(Button *p_tb) { debugger_button=p_tb; } + void reload_scripts(); + virtual Size2 get_minimum_size() const; ScriptEditorDebugger(EditorNode *p_editor=NULL); ~ScriptEditorDebugger(); |