diff options
Diffstat (limited to 'scene/2d/touch_screen_button.cpp')
-rw-r--r-- | scene/2d/touch_screen_button.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 5ed7fadb2a..ff409272c5 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -31,18 +31,17 @@ #include "touch_screen_button.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" void TouchScreenButton::set_texture_normal(const Ref<Texture2D> &p_texture) { if (texture_normal == p_texture) { return; } if (texture_normal.is_valid()) { - texture_normal->disconnect(SceneStringNames::get_singleton()->changed, callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw)); + texture_normal->disconnect(CoreStringName(changed), callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw)); } texture_normal = p_texture; if (texture_normal.is_valid()) { - texture_normal->connect(SceneStringNames::get_singleton()->changed, callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw), CONNECT_REFERENCE_COUNTED); + texture_normal->connect(CoreStringName(changed), callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw), CONNECT_REFERENCE_COUNTED); } queue_redraw(); } @@ -56,11 +55,11 @@ void TouchScreenButton::set_texture_pressed(const Ref<Texture2D> &p_texture_pres return; } if (texture_pressed.is_valid()) { - texture_pressed->disconnect(SceneStringNames::get_singleton()->changed, callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw)); + texture_pressed->disconnect(CoreStringName(changed), callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw)); } texture_pressed = p_texture_pressed; if (texture_pressed.is_valid()) { - texture_pressed->connect(SceneStringNames::get_singleton()->changed, callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw), CONNECT_REFERENCE_COUNTED); + texture_pressed->connect(CoreStringName(changed), callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw), CONNECT_REFERENCE_COUNTED); } queue_redraw(); } @@ -306,7 +305,7 @@ void TouchScreenButton::_press(int p_finger_pressed) { get_viewport()->push_input(iea, true); } - emit_signal(SNAME("pressed")); + emit_signal(SceneStringName(pressed)); queue_redraw(); } @@ -371,10 +370,10 @@ bool TouchScreenButton::is_passby_press_enabled() const { #ifndef DISABLE_DEPRECATED bool TouchScreenButton::_set(const StringName &p_name, const Variant &p_value) { - if (p_name == SNAME("normal")) { // Compatibility with Godot 3.x. + if (p_name == CoreStringName(normal)) { // Compatibility with Godot 3.x. set_texture_normal(p_value); return true; - } else if (p_name == SNAME("pressed")) { // Compatibility with Godot 3.x. + } else if (p_name == SceneStringName(pressed)) { // Compatibility with Godot 3.x. set_texture_pressed(p_value); return true; } |