Use Core/Scene stringnames consistently
This commit is contained in:
@ -601,7 +601,7 @@ void GraphEdit::add_child_notify(Node *p_child) {
|
||||
GraphNode *graph_node = Object::cast_to<GraphNode>(graph_element);
|
||||
if (graph_node) {
|
||||
graph_node->connect("slot_updated", callable_mp(this, &GraphEdit::_graph_node_slot_updated).bind(graph_element));
|
||||
graph_node->connect("item_rect_changed", callable_mp(this, &GraphEdit::_graph_node_rect_changed).bind(graph_node));
|
||||
graph_node->connect(SceneStringName(item_rect_changed), callable_mp(this, &GraphEdit::_graph_node_rect_changed).bind(graph_node));
|
||||
_ensure_node_order_from(graph_node);
|
||||
}
|
||||
|
||||
@ -618,8 +618,8 @@ void GraphEdit::add_child_notify(Node *p_child) {
|
||||
}
|
||||
graph_element->connect("raise_request", callable_mp(this, &GraphEdit::_ensure_node_order_from).bind(graph_element));
|
||||
graph_element->connect("resize_request", callable_mp(this, &GraphEdit::_graph_element_resize_request).bind(graph_element));
|
||||
graph_element->connect("item_rect_changed", callable_mp((CanvasItem *)connections_layer, &CanvasItem::queue_redraw));
|
||||
graph_element->connect("item_rect_changed", callable_mp((CanvasItem *)minimap, &GraphEditMinimap::queue_redraw));
|
||||
graph_element->connect(SceneStringName(item_rect_changed), callable_mp((CanvasItem *)connections_layer, &CanvasItem::queue_redraw));
|
||||
graph_element->connect(SceneStringName(item_rect_changed), callable_mp((CanvasItem *)minimap, &GraphEditMinimap::queue_redraw));
|
||||
|
||||
graph_element->set_scale(Vector2(zoom, zoom));
|
||||
_graph_element_moved(graph_element);
|
||||
@ -651,7 +651,7 @@ void GraphEdit::remove_child_notify(Node *p_child) {
|
||||
GraphNode *graph_node = Object::cast_to<GraphNode>(graph_element);
|
||||
if (graph_node) {
|
||||
graph_node->disconnect("slot_updated", callable_mp(this, &GraphEdit::_graph_node_slot_updated));
|
||||
graph_node->disconnect("item_rect_changed", callable_mp(this, &GraphEdit::_graph_node_rect_changed));
|
||||
graph_node->disconnect(SceneStringName(item_rect_changed), callable_mp(this, &GraphEdit::_graph_node_rect_changed));
|
||||
|
||||
// Invalidate all adjacent connections, so that they are removed before the next redraw.
|
||||
for (const Ref<Connection> &conn : connection_map[graph_node->get_name()]) {
|
||||
@ -692,7 +692,7 @@ void GraphEdit::remove_child_notify(Node *p_child) {
|
||||
|
||||
// In case of the whole GraphEdit being destroyed these references can already be freed.
|
||||
if (minimap != nullptr && minimap->is_inside_tree()) {
|
||||
graph_element->disconnect("item_rect_changed", callable_mp((CanvasItem *)minimap, &GraphEditMinimap::queue_redraw));
|
||||
graph_element->disconnect(SceneStringName(item_rect_changed), callable_mp((CanvasItem *)minimap, &GraphEditMinimap::queue_redraw));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2757,12 +2757,12 @@ GraphEdit::GraphEdit() {
|
||||
add_child(top_layer, false, INTERNAL_MODE_BACK);
|
||||
top_layer->set_mouse_filter(MOUSE_FILTER_IGNORE);
|
||||
top_layer->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||
top_layer->connect("draw", callable_mp(this, &GraphEdit::_top_layer_draw));
|
||||
top_layer->connect("focus_exited", callable_mp(panner.ptr(), &ViewPanner::release_pan_key));
|
||||
top_layer->connect(SceneStringName(draw), callable_mp(this, &GraphEdit::_top_layer_draw));
|
||||
top_layer->connect(SceneStringName(focus_exited), callable_mp(panner.ptr(), &ViewPanner::release_pan_key));
|
||||
|
||||
connections_layer = memnew(Control);
|
||||
add_child(connections_layer, false);
|
||||
connections_layer->connect("draw", callable_mp(this, &GraphEdit::_update_connections));
|
||||
connections_layer->connect(SceneStringName(draw), callable_mp(this, &GraphEdit::_update_connections));
|
||||
connections_layer->set_name("_connection_layer");
|
||||
connections_layer->set_disable_visibility_clip(true); // Necessary, so it can draw freely and be offset.
|
||||
connections_layer->set_mouse_filter(MOUSE_FILTER_IGNORE);
|
||||
@ -2774,7 +2774,7 @@ GraphEdit::GraphEdit() {
|
||||
|
||||
top_connection_layer->set_mouse_filter(MOUSE_FILTER_PASS);
|
||||
top_connection_layer->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
|
||||
top_connection_layer->connect("gui_input", callable_mp(this, &GraphEdit::_top_connection_layer_input));
|
||||
top_connection_layer->connect(SceneStringName(gui_input), callable_mp(this, &GraphEdit::_top_connection_layer_input));
|
||||
|
||||
dragged_connection_line = memnew(Line2D);
|
||||
dragged_connection_line->set_texture_mode(Line2D::LINE_TEXTURE_STRETCH);
|
||||
@ -2911,7 +2911,7 @@ GraphEdit::GraphEdit() {
|
||||
minimap->set_offset(Side::SIDE_TOP, -minimap_size.height - MINIMAP_OFFSET);
|
||||
minimap->set_offset(Side::SIDE_RIGHT, -MINIMAP_OFFSET);
|
||||
minimap->set_offset(Side::SIDE_BOTTOM, -MINIMAP_OFFSET);
|
||||
minimap->connect("draw", callable_mp(this, &GraphEdit::_minimap_draw));
|
||||
minimap->connect(SceneStringName(draw), callable_mp(this, &GraphEdit::_minimap_draw));
|
||||
|
||||
set_clip_contents(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user