Remove hardcoded cursor bs; move TransformsOnDeploy to Mods.RA.
This commit is contained in:
@@ -74,7 +74,8 @@ namespace OpenRA.Orders
|
||||
{
|
||||
var p = Game.controller.MousePosition;
|
||||
var c = Order(world, p.ToInt2(), mi)
|
||||
.Select(o => CursorForOrderString(o.OrderString, o.Subject, o.TargetLocation))
|
||||
.Select(o => o.Subject.traits.WithInterface<IProvideCursor>()
|
||||
.Select(pc => pc.CursorForOrderString(o.OrderString, o.Subject, o.TargetLocation)).FirstOrDefault(a => a != null))
|
||||
.FirstOrDefault(a => a != null);
|
||||
|
||||
return c ??
|
||||
@@ -83,42 +84,5 @@ namespace OpenRA.Orders
|
||||
? "select" : "default");
|
||||
}
|
||||
}
|
||||
|
||||
string CursorForOrderString(string s, Actor a, int2 location)
|
||||
{
|
||||
switch (s)
|
||||
{
|
||||
case "Attack": return "attack";
|
||||
case "Heal": return "heal";
|
||||
case "C4": return "c4";
|
||||
case "Move":
|
||||
if (a.traits.GetOrDefault<IMove>().CanEnterCell(location))
|
||||
return "move";
|
||||
else
|
||||
return "move-blocked";
|
||||
case "DeployTransform":
|
||||
var depInfo = a.Info.Traits.Get<TransformsOnDeployInfo>();
|
||||
var transInfo = Rules.Info[depInfo.TransformsInto];
|
||||
if (transInfo.Traits.Contains<BuildingInfo>())
|
||||
{
|
||||
var bi = transInfo.Traits.Get<BuildingInfo>();
|
||||
if (!a.World.CanPlaceBuilding(depInfo.TransformsInto, bi, a.Location + new int2(depInfo.Offset[0], depInfo.Offset[1]), a))
|
||||
return "deploy-blocked";
|
||||
}
|
||||
return "deploy";
|
||||
|
||||
case "Deploy": return "deploy";
|
||||
case "Enter": return "enter";
|
||||
case "EnterTransport": return "enter";
|
||||
case "Deliver": return "enter";
|
||||
case "Infiltrate": return "enter";
|
||||
case "Capture": return "capture";
|
||||
case "Harvest": return "attackmove";
|
||||
case "Steal" : return "enter";
|
||||
case "BeginMinefield": return "ability";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user