diff options
-rw-r--r-- | editor/code_editor.cpp | 5 | ||||
-rw-r--r-- | editor/code_editor.h | 2 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.h | 2 | ||||
-rw-r--r-- | editor/plugins/text_editor.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/text_editor.h | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 3 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.h | 1 |
10 files changed, 25 insertions, 1 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index ec984e480a..3cc1b8bd87 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1302,11 +1302,14 @@ void CodeTextEditor::_on_settings_change() { } void CodeTextEditor::_text_changed_idle_timeout() { - _validate_script(); emit_signal("validate_script"); } +void CodeTextEditor::validate_script() { + idle->start(); +} + void CodeTextEditor::_warning_label_gui_input(const Ref<InputEvent> &p_event) { Ref<InputEventMouseButton> mb = p_event; if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { diff --git a/editor/code_editor.h b/editor/code_editor.h index b98af377ce..c0a4c2c363 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -236,6 +236,8 @@ public: void set_code_complete_func(CodeTextEditorCodeCompleteFunc p_code_complete_func, void *p_ud); + void validate_script(); + CodeTextEditor(); }; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 92579e5cef..a774abf247 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -429,6 +429,8 @@ void ScriptEditor::_go_to_tab(int p_idx) { if (script != NULL) { notify_script_changed(script); } + + Object::cast_to<ScriptEditorBase>(c)->validate(); } if (Object::cast_to<EditorHelp>(c)) { diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 683fa881f8..edea7e6322 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -116,6 +116,8 @@ public: virtual Control *get_edit_menu() = 0; virtual void clear_edit_menu() = 0; + virtual void validate() = 0; + ScriptEditorBase() {} }; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index d40e67cc8c..80f4376bce 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1744,3 +1744,7 @@ void ScriptTextEditor::register_editor() { ScriptEditor::register_create_script_editor_function(create_editor); } + +void ScriptTextEditor::validate() { + this->code_editor->validate_script(); +} diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h index 0dbc884594..2985659feb 100644 --- a/editor/plugins/script_text_editor.h +++ b/editor/plugins/script_text_editor.h @@ -215,6 +215,8 @@ public: virtual void clear_edit_menu(); static void register_editor(); + virtual void validate(); + ScriptTextEditor(); }; diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index becaae3567..b3fdd4b7cd 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -622,3 +622,6 @@ TextEditor::TextEditor() { code_editor->get_text_edit()->set_drag_forwarding(this); } + +void TextEditor::validate() { +} diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h index 767001e2f6..7d02379371 100644 --- a/editor/plugins/text_editor.h +++ b/editor/plugins/text_editor.h @@ -140,6 +140,8 @@ public: virtual Control *get_edit_menu(); virtual void clear_edit_menu(); + virtual void validate(); + static void register_editor(); TextEditor(); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 4f6828bf1c..4eadda6a1e 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -3754,4 +3754,7 @@ void _VisualScriptEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("remove_custom_node", "name", "category"), &_VisualScriptEditor::remove_custom_node); ADD_SIGNAL(MethodInfo("custom_nodes_updated")); } + +void VisualScriptEditor::validate() { +} #endif diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 3d3a49f672..744c4c6e87 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -280,6 +280,7 @@ public: virtual Control *get_edit_menu(); virtual void clear_edit_menu(); virtual bool can_lose_focus_on_node_selection() { return false; } + virtual void validate(); static void register_editor(); |