Make control group hotkeys configurable

- Split control groups management to its own interface
- Add hotkeys for selecting, creating, adding to and combining with control groups
- Add a ControlGroups widget to manage the player interaction
This commit is contained in:
Ivaylo Draganov
2021-09-14 22:54:45 +03:00
committed by abcdefg30
parent 04b456d6c2
commit 7a93b9ea8c
31 changed files with 598 additions and 137 deletions

View File

@@ -60,14 +60,15 @@ namespace OpenRA.Mods.Common.Traits.Render
this.self = self;
font = Game.Renderer.Fonts[info.Font];
color = info.UsePlayerColor ? self.Owner.Color : info.Color;
label = new CachedTransform<int, string>(g => g.ToString());
label = new CachedTransform<int, string>(g => self.World.ControlGroups.Groups[g]);
}
bool IDecoration.RequiresSelection => true;
IEnumerable<IRenderable> IDecoration.RenderDecoration(Actor self, WorldRenderer wr, ISelectionDecorations container)
{
var group = self.World.Selection.GetControlGroupForActor(self);
var group = self.World.ControlGroups.GetControlGroupForActor(self);
if (group == null)
return Enumerable.Empty<IRenderable>();