summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2016-07-18 00:52:36 +0200
committerGitHub <noreply@github.com>2016-07-18 00:52:36 +0200
commit62eae7cbe25f3e2f5cf2cc3bd4cb8d13a6845ef3 (patch)
treef49bd157c22882a2013676b1f81411481492e1ea /tools/editor/plugins
parent8de5aedb9ef7d4c17027b41b40677d1892f4158c (diff)
parent2c9468a46ac7be81085baec4778fcbf3075b2c70 (diff)
Merge pull request #5723 from Paulb23/toggle_breakpoint_gutter_issue_5712
Fixed toggle breakpoint gutter not updating when the game is running, issue 5712
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp14
-rw-r--r--tools/editor/plugins/script_editor_plugin.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 12cdc22ae4..65741fd072 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -1013,6 +1013,18 @@ void ScriptEditor::swap_lines(TextEdit *tx, int line1, int line2)
tx->cursor_set_line(line2);
}
+void ScriptEditor::_breakpoint_toggled(const int p_row) {
+ int selected = tab_container->get_current_tab();
+ if (selected<0 || selected>=tab_container->get_child_count()) {
+ return;
+ }
+
+ ScriptTextEditor *current = tab_container->get_child(selected)->cast_to<ScriptTextEditor>();
+ if (current) {
+ get_debugger()->set_breakpoint(current->get_edited_script()->get_path(),p_row+1,current->get_text_edit()->is_line_set_as_breakpoint(p_row));
+ }
+}
+
void ScriptEditor::_file_dialog_action(String p_file) {
switch (file_dialog_option) {
@@ -2200,6 +2212,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script) {
ste->get_text_edit()->set_callhint_settings(
EditorSettings::get_singleton()->get("text_editor/put_callhint_tooltip_below_current_line"),
EditorSettings::get_singleton()->get("text_editor/callhint_tooltip_offset"));
+ ste->get_text_edit()->connect("breakpoint_toggled", this, "_breakpoint_toggled");
tab_container->add_child(ste);
_go_to_tab(tab_container->get_tab_count()-1);
@@ -2674,6 +2687,7 @@ void ScriptEditor::_bind_methods() {
ObjectTypeDB::bind_method("_res_saved_callback",&ScriptEditor::_res_saved_callback);
ObjectTypeDB::bind_method("_goto_script_line",&ScriptEditor::_goto_script_line);
ObjectTypeDB::bind_method("_goto_script_line2",&ScriptEditor::_goto_script_line2);
+ ObjectTypeDB::bind_method("_breakpoint_toggled", &ScriptEditor::_breakpoint_toggled);
ObjectTypeDB::bind_method("_breaked",&ScriptEditor::_breaked);
ObjectTypeDB::bind_method("_show_debugger",&ScriptEditor::_show_debugger);
ObjectTypeDB::bind_method("_get_debug_tooltip",&ScriptEditor::_get_debug_tooltip);
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 2e6e2c035c..dfa72490a5 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -321,6 +321,7 @@ public:
void get_breakpoints(List<String> *p_breakpoints);
void swap_lines(TextEdit *tx, int line1, int line2);
+ void _breakpoint_toggled(const int p_row);
void save_all_scripts();