Add ButtonWidget.DisableKeySound property
This commit is contained in:
@@ -28,6 +28,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool DisableKeyRepeat = false;
|
public bool DisableKeyRepeat = false;
|
||||||
|
public bool DisableKeySound = false;
|
||||||
|
|
||||||
[Translate] public string Text = "";
|
[Translate] public string Text = "";
|
||||||
public string Background = "button";
|
public string Background = "button";
|
||||||
@@ -141,9 +142,10 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
if (!IsDisabled())
|
if (!IsDisabled())
|
||||||
{
|
{
|
||||||
OnKeyPress(e);
|
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);
|
Game.Sound.PlayNotification(ModRules, null, "Sounds", "ClickDisabledSound", null);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user