Reworked signal connection system, added support for Callable and Signal objects and made them default.
This commit is contained in:
committed by
Juan Linietsky
parent
1a4be2cd8f
commit
69c95f4b4c
@ -118,7 +118,7 @@ void AnimationNodeBlendSpace1D::add_blend_point(const Ref<AnimationRootNode> &p_
|
||||
blend_points[p_at_index].node = p_node;
|
||||
blend_points[p_at_index].position = p_position;
|
||||
|
||||
blend_points[p_at_index].node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED);
|
||||
blend_points[p_at_index].node->connect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED);
|
||||
|
||||
blend_points_used++;
|
||||
emit_signal("tree_changed");
|
||||
@ -135,11 +135,11 @@ void AnimationNodeBlendSpace1D::set_blend_point_node(int p_point, const Ref<Anim
|
||||
ERR_FAIL_COND(p_node.is_null());
|
||||
|
||||
if (blend_points[p_point].node.is_valid()) {
|
||||
blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed");
|
||||
blend_points[p_point].node->disconnect_compat("tree_changed", this, "_tree_changed");
|
||||
}
|
||||
|
||||
blend_points[p_point].node = p_node;
|
||||
blend_points[p_point].node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED);
|
||||
blend_points[p_point].node->connect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED);
|
||||
|
||||
emit_signal("tree_changed");
|
||||
}
|
||||
@ -158,7 +158,7 @@ void AnimationNodeBlendSpace1D::remove_blend_point(int p_point) {
|
||||
ERR_FAIL_INDEX(p_point, blend_points_used);
|
||||
|
||||
ERR_FAIL_COND(blend_points[p_point].node.is_null());
|
||||
blend_points[p_point].node->disconnect("tree_changed", this, "_tree_changed");
|
||||
blend_points[p_point].node->disconnect_compat("tree_changed", this, "_tree_changed");
|
||||
|
||||
for (int i = p_point; i < blend_points_used - 1; i++) {
|
||||
blend_points[i] = blend_points[i + 1];
|
||||
|
||||
Reference in New Issue
Block a user