UnitInfo.Selectable
This commit is contained in:
@@ -83,7 +83,10 @@ namespace OpenRa.Game
|
||||
if (!Rules.Map.IsInMap(xy.X, xy.Y))
|
||||
return null;
|
||||
|
||||
var underCursor = Game.UnitInfluence.GetUnitAt( xy ) ?? Game.BuildingInfluence.GetBuildingAt( xy );
|
||||
var underCursor = Game.UnitInfluence.GetUnitAt( xy )
|
||||
?? Game.BuildingInfluence.GetBuildingAt( xy );
|
||||
if (underCursor != null && !underCursor.unitInfo.Selectable)
|
||||
underCursor = null;
|
||||
|
||||
return traits.WithInterface<Traits.IOrder>()
|
||||
.Select( x => x.IssueOrder( this, xy, lmb, underCursor ) )
|
||||
|
||||
@@ -276,6 +276,7 @@ namespace OpenRa.Game
|
||||
public static IEnumerable<Actor> SelectActorsInBox(float2 a, float2 b)
|
||||
{
|
||||
return FindUnits(a, b)
|
||||
.Where( x => x.unitInfo.Selectable )
|
||||
.GroupBy(x => (x.Owner == LocalPlayer) ? x.unitInfo.SelectionPriority : 0)
|
||||
.OrderByDescending(g => g.Key)
|
||||
.Select( g => g.AsEnumerable() )
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace OpenRa.Game.GameRules
|
||||
public readonly bool MuzzleFlash = false;
|
||||
public readonly int SelectionPriority = 10;
|
||||
public readonly int InitialFacing = 128;
|
||||
public readonly bool Selectable = true;
|
||||
|
||||
public UnitInfo(string name) { Name = name; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user