diff --git a/OpenRA.Game/Widgets/ButtonWidget.cs b/OpenRA.Game/Widgets/ButtonWidget.cs index 7a77bd97d3..ef51fa3f66 100644 --- a/OpenRA.Game/Widgets/ButtonWidget.cs +++ b/OpenRA.Game/Widgets/ButtonWidget.cs @@ -22,6 +22,8 @@ namespace OpenRA.Widgets public bool Depressed = false; public int VisualHeight = ChromeMetrics.Get("ButtonDepth"); public string Font = ChromeMetrics.Get("ButtonFont"); + public string ClickSound = null; + public string ClickDisabledSound = null; public Func GetText; public Func IsDisabled = () => false; public Action OnMouseDown = _ => {}; @@ -65,7 +67,12 @@ namespace OpenRA.Widgets return false; if (!IsDisabled()) + { OnKeyPress(e); + Sound.Play(ClickSound); + } + else + Sound.Play(ClickDisabledSound); return true; } @@ -94,9 +101,13 @@ namespace OpenRA.Widgets { OnMouseDown(mi); Depressed = true; + Sound.Play(ClickSound); } else + { LoseFocus(mi); + Sound.Play(ClickDisabledSound); + } } else if (mi.Event == MouseInputEvent.Move && Focused) Depressed = RenderBounds.Contains(mi.Location.X, mi.Location.Y); diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs index 1fac9ebbf7..c8d69e95a6 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncLobbyLogic.cs @@ -271,7 +271,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic chatPanel.AddChild(template); chatPanel.ScrollToBottom(); - Sound.Play("scold2.aud"); + Sound.Play("scold1.aud"); } void UpdateCurrentMap() diff --git a/OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs b/OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs index 422363ff7a..3b0ce3f779 100755 --- a/OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Widgets public class ProductionPaletteWidget : Widget { public readonly int Columns = 3; - public readonly string TabClick = "button.aud"; + public readonly string TabClick = null; public readonly string TooltipContainer; public readonly string TooltipTemplate = "PRODUCTION_TOOLTIP"; diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index 2f2ec62dd4..9c06785569 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -19,7 +19,7 @@ Container@INGAME_ROOT: DrawBackground: False RemoveTime:250 UseContrast: yes - Notification: scold2.aud + Notification: scold1.aud ChatEntry@CHAT_ENTRY: Id:CHAT_ENTRY X:250 @@ -137,6 +137,8 @@ Container@PLAYER_WIDGETS: Font:Bold TooltipText: Menu TooltipContainer:TOOLTIP_CONTAINER + ClickSound:button.aud + ClickDisabledSound:scold2.aud Children: Image: Id:ICON @@ -154,6 +156,8 @@ Container@PLAYER_WIDGETS: Font:Bold TooltipText: Sell TooltipContainer:TOOLTIP_CONTAINER + ClickSound:button.aud + ClickDisabledSound:scold2.aud Children: Image: Id:ICON @@ -170,6 +174,8 @@ Container@PLAYER_WIDGETS: Font:Bold TooltipText: Repair TooltipContainer:TOOLTIP_CONTAINER + ClickSound:button.aud + ClickDisabledSound:scold2.aud Children: Image: Id:ICON @@ -247,6 +253,8 @@ Container@PLAYER_WIDGETS: Key: y TooltipText: Buildings TooltipContainer:TOOLTIP_CONTAINER + ClickSound:button.aud + ClickDisabledSound:scold2.aud Children: Image: Id:ICON @@ -261,6 +269,8 @@ Container@PLAYER_WIDGETS: Key: u TooltipText: Defense TooltipContainer:TOOLTIP_CONTAINER + ClickSound:button.aud + ClickDisabledSound:scold2.aud Children: Image: Id:ICON @@ -275,6 +285,8 @@ Container@PLAYER_WIDGETS: Key: i TooltipText: Infantry TooltipContainer:TOOLTIP_CONTAINER + ClickSound:button.aud + ClickDisabledSound:scold2.aud Children: Image: Id:ICON @@ -289,6 +301,8 @@ Container@PLAYER_WIDGETS: Key: o TooltipText: Vehicles TooltipContainer:TOOLTIP_CONTAINER + ClickSound:button.aud + ClickDisabledSound:scold2.aud Children: Image: Id:ICON @@ -303,6 +317,8 @@ Container@PLAYER_WIDGETS: Key: p TooltipText: Aircraft TooltipContainer:TOOLTIP_CONTAINER + ClickSound:button.aud + ClickDisabledSound:scold2.aud Children: Image: Id:ICON diff --git a/mods/cnc/metrics.yaml b/mods/cnc/metrics.yaml index dfb1dbf867..8910d7374b 100644 --- a/mods/cnc/metrics.yaml +++ b/mods/cnc/metrics.yaml @@ -3,4 +3,4 @@ Metrics: ButtonDepth: 0 ButtonFont: Bold - CheckboxPressedState: true + CheckboxPressedState: true \ No newline at end of file