From a6b20df3f0ddac5c235d10373d7d5f0876af99f9 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:23:35 +1000 Subject: [PATCH] fix button click not playing when returning from a GUI and then clicking it again --- source/windowing/StarButtonWidget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/windowing/StarButtonWidget.cpp b/source/windowing/StarButtonWidget.cpp index 258ac55..0412ae5 100644 --- a/source/windowing/StarButtonWidget.cpp +++ b/source/windowing/StarButtonWidget.cpp @@ -165,6 +165,12 @@ void ButtonWidget::mouseOut() { void ButtonWidget::mouseReturnStillDown() { Widget::mouseReturnStillDown(); + if (!isPressed()) { + auto assets = Root::singleton().assets(); + auto sound = Random::randValueFrom(m_clickSounds, ""); + if (!sound.empty()) + context()->playAudio(sound); + } m_hovered = true; m_pressed = true; }