浏览代码

Fix BaseButton not always calling _pressed()

Fix "ui_accept" action in BaseButton.cpp not calling _pressed() func in
GDScript
bncastle 7 年之前
父节点
当前提交
ceb079fa35
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      scene/gui/base_button.cpp

+ 5 - 0
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 {