diff --git a/OpenRa.Game/Chrome.cs b/OpenRa.Game/Chrome.cs index 3e7b531932..ea84206eb9 100644 --- a/OpenRa.Game/Chrome.cs +++ b/OpenRa.Game/Chrome.cs @@ -317,7 +317,7 @@ namespace OpenRa.Game else { //repairButton.ReplaceAnim(Game.controller.orderGenerator is RepairOrderGenerator ? "pressed" : "normal"); - AddButton(curtainRect, isLmb => Game.controller.ToggleInputMode()); + AddButton(curtainRect, isLmb => HandleIronCurtainButton()); } buildPaletteRenderer.DrawSprite(repairButton.Image, curtainDrawPos, PaletteType.Chrome); @@ -391,6 +391,12 @@ namespace OpenRa.Game Sound.Play("slcttgt1.aud"); } + void HandleIronCurtainButton() + { + if (Game.controller.ToggleInputMode()) + Sound.Play("slcttgt1.aud"); + } + void DrawChat() { var chatpos = new int2(400, Game.viewport.Height - 20); diff --git a/OpenRa.Game/Traits/IronCurtainable.cs b/OpenRa.Game/Traits/IronCurtainable.cs index eb15272a02..0b01d5fbf7 100644 --- a/OpenRa.Game/Traits/IronCurtainable.cs +++ b/OpenRa.Game/Traits/IronCurtainable.cs @@ -32,10 +32,11 @@ namespace OpenRa.Game.Traits { if (order.OrderString == "IronCurtain") { + Game.controller.CancelInputMode(); RemainingTicks = (int)(Rules.General.IronCurtain * 60 * 25); + Sound.Play("ironcur9.aud"); // Play active anim var ironCurtain = Game.world.Actors.Where(a => a.Owner == order.Subject.Owner && a.traits.Contains()).FirstOrDefault(); - Sound.Play("ironcur9.aud"); if (ironCurtain != null) ironCurtain.traits.Get().PlayCustomAnim(ironCurtain, "active"); }