Iron curtain targetting polish

This commit is contained in:
Paul Chote
2010-01-08 00:52:00 +13:00
parent 0e05f4db5c
commit 42cfa7ec59
2 changed files with 9 additions and 2 deletions

View File

@@ -317,7 +317,7 @@ namespace OpenRa.Game
else
{
//repairButton.ReplaceAnim(Game.controller.orderGenerator is RepairOrderGenerator ? "pressed" : "normal");
AddButton(curtainRect, isLmb => Game.controller.ToggleInputMode<IronCurtainOrderGenerator>());
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<IronCurtainOrderGenerator>())
Sound.Play("slcttgt1.aud");
}
void DrawChat()
{
var chatpos = new int2(400, Game.viewport.Height - 20);

View File

@@ -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<IronCurtain>()).FirstOrDefault();
Sound.Play("ironcur9.aud");
if (ironCurtain != null)
ironCurtain.traits.Get<RenderBuilding>().PlayCustomAnim(ironCurtain, "active");
}