routing modifier keys where they need to be

This commit is contained in:
Chris Forbes
2009-12-16 11:31:53 +13:00
parent 6d59339b84
commit 5bf3e05f03
18 changed files with 100 additions and 84 deletions

View File

@@ -125,9 +125,9 @@ namespace OpenRa.Game.Traits
return true;
}
public Order IssueOrder(Actor self, int2 xy, bool lmb, Actor underCursor)
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
{
if (lmb || underCursor == null) return null;
if (mi.Button == MouseButton.Left || underCursor == null) return null;
if (underCursor.Owner == self.Owner) return null;
if (!Combat.HasAnyValidWeapons(self, underCursor)) return null;
return Order.Attack(self, underCursor);

View File

@@ -1,5 +1,4 @@
namespace OpenRa.Game.Traits
namespace OpenRa.Game.Traits
{
class Harvester : IOrder
{
@@ -25,9 +24,9 @@ namespace OpenRa.Game.Traits
gemsCarried = 0;
}
public Order IssueOrder(Actor self, int2 xy, bool lmb, Actor underCursor)
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
{
if (lmb) return null;
if (mi.Button == MouseButton.Left) return null;
if (underCursor != null
&& underCursor.Owner == self.Owner

View File

@@ -16,9 +16,9 @@ namespace OpenRa.Game.Traits
targetLocation = self.Location;
}
public Order IssueOrder(Actor self, int2 xy, bool lmb, Actor underCursor)
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
{
if (lmb) return null;
if (mi.Button == MouseButton.Left) return null;
if (underCursor == null)
return Order.Move(self, xy);

View File

@@ -6,9 +6,9 @@ namespace OpenRa.Game.Traits
{
public McvDeploy(Actor self) { }
public Order IssueOrder(Actor self, int2 xy, bool lmb, Actor underCursor)
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
{
if (lmb) return null;
if (mi.Button == MouseButton.Left) return null;
if( xy != self.Location ) return null;
return Order.DeployMcv(self);

View File

@@ -28,9 +28,9 @@ namespace OpenRa.Game.Traits
Game.UnitInfluence.Add(self, this);
}
public Order IssueOrder(Actor self, int2 xy, bool lmb, Actor underCursor)
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
{
if (lmb) return null;
if (mi.Button == MouseButton.Left) return null;
if (underCursor != null) return null;
if (xy == toCell) return null;
return Order.Move(self, xy);

View File

@@ -23,7 +23,7 @@ namespace OpenRa.Game.Traits
p.Value.Tick( self.Owner );
}
public Order IssueOrder( Actor self, int2 xy, bool lmb, Actor underCursor )
public Order IssueOrder( Actor self, int2 xy, MouseInput mi, Actor underCursor )
{
// production isn't done by clicks in the world; the chrome handles it.
return null;

View File

@@ -24,9 +24,9 @@ namespace OpenRa.Game.Traits
anim.Image, Util.CenterOfCell(rallyPoint));
}
public Order IssueOrder(Actor self, int2 xy, bool lmb, Actor underCursor)
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
{
if (lmb || underCursor != null) return null;
if (mi.Button == MouseButton.Left || underCursor != null) return null;
return Order.SetRallyPoint(self, xy);
}

View File

@@ -13,7 +13,7 @@ namespace OpenRa.Game.Traits
interface INotifyBuildComplete { void BuildingComplete (Actor self); }
interface IOrder
{
Order IssueOrder( Actor self, int2 xy, bool lmb, Actor underCursor );
Order IssueOrder( Actor self, int2 xy, MouseInput mi, Actor underCursor );
void ResolveOrder( Actor self, Order order );
}
interface IProducer { bool Produce( Actor self, UnitInfo producee ); }