Migrate hotkey consumers to HotkeyManager.

This commit is contained in:
Paul Chote
2017-10-28 09:12:54 +01:00
committed by abcdefg30
parent 35a3df3736
commit 2f79173044
21 changed files with 51 additions and 64 deletions

View File

@@ -76,6 +76,7 @@ namespace OpenRA.Mods.Common.Widgets
public ProductionIcon TooltipIcon { get; private set; }
public Func<ProductionIcon> GetTooltipIcon;
public readonly World World;
readonly ModData modData;
readonly OrderManager orderManager;
public int MinimumRows = 4;
@@ -127,8 +128,9 @@ namespace OpenRA.Mods.Common.Widgets
}
[ObjectCreator.UseCtor]
public ProductionPaletteWidget(OrderManager orderManager, World world, WorldRenderer worldRenderer)
public ProductionPaletteWidget(ModData modData, OrderManager orderManager, World world, WorldRenderer worldRenderer)
{
this.modData = modData;
this.orderManager = orderManager;
World = world;
this.worldRenderer = worldRenderer;
@@ -146,7 +148,7 @@ namespace OpenRA.Mods.Common.Widgets
base.Initialize(args);
hotkeys = Exts.MakeArray(HotkeyCount,
i => new HotkeyReference(HotkeyPrefix + (i + 1).ToString("D2"), Game.Settings.Keys));
i => modData.Hotkeys[HotkeyPrefix + (i + 1).ToString("D2")]);
}
public void ScrollDown()