diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-09-11 15:23:35 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-09-11 15:23:35 +1000 |
commit | a6b20df3f0ddac5c235d10373d7d5f0876af99f9 (patch) | |
tree | 8237bd1c6b0a37163db34096d24712411d9c315c /source/windowing | |
parent | c68ebd2e0e13facd09fc9d194111462266a86068 (diff) |
fix button click not playing when returning from a GUI and then clicking it again
Diffstat (limited to 'source/windowing')
-rw-r--r-- | source/windowing/StarButtonWidget.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |