ClickSound and ClickDisabledSound and ChatLine are optional ui sounds.

This commit is contained in:
Andre Mohren
2018-07-26 15:37:25 +02:00
committed by reaperrr
parent 28623ce54c
commit 48248266a8
14 changed files with 68 additions and 18 deletions

View File

@@ -43,6 +43,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
readonly World world;
readonly WorldRenderer worldRenderer;
readonly string clickSound = ChromeMetrics.Get<string>("ClickSound");
[ObjectCreator.UseCtor]
public ObserverStatsLogic(World world, ModData modData, WorldRenderer worldRenderer, Widget widget,
Action onExit, ObserverStatsPanel activePanel, Dictionary<string, MiniYaml> logicArgs)
@@ -128,7 +130,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
if (statsHotkeys[i].IsActivatedBy(e))
{
Game.Sound.PlayNotification(modData.DefaultRules, null, "Sounds", "ClickSound", null);
Game.Sound.PlayNotification(modData.DefaultRules, null, "Sounds", clickSound, null);
statsDropDownOptions[i].OnClick();
return true;
}
@@ -137,6 +139,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
return false;
});
if (logicArgs.TryGetValue("ClickSound", out yaml))
clickSound = yaml.Value;
}
void ClearStats()