From 449e75455be000cbdb3814d81963e18af643cea8 Mon Sep 17 00:00:00 2001 From: bncastle Date: Mon, 5 Mar 2018 20:37:10 -0500 Subject: [PATCH] Fix BaseButton not always calling _pressed() Fix "ui_accept" action in BaseButton.cpp not calling _pressed() func in GDScript (cherry picked from commit ceb079fa35fd837f29bc606cbde8346ba6c89c55) --- scene/gui/base_button.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 9dfd388c3dc..d5dc5b3a530 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -211,6 +211,11 @@ void BaseButton::_gui_input(Ref 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 {