Reworked signal connection system, added support for Callable and Signal objects and made them default.

This commit is contained in:
Juan Linietsky 2020-02-19 16:27:19 -03:00 committed by Juan Linietsky
parent 1a4be2cd8f
commit 69c95f4b4c
275 changed files with 3831 additions and 2948 deletions

View file

@ -531,11 +531,11 @@ void Sprite3D::set_texture(const Ref<Texture2D> &p_texture) {
if (p_texture == texture)
return;
if (texture.is_valid()) {
texture->disconnect(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update);
texture->disconnect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update);
}
texture = p_texture;
if (texture.is_valid()) {
texture->connect(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update);
texture->connect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update);
}
_queue_update();
}
@ -952,10 +952,10 @@ void AnimatedSprite3D::_notification(int p_what) {
void AnimatedSprite3D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
if (frames.is_valid())
frames->disconnect("changed", this, "_res_changed");
frames->disconnect_compat("changed", this, "_res_changed");
frames = p_frames;
if (frames.is_valid())
frames->connect("changed", this, "_res_changed");
frames->connect_compat("changed", this, "_res_changed");
if (!frames.is_valid()) {
frame = 0;