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

@@ -40,6 +40,8 @@ namespace OpenRA.Mods.Common.Widgets
public bool Shadow = ChromeMetrics.Get<bool>("ButtonTextShadow");
public Color ContrastColorDark = ChromeMetrics.Get<Color>("ButtonTextContrastColorDark");
public Color ContrastColorLight = ChromeMetrics.Get<Color>("ButtonTextContrastColorLight");
public string ClickSound = ChromeMetrics.Get<string>("ClickSound");
public string ClickDisabledSound = ChromeMetrics.Get<string>("ClickDisabledSound");
public bool Disabled = false;
public bool Highlighted = false;
public Func<string> GetText;
@@ -144,10 +146,10 @@ namespace OpenRA.Mods.Common.Widgets
{
OnKeyPress(e);
if (!DisableKeySound)
Game.Sound.PlayNotification(ModRules, null, "Sounds", "ClickSound", null);
Game.Sound.PlayNotification(ModRules, null, "Sounds", ClickSound, null);
}
else if (!DisableKeySound)
Game.Sound.PlayNotification(ModRules, null, "Sounds", "ClickDisabledSound", null);
Game.Sound.PlayNotification(ModRules, null, "Sounds", ClickDisabledSound, null);
return true;
}
@@ -185,12 +187,12 @@ namespace OpenRA.Mods.Common.Widgets
{
OnMouseDown(mi);
Depressed = true;
Game.Sound.PlayNotification(ModRules, null, "Sounds", "ClickSound", null);
Game.Sound.PlayNotification(ModRules, null, "Sounds", ClickSound, null);
}
else
{
YieldMouseFocus(mi);
Game.Sound.PlayNotification(ModRules, null, "Sounds", "ClickDisabledSound", null);
Game.Sound.PlayNotification(ModRules, null, "Sounds", ClickDisabledSound, null);
}
}
else if (mi.Event == MouseInputEvent.Move && HasMouseFocus)