Add configurable cursors for entering allied actor targeters
This commit is contained in:
committed by
abcdefg30
parent
393f6eca3a
commit
d5ff5c672b
@@ -139,6 +139,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Boolean expression defining the condition under which the regular (non-force) move cursor is disabled.")]
|
||||
public readonly BooleanExpression RequireForceMoveCondition = null;
|
||||
|
||||
public readonly string EnterCursor = "enter";
|
||||
public readonly string EnterBlockedCursor = "enter-blocked";
|
||||
|
||||
public int GetInitialFacing() { return InitialFacing; }
|
||||
public WDist GetCruiseAltitude() { return CruiseAltitude; }
|
||||
|
||||
@@ -937,11 +940,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("ForceEnter", 6,
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("ForceEnter", 6, Info.EnterCursor, Info.EnterBlockedCursor,
|
||||
(target, modifiers) => Info.CanForceLand && modifiers.HasModifier(TargetModifiers.ForceMove) && AircraftCanEnter(target),
|
||||
target => Reservable.IsAvailableFor(target, self) && AircraftCanResupplyAt(target, true));
|
||||
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("Enter", 5,
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("Enter", 5, Info.EnterCursor, Info.EnterBlockedCursor,
|
||||
AircraftCanEnter,
|
||||
target => Reservable.IsAvailableFor(target, self) && AircraftCanResupplyAt(target, !Info.TakeOffOnResupply));
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Require the force-move modifier to display the move cursor.")]
|
||||
public readonly bool RequiresForceMove = false;
|
||||
|
||||
public readonly string EnterCursor = "enter";
|
||||
public readonly string EnterBlockedCursor = "enter-blocked";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TransformsIntoAircraft(init, this); }
|
||||
}
|
||||
|
||||
@@ -62,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
if (!IsTraitDisabled)
|
||||
{
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("Enter", 5, AircraftCanEnter,
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("Enter", 5, Info.EnterCursor, Info.EnterBlockedCursor, AircraftCanEnter,
|
||||
target => Reservable.IsAvailableFor(target, self));
|
||||
|
||||
yield return new AircraftMoveOrderTargeter(self, this);
|
||||
|
||||
@@ -32,6 +32,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Require the force-move modifier to display the enter cursor.")]
|
||||
public readonly bool RequiresForceMove = false;
|
||||
|
||||
public readonly string EnterCursor = "enter";
|
||||
public readonly string EnterBlockedCursor = "enter-blocked";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TransformsIntoPassenger(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -57,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
get
|
||||
{
|
||||
if (!IsTraitDisabled)
|
||||
yield return new EnterAlliedActorTargeter<CargoInfo>("EnterTransport", 5, IsCorrectCargoType, CanEnter);
|
||||
yield return new EnterAlliedActorTargeter<CargoInfo>("EnterTransport", 5, Info.EnterCursor, Info.EnterBlockedCursor, IsCorrectCargoType, CanEnter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Require the force-move modifier to display the enter cursor.")]
|
||||
public readonly bool RequiresForceMove = false;
|
||||
|
||||
public readonly string EnterCursor = "enter";
|
||||
public readonly string EnterBlockedCursor = "enter-blocked";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TransformsIntoRepairable(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -60,7 +63,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
get
|
||||
{
|
||||
if (!IsTraitDisabled)
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("Repair", 5, CanRepairAt, _ => CanRepair());
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("Repair", 5, Info.EnterCursor, Info.EnterBlockedCursor, CanRepairAt, _ => CanRepair());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[VoiceReference]
|
||||
public readonly string DeliverVoice = "Action";
|
||||
|
||||
public readonly string EnterCursor = "enter";
|
||||
public readonly string EnterBlockedCursor = "enter-blocked";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new Harvester(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -278,7 +281,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return new EnterAlliedActorTargeter<IAcceptResourcesInfo>("Deliver", 5,
|
||||
yield return new EnterAlliedActorTargeter<IAcceptResourcesInfo>("Deliver", 5, Info.EnterCursor, Info.EnterBlockedCursor,
|
||||
(proc, _) => IsAcceptableProcType(proc),
|
||||
proc => proc.Trait<IAcceptResources>().AllowDocking);
|
||||
yield return new HarvestOrderTargeter();
|
||||
|
||||
@@ -47,6 +47,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Boolean expression defining the condition under which the regular (non-force) enter cursor is disabled.")]
|
||||
public readonly BooleanExpression RequireForceMoveCondition = null;
|
||||
|
||||
public readonly string EnterCursor = "enter";
|
||||
public readonly string EnterBlockedCursor = "enter-blocked";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new Passenger(this); }
|
||||
}
|
||||
|
||||
@@ -70,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return new EnterAlliedActorTargeter<CargoInfo>("EnterTransport", 5, IsCorrectCargoType, CanEnter);
|
||||
yield return new EnterAlliedActorTargeter<CargoInfo>("EnterTransport", 5, Info.EnterCursor, Info.EnterBlockedCursor, IsCorrectCargoType, CanEnter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Boolean expression defining the condition under which the regular (non-force) enter cursor is disabled.")]
|
||||
public readonly BooleanExpression RequireForceMoveCondition = null;
|
||||
|
||||
public readonly string EnterCursor = "enter";
|
||||
public readonly string EnterBlockedCursor = "enter-blocked";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new Repairable(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -65,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
get
|
||||
{
|
||||
if (!isAircraft)
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("Repair", 5, CanRepairAt, _ => CanRepair() || CanRearm());
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("Repair", 5, Info.EnterCursor, Info.EnterBlockedCursor, CanRepairAt, _ => CanRepair() || CanRearm());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Boolean expression defining the condition under which the regular (non-force) enter cursor is disabled.")]
|
||||
public readonly BooleanExpression RequireForceMoveCondition = null;
|
||||
|
||||
public readonly string EnterCursor = "enter";
|
||||
public readonly string EnterBlockedCursor = "enter-blocked";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new RepairableNear(init.Self, this); }
|
||||
}
|
||||
|
||||
@@ -53,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("RepairNear", 5,
|
||||
yield return new EnterAlliedActorTargeter<BuildingInfo>("RepairNear", 5, Info.EnterCursor, Info.EnterBlockedCursor,
|
||||
CanRepairAt, _ => ShouldRepair());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user