1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Signals: Manually port most of remaining connect_compat uses

It's tedious work...

Some can't be ported as they depend on private or protected methods
of different classes, which is not supported by callable_mp (even if
it's a class inherited by the current one).
This commit is contained in:
Rémi Verschelde
2020-02-21 23:26:13 +01:00
parent 01afc442c7
commit f742dabafe
50 changed files with 187 additions and 244 deletions

View File

@@ -1501,16 +1501,16 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
void AnimationPlayerEditor::_start_onion_skinning() {
// FIXME: Using "idle_frame" makes onion layers update one frame behind the current.
if (!get_tree()->is_connected_compat("idle_frame", this, "call_deferred")) {
get_tree()->connect_compat("idle_frame", this, "call_deferred", varray("_prepare_onion_layers_1"));
if (!get_tree()->is_connected("idle_frame", callable_mp((Object *)this, &Object::call_deferred))) {
get_tree()->connect("idle_frame", callable_mp((Object *)this, &Object::call_deferred), varray("_prepare_onion_layers_1"));
}
}
void AnimationPlayerEditor::_stop_onion_skinning() {
if (get_tree()->is_connected_compat("idle_frame", this, "call_deferred")) {
if (get_tree()->is_connected("idle_frame", callable_mp((Object *)this, &Object::call_deferred))) {
get_tree()->disconnect_compat("idle_frame", this, "call_deferred");
get_tree()->disconnect("idle_frame", callable_mp((Object *)this, &Object::call_deferred));
_free_onion_layers();