From a278f3554b510b4859a503a058fd50f107d82251 Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 26 Nov 2015 17:41:43 +0000 Subject: [PATCH] Only play GUI sound when mouse hovers over a button. --- src/system/widgets.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/system/widgets.c b/src/system/widgets.c index b32a228..953036c 100644 --- a/src/system/widgets.c +++ b/src/system/widgets.c @@ -96,11 +96,14 @@ void drawWidgets(const char *group) { if (!mouseOver) { - mouseOver = (w->enabled && collision(w->rect.x, w->rect.y, w->rect.w, w->rect.h, app.mouse.x, app.mouse.y, 1, 1)); + mouseOver = (w->type != WT_SELECT && w->enabled && collision(w->rect.x, w->rect.y, w->rect.w, w->rect.h, app.mouse.x, app.mouse.y, 1, 1)); if (mouseOver && selectedWidget != w) { - playSound(SND_GUI_CLICK); + if (w->type == WT_BUTTON) + { + playSound(SND_GUI_CLICK); + } selectedWidget = w; } }