From b20952ebfff216acc07f6bbcad35b5a1e97a310c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 18 Aug 2017 16:43:23 -0300 Subject: [PATCH] Update script signals in real-time when script changes. Fixes #8980 --- editor/connections_dialog.h | 3 +-- editor/node_dock.cpp | 5 +++++ editor/node_dock.h | 2 ++ editor/plugins/script_editor_plugin.cpp | 10 +++++++++- editor/plugins/script_editor_plugin.h | 1 + editor/plugins/script_text_editor.cpp | 1 + modules/visual_script/visual_script_editor.cpp | 13 ++++++++++++- 7 files changed, 31 insertions(+), 4 deletions(-) diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index bff85941cbe..849bb880d42 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -103,8 +103,6 @@ class ConnectionsDock : public VBoxContainer { ConfirmationDialog *remove_confirm; ConnectDialog *connect_dialog; - void update_tree(); - void _close(); void _connect(); void _something_selected(); @@ -121,6 +119,7 @@ public: void set_node(Node *p_node); String get_selected_type(); + void update_tree(); ConnectionsDock(EditorNode *p_editor = NULL); ~ConnectionsDock(); diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index 0f3f4b96f5d..b1a538ed2ee 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -63,6 +63,11 @@ void NodeDock::_notification(int p_what) { NodeDock *NodeDock::singleton = NULL; +void NodeDock::update_lists() { + + connections->update_tree(); +} + void NodeDock::set_node(Node *p_node) { connections->set_node(p_node); diff --git a/editor/node_dock.h b/editor/node_dock.h index 0af65719c9f..29e5dc5169c 100644 --- a/editor/node_dock.h +++ b/editor/node_dock.h @@ -59,6 +59,8 @@ public: void show_groups(); void show_connections(); + void update_lists(); + NodeDock(); }; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 1873a3f58bf..fc89a4b9b43 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -34,18 +34,19 @@ #include "editor/script_editor_debugger.h" #include "io/resource_loader.h" #include "io/resource_saver.h" +#include "node_dock.h" #include "os/file_access.h" #include "os/input.h" #include "os/keyboard.h" #include "os/os.h" #include "project_settings.h" #include "scene/main/viewport.h" - /*** SCRIPT EDITOR ****/ void ScriptEditorBase::_bind_methods() { ADD_SIGNAL(MethodInfo("name_changed")); + ADD_SIGNAL(MethodInfo("script_changed")); ADD_SIGNAL(MethodInfo("request_help_search", PropertyInfo(Variant::STRING, "topic"))); ADD_SIGNAL(MethodInfo("request_help_index")); ADD_SIGNAL(MethodInfo("request_open_script_at_line", PropertyInfo(Variant::OBJECT, "script"), PropertyInfo(Variant::INT, "line"))); @@ -1714,6 +1715,7 @@ bool ScriptEditor::edit(const Ref