diff options
| author | bncastle | 2018-03-05 20:37:10 -0500 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-03-28 23:55:58 +0200 |
| commit | 449e75455be000cbdb3814d81963e18af643cea8 (patch) | |
| tree | b2203be6c37b3aea4c84f87114742fb076df6f34 /scene/gui/base_button.cpp | |
| parent | 73cc3a96c0d5a706b1bd754986b39262bf66972d (diff) | |
| download | godot-449e75455be000cbdb3814d81963e18af643cea8.tar.gz godot-449e75455be000cbdb3814d81963e18af643cea8.tar.zst godot-449e75455be000cbdb3814d81963e18af643cea8.zip | |
Fix BaseButton not always calling _pressed()
Fix "ui_accept" action in BaseButton.cpp not calling _pressed() func in
GDScript
(cherry picked from commit ceb079fa35fd837f29bc606cbde8346ba6c89c55)
Diffstat (limited to '')
| -rw-r--r-- | scene/gui/base_button.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 9dfd388c3..d5dc5b3a5 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -211,6 +211,11 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) { if (!toggle_mode) { //mouse press attempt pressed(); + if (get_script_instance()) { + Variant::CallError ce; + get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce); + } + emit_signal("pressed"); } else { |
