UnitInfo.Selectable
This commit is contained in:
@@ -83,7 +83,10 @@ namespace OpenRa.Game
|
|||||||
if (!Rules.Map.IsInMap(xy.X, xy.Y))
|
if (!Rules.Map.IsInMap(xy.X, xy.Y))
|
||||||
return null;
|
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>()
|
return traits.WithInterface<Traits.IOrder>()
|
||||||
.Select( x => x.IssueOrder( this, xy, lmb, underCursor ) )
|
.Select( x => x.IssueOrder( this, xy, lmb, underCursor ) )
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ namespace OpenRa.Game
|
|||||||
public static IEnumerable<Actor> SelectActorsInBox(float2 a, float2 b)
|
public static IEnumerable<Actor> SelectActorsInBox(float2 a, float2 b)
|
||||||
{
|
{
|
||||||
return FindUnits(a, b)
|
return FindUnits(a, b)
|
||||||
|
.Where( x => x.unitInfo.Selectable )
|
||||||
.GroupBy(x => (x.Owner == LocalPlayer) ? x.unitInfo.SelectionPriority : 0)
|
.GroupBy(x => (x.Owner == LocalPlayer) ? x.unitInfo.SelectionPriority : 0)
|
||||||
.OrderByDescending(g => g.Key)
|
.OrderByDescending(g => g.Key)
|
||||||
.Select( g => g.AsEnumerable() )
|
.Select( g => g.AsEnumerable() )
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace OpenRa.Game.GameRules
|
|||||||
public readonly bool MuzzleFlash = false;
|
public readonly bool MuzzleFlash = false;
|
||||||
public readonly int SelectionPriority = 10;
|
public readonly int SelectionPriority = 10;
|
||||||
public readonly int InitialFacing = 128;
|
public readonly int InitialFacing = 128;
|
||||||
|
public readonly bool Selectable = true;
|
||||||
|
|
||||||
public UnitInfo(string name) { Name = name; }
|
public UnitInfo(string name) { Name = name; }
|
||||||
}
|
}
|
||||||
|
|||||||
44
trees.ini
44
trees.ini
@@ -26,165 +26,165 @@ Description=Tree
|
|||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x_ x_
|
Footprint=x_ x_
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T01
|
Name=T01
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T02]
|
[T02]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x_ x_
|
Footprint=x_ x_
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T02
|
Name=T02
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T03]
|
[T03]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x_ x_
|
Footprint=x_ x_
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T03
|
Name=T03
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T05]
|
[T05]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x_ x_
|
Footprint=x_ x_
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T05
|
Name=T05
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T06]
|
[T06]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x_ x_
|
Footprint=x_ x_
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T06
|
Name=T06
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T07]
|
[T07]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x_ x_
|
Footprint=x_ x_
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T07
|
Name=T07
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T08]
|
[T08]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x_
|
Footprint=x_
|
||||||
Dimensions=2,1
|
Dimensions=2,1
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T08
|
Name=T08
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T10]
|
[T10]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xx xx
|
Footprint=xx xx
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T10
|
Name=T10
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T11]
|
[T11]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xx xx
|
Footprint=xx xx
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T11
|
Name=T11
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T12]
|
[T12]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xx xx
|
Footprint=xx xx
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T12
|
Name=T12
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T13]
|
[T13]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xx xx
|
Footprint=xx xx
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T13
|
Name=T13
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T14]
|
[T14]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xx xx
|
Footprint=xx xx
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T14
|
Name=T14
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T15]
|
[T15]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xx xx
|
Footprint=xx xx
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T15
|
Name=T15
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T16]
|
[T16]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x_ x_
|
Footprint=x_ x_
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T16
|
Name=T16
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[T17]
|
[T17]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x_ x_
|
Footprint=x_ x_
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=T17
|
Name=T17
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[TC01]
|
[TC01]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xx xx
|
Footprint=xx xx
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=TC01
|
Name=TC01
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[TC02]
|
[TC02]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xx xx
|
Footprint=xx xx
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=TC02
|
Name=TC02
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[TC03]
|
[TC03]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xx xx
|
Footprint=xx xx
|
||||||
Dimensions=2,2
|
Dimensions=2,2
|
||||||
SelectionPriority=-1
|
|
||||||
Name=TC03
|
Name=TC03
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[TC04]
|
[TC04]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xxx xxx xxx
|
Footprint=xxx xxx xxx
|
||||||
Dimensions=3,3
|
Dimensions=3,3
|
||||||
SelectionPriority=-1
|
|
||||||
Name=TC04
|
Name=TC04
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[TC05]
|
[TC05]
|
||||||
Description=Tree
|
Description=Tree
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=xxx xxx xxx
|
Footprint=xxx xxx xxx
|
||||||
Dimensions=3,3
|
Dimensions=3,3
|
||||||
SelectionPriority=-1
|
|
||||||
Name=TC05
|
Name=TC05
|
||||||
|
Selectable=no
|
||||||
|
|
||||||
[MINE]
|
[MINE]
|
||||||
Description=Ore Pit
|
Description=Ore Pit
|
||||||
Traits=Building, RenderBuilding
|
Traits=Building, RenderBuilding
|
||||||
Footprint=x
|
Footprint=x
|
||||||
Dimensions=1,1
|
Dimensions=1,1
|
||||||
SelectionPriority=-1
|
Name=MINE
|
||||||
Name=MINE
|
Selectable=no
|
||||||
Reference in New Issue
Block a user