Unify and streamline connecting to Resource changes

This commit is contained in:
kobewi 2023-07-03 21:29:37 +02:00
parent 2c55214068
commit de4a3fa151
98 changed files with 341 additions and 434 deletions

View file

@ -30,7 +30,6 @@
#include "texture_rect.h"
#include "core/core_string_names.h"
#include "scene/resources/atlas_texture.h"
#include "servers/rendering_server.h"
@ -202,13 +201,13 @@ void TextureRect::set_texture(const Ref<Texture2D> &p_tex) {
}
if (texture.is_valid()) {
texture->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &TextureRect::_texture_changed));
texture->disconnect_changed(callable_mp(this, &TextureRect::_texture_changed));
}
texture = p_tex;
if (texture.is_valid()) {
texture->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &TextureRect::_texture_changed));
texture->connect_changed(callable_mp(this, &TextureRect::_texture_changed));
}
queue_redraw();