ClickSound and ClickDisabledSound and ChatLine are optional ui sounds.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user