Unify and streamline connecting to Resource changes
This commit is contained in:
parent
2c55214068
commit
de4a3fa151
98 changed files with 341 additions and 434 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue