MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / popup_connections

Method popup_connections

editor/script/script_text_editor.cpp:65–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void ConnectionInfoDialog::popup_connections(const String &p_method, const Vector<Node *> &p_nodes) {
66 method->set_text(p_method);
67
68 tree->clear();
69 TreeItem *root = tree->create_item();
70
71 for (int i = 0; i < p_nodes.size(); i++) {
72 List<Connection> all_connections;
73 p_nodes[i]->get_signals_connected_to_this(&all_connections);
74
75 for (const Connection &connection : all_connections) {
76 if (connection.callable.get_method() != p_method) {
77 continue;
78 }
79
80 TreeItem *node_item = tree->create_item(root);
81
82 node_item->set_text(0, Object::cast_to<Node>(connection.signal.get_object())->get_name());
83 node_item->set_icon(0, EditorNode::get_singleton()->get_object_icon(connection.signal.get_object(), "Node"));
84 node_item->set_selectable(0, false);
85 node_item->set_editable(0, false);
86
87 node_item->set_text(1, connection.signal.get_name());
88 Control *p = Object::cast_to<Control>(get_parent());
89 node_item->set_icon(1, p->get_editor_theme_icon(SNAME("Slot")));
90 node_item->set_selectable(1, false);
91 node_item->set_editable(1, false);
92
93 node_item->set_text(2, Object::cast_to<Node>(connection.callable.get_object())->get_name());
94 node_item->set_icon(2, EditorNode::get_singleton()->get_object_icon(connection.callable.get_object(), "Node"));
95 node_item->set_selectable(2, false);
96 node_item->set_editable(2, false);
97 }
98 }
99
100 popup_centered(Size2(600, 300) * EDSCALE);
101}
102
103ConnectionInfoDialog::ConnectionInfoDialog() {
104 set_title(TTRC("Connections to method:"));

Callers 1

_gutter_clickedMethod · 0.80

Calls 13

get_object_iconMethod · 0.80
sizeMethod · 0.65
set_textMethod · 0.45
clearMethod · 0.45
create_itemMethod · 0.45
get_methodMethod · 0.45
get_nameMethod · 0.45
get_objectMethod · 0.45
set_iconMethod · 0.45
set_selectableMethod · 0.45
set_editableMethod · 0.45

Tested by

no test coverage detected