From 9bfa63496a6310a45ca337acf38f67361c89a6ec Mon Sep 17 00:00:00 2001 From: Rikhardur Bjarni Einarsson Date: Mon, 22 Apr 2019 17:20:27 +0100 Subject: Added a marker in text_edit that tells which row is executing. --- editor/code_editor.cpp | 8 ++++++++ editor/code_editor.h | 2 ++ editor/editor_settings.cpp | 1 + editor/editor_themes.cpp | 2 ++ editor/plugins/script_editor_plugin.cpp | 36 +++++++++++++++++++++++++++++++++ editor/plugins/script_editor_plugin.h | 4 ++++ editor/plugins/script_text_editor.cpp | 10 +++++++++ editor/plugins/script_text_editor.h | 2 ++ editor/plugins/shader_editor_plugin.cpp | 2 ++ editor/plugins/text_editor.cpp | 11 ++++++++++ editor/plugins/text_editor.h | 2 ++ editor/script_editor_debugger.cpp | 20 ++++++++++++++++++ editor/script_editor_debugger.h | 2 ++ 13 files changed, 102 insertions(+) (limited to 'editor') diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index a9ec776693..d655f52f5d 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1177,6 +1177,14 @@ void CodeTextEditor::goto_line_selection(int p_line, int p_begin, int p_end) { text_editor->select(p_line, p_begin, p_line, p_end); } +void CodeTextEditor::set_executing_line(int p_line) { + text_editor->set_executing_line(p_line); +} + +void CodeTextEditor::clear_executing_line() { + text_editor->clear_executing_line(); +} + Variant CodeTextEditor::get_edit_state() { Dictionary state; diff --git a/editor/code_editor.h b/editor/code_editor.h index e3dbfe1ce0..b98af377ce 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -217,6 +217,8 @@ public: void goto_line(int p_line); void goto_line_selection(int p_line, int p_begin, int p_end); + void set_executing_line(int p_line); + void clear_executing_line(); Variant get_edit_state(); void set_edit_state(const Variant &p_state); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 54bd9cae20..bf582ca004 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -645,6 +645,7 @@ void EditorSettings::_load_default_text_editor_theme() { _initial_set("text_editor/highlighting/member_variable_color", Color::html("e64e59")); _initial_set("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); _initial_set("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2)); + _initial_set("text_editor/highlighting/executing_line_color", Color(0.2, 0.8, 0.2, 0.4)); _initial_set("text_editor/highlighting/code_folding_color", Color(0.8, 0.8, 0.8, 0.8)); _initial_set("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1)); _initial_set("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1)); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 9641e10114..58c68e9234 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1114,6 +1114,7 @@ Ref create_editor_theme(const Ref p_theme) { const Color member_variable_color = main_color.linear_interpolate(mono_color, 0.6); const Color mark_color = Color(error_color.r, error_color.g, error_color.b, 0.3); const Color breakpoint_color = error_color; + const Color executing_line_color = Color(0.2, 0.8, 0.2, 0.4); const Color code_folding_color = alpha3; const Color search_result_color = alpha1; const Color search_result_border_color = alpha3; @@ -1149,6 +1150,7 @@ Ref create_editor_theme(const Ref p_theme) { setting->set_initial_value("text_editor/highlighting/member_variable_color", member_variable_color, true); setting->set_initial_value("text_editor/highlighting/mark_color", mark_color, true); setting->set_initial_value("text_editor/highlighting/breakpoint_color", breakpoint_color, true); + setting->set_initial_value("text_editor/highlighting/executing_line_color", executing_line_color, true); setting->set_initial_value("text_editor/highlighting/code_folding_color", code_folding_color, true); setting->set_initial_value("text_editor/highlighting/search_result_color", search_result_color, true); setting->set_initial_value("text_editor/highlighting/search_result_border_color", search_result_border_color, true); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 5d81ade214..d107304ff0 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -312,6 +312,38 @@ void ScriptEditor::_goto_script_line(REF p_script, int p_line) { } } +void ScriptEditor::_set_execution(REF p_script, int p_line) { + Ref