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

@@ -43,6 +43,7 @@ namespace OpenRA.Mods.Common.Widgets
public int IconCount { get; private set; }
public event Action<int, int> OnIconCountChanged = (a, b) => { };
readonly ModData modData;
readonly WorldRenderer worldRenderer;
readonly SupportPowerManager spm;
@@ -82,8 +83,9 @@ namespace OpenRA.Mods.Common.Widgets
}
[ObjectCreator.UseCtor]
public SupportPowersWidget(World world, WorldRenderer worldRenderer)
public SupportPowersWidget(ModData modData, World world, WorldRenderer worldRenderer)
{
this.modData = modData;
this.worldRenderer = worldRenderer;
spm = world.LocalPlayer.PlayerActor.Trait<SupportPowerManager>();
tooltipContainer = Exts.Lazy(() =>
@@ -98,7 +100,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 class SupportPowerIcon