SetTargetSilently for DrawLineToTarget

This commit is contained in:
alzeih
2010-07-26 13:57:53 +12:00
parent 526bb3e042
commit 925ca2bb73
10 changed files with 89 additions and 7 deletions

View File

@@ -8,6 +8,7 @@
*/
#endregion
using System.Drawing;
using OpenRA.Mods.RA;
using OpenRA.Mods.RA.Activities;
using OpenRA.Mods.RA.Render;
@@ -50,8 +51,17 @@ namespace OpenRA.Mods.Cnc
harv.QueueActivity( new CallFunc( () => harvester.Visible = true, false ) );
harv.QueueActivity( new Drag(endDock, startDock, 12) );
harv.QueueActivity( new CallFunc( () => dockedHarv = null, false ) );
if (harvester.LastHarvestedCell != int2.Zero)
harv.QueueActivity( new Move(harvester.LastHarvestedCell, 5) );
if (harvester.LastHarvestedCell != int2.Zero)
{
harv.QueueActivity( new Move(harvester.LastHarvestedCell, 5) );
if (harv.Owner == self.World.LocalPlayer)
self.World.AddFrameEndTask( w =>
{
var line = harv.traits.GetOrDefault<DrawLineToTarget>();
if (line != null)
line.SetTargetSilently(harv, Target.FromCell(harvester.LastHarvestedCell), Color.Green);
});
}
}
harv.QueueActivity( new Harvest() );
}) );