From ceb079fa35fd837f29bc606cbde8346ba6c89c55 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 --- 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 5f541ea16aa..562dd155f9a 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 {