From 0c67ca332183733c06ac233a8f67137ded7b88a7 Mon Sep 17 00:00:00 2001 From: rob-v Date: Wed, 9 Aug 2017 21:06:29 +0200 Subject: [PATCH] Add ButtonWidget.DisableKeySound property --- OpenRA.Mods.Common/Widgets/ButtonWidget.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/ButtonWidget.cs b/OpenRA.Mods.Common/Widgets/ButtonWidget.cs index 836d2c5a18..b994dbcf5a 100644 --- a/OpenRA.Mods.Common/Widgets/ButtonWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ButtonWidget.cs @@ -28,6 +28,7 @@ namespace OpenRA.Mods.Common.Widgets } public bool DisableKeyRepeat = false; + public bool DisableKeySound = false; [Translate] public string Text = ""; public string Background = "button"; @@ -141,9 +142,10 @@ namespace OpenRA.Mods.Common.Widgets if (!IsDisabled()) { OnKeyPress(e); - Game.Sound.PlayNotification(ModRules, null, "Sounds", "ClickSound", null); + if (!DisableKeySound) + Game.Sound.PlayNotification(ModRules, null, "Sounds", "ClickSound", null); } - else + else if (!DisableKeySound) Game.Sound.PlayNotification(ModRules, null, "Sounds", "ClickDisabledSound", null); return true;