add visualization of minefields when MNLY is selected

This commit is contained in:
Chris Forbes
2010-07-24 18:50:02 +12:00
committed by Paul Chote
parent f2bfa8e2ee
commit 3080e19bf2

View File

@@ -26,9 +26,10 @@ namespace OpenRA.Mods.RA
public readonly string[] RearmBuildings = { "fix" };
}
class Minelayer : IIssueOrder, IResolveOrder, IOrderCursor
class Minelayer : IIssueOrder, IResolveOrder, IOrderCursor, IRenderSelection
{
/* [Sync] when sync can cope with arrays! */ public int2[] minefield = null;
/* [Sync] when sync can cope with arrays! */
public int2[] minefield = null;
[Sync] int2 minefieldStart;
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
@@ -64,7 +65,6 @@ namespace OpenRA.Mods.RA
self.Info.Traits.Get<MinelayerInfo>().MinefieldDepth)
.Where(p => movement.CanEnterCell(p)).ToArray();
/* todo: start the mnly actually laying mines there */
self.CancelActivity();
self.QueueActivity(new LayMines());
}
@@ -132,5 +132,11 @@ namespace OpenRA.Mods.RA
public string GetCursor(World world, int2 xy, MouseInput mi) { lastMousePos = xy; return "ability"; } /* todo */
}
public void Render(Actor self)
{
if (minefield != null)
Game.world.WorldRenderer.DrawLocus(Color.Cyan, minefield);
}
}
}