summaryrefslogtreecommitdiff
path: root/scene/animation/animation_node_state_machine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/animation/animation_node_state_machine.cpp')
-rw-r--r--scene/animation/animation_node_state_machine.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp
index 9c7dd7cdd7..fbd9a2aa7d 100644
--- a/scene/animation/animation_node_state_machine.cpp
+++ b/scene/animation/animation_node_state_machine.cpp
@@ -562,7 +562,7 @@ void AnimationNodeStateMachine::add_node(const StringName &p_name, Ref<Animation
emit_changed();
emit_signal("tree_changed");
- p_node->connect_compat("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED);
+ p_node->connect("tree_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed), varray(), CONNECT_REFERENCE_COUNTED);
}
Ref<AnimationNode> AnimationNodeStateMachine::get_node(const StringName &p_name) const {
@@ -611,7 +611,7 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) {
ERR_FAIL_COND(node.is_null());
- node->disconnect_compat("tree_changed", this, "_tree_changed");
+ node->disconnect("tree_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed));
}
states.erase(p_name);
@@ -619,7 +619,7 @@ void AnimationNodeStateMachine::remove_node(const StringName &p_name) {
for (int i = 0; i < transitions.size(); i++) {
if (transitions[i].from == p_name || transitions[i].to == p_name) {
- transitions.write[i].transition->disconnect_compat("advance_condition_changed", this, "_tree_changed");
+ transitions.write[i].transition->disconnect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed));
transitions.remove(i);
i--;
}
@@ -722,7 +722,7 @@ void AnimationNodeStateMachine::add_transition(const StringName &p_from, const S
tr.to = p_to;
tr.transition = p_transition;
- tr.transition->connect_compat("advance_condition_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED);
+ tr.transition->connect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed), varray(), CONNECT_REFERENCE_COUNTED);
transitions.push_back(tr);
}
@@ -750,7 +750,7 @@ void AnimationNodeStateMachine::remove_transition(const StringName &p_from, cons
for (int i = 0; i < transitions.size(); i++) {
if (transitions[i].from == p_from && transitions[i].to == p_to) {
- transitions.write[i].transition->disconnect_compat("advance_condition_changed", this, "_tree_changed");
+ transitions.write[i].transition->disconnect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed));
transitions.remove(i);
return;
}
@@ -764,7 +764,7 @@ void AnimationNodeStateMachine::remove_transition(const StringName &p_from, cons
void AnimationNodeStateMachine::remove_transition_by_index(int p_transition) {
ERR_FAIL_INDEX(p_transition, transitions.size());
- transitions.write[p_transition].transition->disconnect_compat("advance_condition_changed", this, "_tree_changed");
+ transitions.write[p_transition].transition->disconnect("advance_condition_changed", callable_mp(this, &AnimationNodeStateMachine::_tree_changed));
transitions.remove(p_transition);
/*if (playing) {
path.clear();
@@ -975,8 +975,6 @@ void AnimationNodeStateMachine::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_graph_offset", "offset"), &AnimationNodeStateMachine::set_graph_offset);
ClassDB::bind_method(D_METHOD("get_graph_offset"), &AnimationNodeStateMachine::get_graph_offset);
-
- ClassDB::bind_method(D_METHOD("_tree_changed"), &AnimationNodeStateMachine::_tree_changed);
}
AnimationNodeStateMachine::AnimationNodeStateMachine() {