Add mine deployment to the command bar.

This commit is contained in:
Paul Chote
2017-09-25 21:11:53 +01:00
committed by reaperrr
parent 2b96c2ed78
commit 1d6cd81690
2 changed files with 8 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Cnc.Activities;
using OpenRA.Mods.Common.Orders;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.Cnc.Traits
@@ -31,7 +32,7 @@ namespace OpenRA.Mods.Cnc.Traits
public object Create(ActorInitializer init) { return new Minelayer(init.Self); }
}
public class Minelayer : IIssueOrder, IResolveOrder, IRenderAboveShroudWhenSelected, ISync
public class Minelayer : IIssueOrder, IResolveOrder, IRenderAboveShroudWhenSelected, ISync, IIssueDeployOrder
{
/* TODO: [Sync] when sync can cope with arrays! */
public CPos[] Minefield = null;
@@ -72,6 +73,11 @@ namespace OpenRA.Mods.Cnc.Traits
}
}
Order IIssueDeployOrder.IssueDeployOrder(Actor self)
{
return new Order("PlaceMine", self, false) { TargetLocation = self.Location };
}
void IResolveOrder.ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "BeginMinefield")

View File

@@ -129,7 +129,7 @@ Container@PLAYER_WIDGETS:
DisableKeyRepeat: true
DisableKeySound: true
TooltipText: Deploy
TooltipDesc: Selected units will perform their default deploy activity\n - MCVs will unpack into a Construction Yard\n - Construction Yards will re-pack into a MCV\n - Transports will unload their passengers\n - Demolition Trucks and MAD Tanks will self-destruct\n - Aircraft will return to base\n\nActs immediately on selected units.
TooltipDesc: Selected units will perform their default deploy activity\n - MCVs will unpack into a Construction Yard\n - Construction Yards will re-pack into a MCV\n - Transports will unload their passengers\n - Demolition Trucks and MAD Tanks will self-destruct\n - Minelayers will deploy a mine\n - Aircraft will return to base\n\nActs immediately on selected units.
TooltipContainer: TOOLTIP_CONTAINER
Children:
Image@ICON: