summaryrefslogtreecommitdiff
path: root/tools/editor/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp36
-rw-r--r--tools/editor/plugins/script_editor_plugin.h3
-rw-r--r--tools/editor/plugins/script_text_editor.cpp7
-rw-r--r--tools/editor/plugins/script_text_editor.h4
4 files changed, 46 insertions, 4 deletions
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 376c0daa68..74c8ac9766 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -285,6 +285,17 @@ void ScriptEditor::_breaked(bool p_breaked,bool p_can_debug) {
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_BREAK), p_breaked );
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_CONTINUE), !p_breaked );
+ for(int i=0;i<tab_container->get_child_count();i++) {
+
+ ScriptEditorBase *se = tab_container->get_child(i)->cast_to<ScriptEditorBase>();
+ if (!se) {
+
+ continue;
+ }
+
+ se->set_debugger_active(p_breaked);
+ }
+
}
void ScriptEditor::_show_debugger(bool p_show) {
@@ -315,7 +326,16 @@ void ScriptEditor::_goto_script_line(REF p_script,int p_line) {
editor->push_item(p_script.ptr());
- _goto_script_line2(p_line);
+
+ int selected = tab_container->get_current_tab();
+ if (selected<0 || selected>=tab_container->get_child_count())
+ return;
+
+ ScriptEditorBase *current = tab_container->get_child(selected)->cast_to<ScriptEditorBase>();
+ if (!current)
+ return;
+
+ current->goto_line(p_line,true);
}
@@ -1133,6 +1153,7 @@ void ScriptEditor::clear() {
void ScriptEditor::get_breakpoints(List<String> *p_breakpoints) {
+
for(int i=0;i<tab_container->get_child_count();i++) {
ScriptEditorBase *se = tab_container->get_child(i)->cast_to<ScriptEditorBase>();
@@ -1500,6 +1521,8 @@ void ScriptEditor::save_all_scripts() {
}
+ _update_script_names();
+
}
void ScriptEditor::apply_scripts() const {
@@ -1536,6 +1559,17 @@ void ScriptEditor::_editor_stop() {
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_STEP), true );
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_BREAK), true );
debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_CONTINUE), true );
+
+ for(int i=0;i<tab_container->get_child_count();i++) {
+
+ ScriptEditorBase *se = tab_container->get_child(i)->cast_to<ScriptEditorBase>();
+ if (!se) {
+
+ continue;
+ }
+
+ se->set_debugger_active(false);
+ }
}
diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h
index 03176545ac..5cb70e13d7 100644
--- a/tools/editor/plugins/script_editor_plugin.h
+++ b/tools/editor/plugins/script_editor_plugin.h
@@ -91,7 +91,7 @@ public:
virtual bool is_unsaved()=0;
virtual Variant get_edit_state()=0;
virtual void set_edit_state(const Variant& p_state)=0;
- virtual void goto_line(int p_line)=0;
+ virtual void goto_line(int p_line,bool p_with_error=false)=0;
virtual void trim_trailing_whitespace()=0;
virtual void ensure_focus()=0;
virtual void tag_saved_version()=0;
@@ -100,6 +100,7 @@ public:
virtual bool goto_method(const String& p_method)=0;
virtual void add_callback(const String& p_function,StringArray p_args)=0;
virtual void update_settings()=0;
+ virtual void set_debugger_active(bool p_active)=0;
virtual void set_tooltip_request_func(String p_method,Object* p_obj)=0;
virtual Control *get_edit_menu()=0;
diff --git a/tools/editor/plugins/script_text_editor.cpp b/tools/editor/plugins/script_text_editor.cpp
index 92f1148435..57cf8cbea3 100644
--- a/tools/editor/plugins/script_text_editor.cpp
+++ b/tools/editor/plugins/script_text_editor.cpp
@@ -312,7 +312,7 @@ void ScriptTextEditor::tag_saved_version() {
code_editor->get_text_edit()->tag_saved_version();
}
-void ScriptTextEditor::goto_line(int p_line) {
+void ScriptTextEditor::goto_line(int p_line, bool p_with_error) {
code_editor->get_text_edit()->cursor_set_line(p_line);
}
@@ -952,6 +952,11 @@ void ScriptTextEditor::set_tooltip_request_func(String p_method,Object* p_obj) {
code_editor->get_text_edit()->set_tooltip_request_func(p_obj,p_method,this);
}
+void ScriptTextEditor::set_debugger_active(bool p_active) {
+
+
+}
+
ScriptTextEditor::ScriptTextEditor() {
code_editor = memnew( CodeTextEditor );
diff --git a/tools/editor/plugins/script_text_editor.h b/tools/editor/plugins/script_text_editor.h
index ad927c5725..247fd97e81 100644
--- a/tools/editor/plugins/script_text_editor.h
+++ b/tools/editor/plugins/script_text_editor.h
@@ -115,7 +115,7 @@ public:
virtual void trim_trailing_whitespace();
virtual void tag_saved_version();
- virtual void goto_line(int p_line);
+ virtual void goto_line(int p_line,bool p_with_error=false);
virtual void reload(bool p_soft);
virtual void get_breakpoints(List<int> *p_breakpoints);
@@ -126,6 +126,8 @@ public:
virtual void set_tooltip_request_func(String p_method,Object* p_obj);
+ virtual void set_debugger_active(bool p_active);
+
Control *get_edit_menu();
static void register_editor();