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

@ -77,11 +77,11 @@ void AtlasTexture::set_atlas(const Ref<Texture2D> &p_atlas) {
}
// Support recursive AtlasTextures.
if (Ref<AtlasTexture>(atlas).is_valid()) {
atlas->disconnect(CoreStringNames::get_singleton()->changed, callable_mp((Resource *)this, &AtlasTexture::emit_changed));
atlas->disconnect_changed(callable_mp((Resource *)this, &AtlasTexture::emit_changed));
}
atlas = p_atlas;
if (Ref<AtlasTexture>(atlas).is_valid()) {
atlas->connect(CoreStringNames::get_singleton()->changed, callable_mp((Resource *)this, &AtlasTexture::emit_changed));
atlas->connect_changed(callable_mp((Resource *)this, &AtlasTexture::emit_changed));
}
emit_changed();