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 "button.h"
#include "core/core_string_names.h"
#include "core/string/translation.h"
#include "servers/rendering_server.h"
@@ -540,13 +539,13 @@ void Button::set_icon(const Ref<Texture2D> &p_icon) {
}
if (icon.is_valid()) {
icon->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Button::_texture_changed));
icon->disconnect_changed(callable_mp(this, &Button::_texture_changed));
}
icon = p_icon;
if (icon.is_valid()) {
icon->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Button::_texture_changed));
icon->connect_changed(callable_mp(this, &Button::_texture_changed));
}
queue_redraw();