Touched up selection functionality.

This commit is contained in:
Matija Hustić
2015-06-01 02:59:28 +01:00
parent 9882a6e34d
commit e965a0d3f0
6 changed files with 74 additions and 24 deletions

View File

@@ -21,11 +21,17 @@ namespace OpenRA.Traits
public readonly int Priority = 10;
public readonly int[] Bounds = null;
[Desc("All units having the same selection class specified will be selected with select-by-type commands (e.g. double-click). "
+ "Defaults to the actor name when not defined or inherited.")]
public readonly string Class = null;
public object Create(ActorInitializer init) { return new Selectable(init.Self, this); }
}
public class Selectable : IPostRenderSelection
{
public readonly string Class = null;
public SelectableInfo Info;
readonly Actor self;
@@ -33,6 +39,7 @@ namespace OpenRA.Traits
{
this.self = self;
Info = info;
Class = string.IsNullOrEmpty(info.Class) ? self.Info.Name : info.Class;
}
IEnumerable<WPos> ActivityTargetPath()