Fix Can't reopen signals panel immediately after connecting a signal #92996
This commit is contained in:
parent
475248d99d
commit
64ba2cf3a9
|
@ -981,7 +981,6 @@ void ConnectionsDock::_make_or_edit_connection() {
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorNode::get_singleton()->emit_signal(SNAME("script_add_function_request"), target, cd.method, script_function_args);
|
EditorNode::get_singleton()->emit_signal(SNAME("script_add_function_request"), target, cd.method, script_function_args);
|
||||||
hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update_tree();
|
update_tree();
|
||||||
|
@ -1607,7 +1606,6 @@ ConnectionsDock::ConnectionsDock() {
|
||||||
connect_button->connect(SceneStringName(pressed), callable_mp(this, &ConnectionsDock::_connect_pressed));
|
connect_button->connect(SceneStringName(pressed), callable_mp(this, &ConnectionsDock::_connect_pressed));
|
||||||
|
|
||||||
connect_dialog = memnew(ConnectDialog);
|
connect_dialog = memnew(ConnectDialog);
|
||||||
connect_dialog->connect("connected", callable_mp(NodeDock::get_singleton(), &NodeDock::restore_last_valid_node), CONNECT_DEFERRED);
|
|
||||||
connect_dialog->set_process_shortcut_input(true);
|
connect_dialog->set_process_shortcut_input(true);
|
||||||
add_child(connect_dialog);
|
add_child(connect_dialog);
|
||||||
|
|
||||||
|
|
|
@ -2304,6 +2304,12 @@ void EditorNode::push_item(Object *p_object, const String &p_property, bool p_in
|
||||||
_edit_current();
|
_edit_current();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditorNode::edit_previous_item() {
|
||||||
|
if (editor_history.previous()) {
|
||||||
|
_edit_current();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EditorNode::push_item_no_inspector(Object *p_object) {
|
void EditorNode::push_item_no_inspector(Object *p_object) {
|
||||||
_add_to_history(p_object, "", false);
|
_add_to_history(p_object, "", false);
|
||||||
_edit_current(false, true);
|
_edit_current(false, true);
|
||||||
|
|
|
@ -764,6 +764,7 @@ public:
|
||||||
|
|
||||||
void push_item(Object *p_object, const String &p_property = "", bool p_inspector_only = false);
|
void push_item(Object *p_object, const String &p_property = "", bool p_inspector_only = false);
|
||||||
void push_item_no_inspector(Object *p_object);
|
void push_item_no_inspector(Object *p_object);
|
||||||
|
void edit_previous_item();
|
||||||
void edit_item(Object *p_object, Object *p_editing_owner);
|
void edit_item(Object *p_object, Object *p_editing_owner);
|
||||||
void push_node_item(Node *p_node);
|
void push_node_item(Node *p_node);
|
||||||
void hide_unused_editors(const Object *p_editing_owner = nullptr);
|
void hide_unused_editors(const Object *p_editing_owner = nullptr);
|
||||||
|
|
|
@ -67,23 +67,11 @@ void NodeDock::update_lists() {
|
||||||
connections->update_tree();
|
connections->update_tree();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeDock::_on_node_tree_exited() {
|
|
||||||
set_node(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NodeDock::set_node(Node *p_node) {
|
void NodeDock::set_node(Node *p_node) {
|
||||||
if (last_valid_node) {
|
|
||||||
last_valid_node->disconnect(SceneStringName(tree_exited), callable_mp(this, &NodeDock::_on_node_tree_exited));
|
|
||||||
last_valid_node = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
connections->set_node(p_node);
|
connections->set_node(p_node);
|
||||||
groups->set_current(p_node);
|
groups->set_current(p_node);
|
||||||
|
|
||||||
if (p_node) {
|
if (p_node) {
|
||||||
last_valid_node = p_node;
|
|
||||||
last_valid_node->connect(SceneStringName(tree_exited), callable_mp(this, &NodeDock::_on_node_tree_exited));
|
|
||||||
|
|
||||||
if (connections_button->is_pressed()) {
|
if (connections_button->is_pressed()) {
|
||||||
connections->show();
|
connections->show();
|
||||||
} else {
|
} else {
|
||||||
|
@ -100,10 +88,6 @@ void NodeDock::set_node(Node *p_node) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeDock::restore_last_valid_node() {
|
|
||||||
set_node(last_valid_node);
|
|
||||||
}
|
|
||||||
|
|
||||||
NodeDock::NodeDock() {
|
NodeDock::NodeDock() {
|
||||||
singleton = this;
|
singleton = this;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ class NodeDock : public VBoxContainer {
|
||||||
HBoxContainer *mode_hb = nullptr;
|
HBoxContainer *mode_hb = nullptr;
|
||||||
|
|
||||||
Label *select_a_node = nullptr;
|
Label *select_a_node = nullptr;
|
||||||
Node *last_valid_node = nullptr;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static NodeDock *singleton;
|
static NodeDock *singleton;
|
||||||
|
@ -58,11 +57,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
void _on_node_tree_exited();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_node(Node *p_node);
|
void set_node(Node *p_node);
|
||||||
void restore_last_valid_node();
|
|
||||||
|
|
||||||
void show_groups();
|
void show_groups();
|
||||||
void show_connections();
|
void show_connections();
|
||||||
|
|
|
@ -2856,6 +2856,10 @@ void ScriptEditor::_add_callback(Object *p_obj, const String &p_function, const
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Move back to the previously edited node to reselect it in the Inspector and the NodeDock.
|
||||||
|
// We assume that the previous item is the node on which the callbacks were added.
|
||||||
|
EditorNode::get_singleton()->edit_previous_item();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptEditor::_save_editor_state(ScriptEditorBase *p_editor) {
|
void ScriptEditor::_save_editor_state(ScriptEditorBase *p_editor) {
|
||||||
|
|
|
@ -2696,6 +2696,7 @@ void SceneTreeDock::_delete_confirm(bool p_cut) {
|
||||||
editor_history->cleanup_history();
|
editor_history->cleanup_history();
|
||||||
InspectorDock::get_singleton()->call("_prepare_history");
|
InspectorDock::get_singleton()->call("_prepare_history");
|
||||||
InspectorDock::get_singleton()->update(nullptr);
|
InspectorDock::get_singleton()->update(nullptr);
|
||||||
|
NodeDock::get_singleton()->set_node(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneTreeDock::_update_script_button() {
|
void SceneTreeDock::_update_script_button() {
|
||||||
|
|
Loading…
Reference in New Issue