diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-19 15:20:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 15:20:25 +0200 |
commit | 855c7c7414a2f29cd420e8dd654a4630226bcd50 (patch) | |
tree | 343caeb7b32ef068f50a69e91dad2a8aefe681fb /scene/gui/base_button.cpp | |
parent | 54b598ffe4f1ba5cc55c947a2cb5192829770088 (diff) | |
parent | 6631f66c2a9d54dc80d57df60376c84ce1252d08 (diff) |
Merge pull request #50566 from reduz/optimize-stringname-usage
Optimize StringName usage
Diffstat (limited to 'scene/gui/base_button.cpp')
-rw-r--r-- | scene/gui/base_button.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 8414c4dc78..75a4464a40 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -125,7 +125,7 @@ void BaseButton::_pressed() { get_script_instance()->call(SceneStringNames::get_singleton()->_pressed); } pressed(); - emit_signal("pressed"); + emit_signal(SNAME("pressed")); } void BaseButton::_toggled(bool p_pressed) { @@ -133,14 +133,14 @@ void BaseButton::_toggled(bool p_pressed) { get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, p_pressed); } toggled(p_pressed); - emit_signal("toggled", p_pressed); + emit_signal(SNAME("toggled"), p_pressed); } void BaseButton::on_action_event(Ref<InputEvent> p_event) { if (p_event->is_pressed()) { status.press_attempt = true; status.pressing_inside = true; - emit_signal("button_down"); + emit_signal(SNAME("button_down")); } if (status.press_attempt && status.pressing_inside) { @@ -153,7 +153,7 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) { status.pressed = !status.pressed; _unpress_group(); if (button_group.is_valid()) { - button_group->emit_signal("pressed", this); + button_group->emit_signal(SNAME("pressed"), this); } _toggled(status.pressed); _pressed(); @@ -174,7 +174,7 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) { } status.press_attempt = false; status.pressing_inside = false; - emit_signal("button_up"); + emit_signal(SNAME("button_up")); } update(); @@ -218,7 +218,7 @@ void BaseButton::set_pressed(bool p_pressed) { if (p_pressed) { _unpress_group(); if (button_group.is_valid()) { - button_group->emit_signal("pressed", this); + button_group->emit_signal(SNAME("pressed"), this); } } _toggled(status.pressed); |