diff options
author | geequlim <geequlim@gmail.com> | 2017-06-25 17:20:01 +0800 |
---|---|---|
committer | geequlim <geequlim@gmail.com> | 2017-06-27 12:55:16 +0800 |
commit | 6687484958412ff0f3bd6d97cbc1fcebc7ae64d2 (patch) | |
tree | fdeae7b3668b0ff1d7c84f38741a9762d224f260 /editor/script_editor_debugger.cpp | |
parent | 87fd71244be7b185f0525c6b33850f7075b1425a (diff) |
Better user expirence with external text editors.
Implements open_in_external_editor for subclasses of ScriptLanguage.
Add option 'Debug with external editor' to debug menu to control the behavoir of script opened by editor.
Diffstat (limited to 'editor/script_editor_debugger.cpp')
-rw-r--r-- | editor/script_editor_debugger.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 6d22935dcb..9dce48937c 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1137,8 +1137,9 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() { Dictionary d = ti->get_metadata(0); - Ref<Script> s = ResourceLoader::load(d["file"]); - emit_signal("goto_script_line", s, int(d["line"]) - 1); + stack_script = ResourceLoader::load(d["file"]); + emit_signal("goto_script_line", stack_script, int(d["line"]) - 1); + stack_script.unref(); ERR_FAIL_COND(connection.is_null()); ERR_FAIL_COND(!connection->is_connected_to_host()); @@ -1522,6 +1523,21 @@ void ScriptEditorDebugger::set_hide_on_stop(bool p_hide) { hide_on_stop = p_hide; } +bool ScriptEditorDebugger::get_debug_with_external_editor() const { + + return enable_external_editor; +} + +void ScriptEditorDebugger::set_debug_with_external_editor(bool p_enabled) { + + enable_external_editor = p_enabled; +} + +Ref<Script> ScriptEditorDebugger::get_dump_stack_script() const { + + return stack_script; +} + void ScriptEditorDebugger::_paused() { ERR_FAIL_COND(connection.is_null()); @@ -1871,6 +1887,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { last_path_id = false; error_count = 0; hide_on_stop = true; + enable_external_editor = false; last_error_count = 0; EditorNode::get_singleton()->get_pause_button()->connect("pressed", this, "_paused"); |