SetTargetSilently for DrawLineToTarget
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Drawing" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CriticalBuildingState.cs" />
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using System.Drawing;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
@@ -62,6 +63,12 @@ namespace OpenRA.Mods.Cnc
|
||||
actor.CancelActivity();
|
||||
actor.QueueActivity(new Move(self.Location + exitOffset, self));
|
||||
actor.QueueActivity(new Move(rp.rallyPoint, 0));
|
||||
if (actor.Owner == self.World.LocalPlayer)
|
||||
{
|
||||
var line = actor.traits.GetOrDefault<DrawLineToTarget>();
|
||||
if (line != null)
|
||||
line.SetTargetSilently(actor, Target.FromCell(rp.rallyPoint), Color.Green);
|
||||
}
|
||||
|
||||
foreach (var t in self.traits.WithInterface<INotifyProduction>())
|
||||
t.UnitProduced(self, actor);
|
||||
|
||||
@@ -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() );
|
||||
}) );
|
||||
|
||||
Reference in New Issue
Block a user