Unify and streamline connecting to Resource changes
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
|
||||
#include "nine_patch_rect.h"
|
||||
|
||||
#include "core/core_string_names.h"
|
||||
#include "scene/scene_string_names.h"
|
||||
#include "servers/rendering_server.h"
|
||||
|
||||
@@ -101,13 +100,13 @@ void NinePatchRect::set_texture(const Ref<Texture2D> &p_tex) {
|
||||
}
|
||||
|
||||
if (texture.is_valid()) {
|
||||
texture->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NinePatchRect::_texture_changed));
|
||||
texture->disconnect_changed(callable_mp(this, &NinePatchRect::_texture_changed));
|
||||
}
|
||||
|
||||
texture = p_tex;
|
||||
|
||||
if (texture.is_valid()) {
|
||||
texture->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NinePatchRect::_texture_changed));
|
||||
texture->connect_changed(callable_mp(this, &NinePatchRect::_texture_changed));
|
||||
}
|
||||
|
||||
queue_redraw();
|
||||
|
||||
Reference in New Issue
Block a user