Begin iron curtain impl

This commit is contained in:
Paul Chote
2010-01-08 00:18:06 +13:00
parent 92dc6754a3
commit 9df6d01577
8 changed files with 203 additions and 56 deletions

View File

@@ -305,6 +305,21 @@ namespace OpenRa.Game
AddButton(chronoshiftRect, isLmb => HandleChronosphereButton());
}
buildPaletteRenderer.DrawSprite(repairButton.Image, chronoshiftDrawPos, PaletteType.Chrome);
// Iron Curtain
Rectangle curtainRect = new Rectangle(6, 14+50, repairButton.Image.bounds.Width, repairButton.Image.bounds.Height);
var curtainDrawPos = Game.viewport.Location + new float2(curtainRect.Location);
var hasCurtain = Game.world.Actors.Any(a => a.Owner == Game.LocalPlayer && a.traits.Contains<IronCurtain>());
if (!hasCurtain)
repairButton.ReplaceAnim("disabled");
else
{
//repairButton.ReplaceAnim(Game.controller.orderGenerator is RepairOrderGenerator ? "pressed" : "normal");
AddButton(curtainRect, isLmb => Game.controller.ToggleInputMode<IronCurtainOrderGenerator>());
}
buildPaletteRenderer.DrawSprite(repairButton.Image, curtainDrawPos, PaletteType.Chrome);
// Repair