From 98434ef96b6abddbdba4a8e9fdfb80b568c7b226 Mon Sep 17 00:00:00 2001 From: Ivaylo Draganov Date: Thu, 17 Jun 2021 17:45:15 +0300 Subject: [PATCH] Add audio feedback for selection hotkeys --- .../Widgets/WorldInteractionControllerWidget.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs index 4eaf9a13d9..73b1812d6c 100644 --- a/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/WorldInteractionControllerWidget.cs @@ -31,6 +31,9 @@ namespace OpenRA.Mods.Common.Widgets readonly Color altSelectionColor; readonly Color ctrlSelectionColor; + public readonly string ClickSound = ChromeMetrics.Get("ClickSound"); + public readonly string ClickDisabledSound = ChromeMetrics.Get("ClickDisabledSound"); + int2 dragStart, mousePos; bool isDragging = false; @@ -257,12 +260,16 @@ namespace OpenRA.Mods.Common.Widgets } World.Selection.Combine(World, ownUnitsOnScreen, false, false); + + Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null); } else if (SelectSameTypeKey.IsActivatedBy(e) && !World.IsGameOver) { if (!World.Selection.Actors.Any()) { TextNotificationsManager.AddFeedbackLine("Nothing selected."); + Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickDisabledSound, null); + return false; } @@ -292,6 +299,8 @@ namespace OpenRA.Mods.Common.Widgets } World.Selection.Combine(World, newSelection, true, false); + + Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null); } }