1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 02:12:37 +01:00

Fix 8c58fb1efd: Doubled beep sounds when clicking toolbar buttons.

* ShowDropDownList() now issues a beep, so individual toolbar buttons no longer need to do it.
* HandleButtonClick() may be called twice for some buttons, as it is called by automatically for PUSH buttons.

This caused some beeps to sound louder than others.
This commit is contained in:
Peter Nelson
2025-09-21 01:00:20 +01:00
committed by Peter Nelson
parent ce166bbbc3
commit 69697a62d3
2 changed files with 3 additions and 14 deletions

View File

@@ -594,6 +594,9 @@ EventState Window::OnHotkey(int hotkey)
*/
void Window::HandleButtonClick(WidgetID widget)
{
/* Button click for this widget may already have been handled. */
if (this->IsWidgetLowered(widget) && this->timeout_timer == TIMEOUT_DURATION) return;
this->LowerWidget(widget);
this->SetTimeout();
this->SetWidgetDirty(widget);