fix button click not playing when returning from a GUI and then clicking it again
This commit is contained in:
parent
c68ebd2e0e
commit
a6b20df3f0
@ -165,6 +165,12 @@ void ButtonWidget::mouseOut() {
|
|||||||
|
|
||||||
void ButtonWidget::mouseReturnStillDown() {
|
void ButtonWidget::mouseReturnStillDown() {
|
||||||
Widget::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_hovered = true;
|
||||||
m_pressed = true;
|
m_pressed = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user