fixed broken build palette hotkeys

support modifiers for build palette hotkeys
This commit is contained in:
Matthias Mailänder
2013-11-09 11:32:21 +01:00
parent 6c11ae36c7
commit a6f06a5dfd
5 changed files with 9 additions and 4 deletions

View File

@@ -461,7 +461,7 @@ namespace OpenRA.Mods.RA.Widgets
WidgetUtils.DrawPanel("dialog4", new Rectangle(Game.Renderer.Resolution.Width - 300, pos.Y, 300, longDescSize + 65));
Game.Renderer.Fonts["Bold"].DrawText(
tooltip.Name + ((buildable.Hotkey != null) ? " ({0})".F(buildable.Hotkey.ToUpper()) : ""),
tooltip.Name + (buildable.Hotkey.IsValid() ? " ({0})".F(buildable.Hotkey.DisplayString()) : ""),
p.ToInt2() + new int2(5, 5), Color.White);
var resources = pl.PlayerActor.Trait<PlayerResources>();
@@ -502,7 +502,7 @@ namespace OpenRA.Mods.RA.Widgets
if (!paletteOpen) return false;
if (CurrentQueue == null) return false;
var toBuild = CurrentQueue.BuildableItems().FirstOrDefault(b => b.Traits.Get<BuildableInfo>().Hotkey == KeycodeExts.DisplayString(e.Key));
var toBuild = CurrentQueue.BuildableItems().FirstOrDefault(b => b.Traits.Get<BuildableInfo>().Hotkey == Hotkey.FromKeyInput(e));
if (toBuild != null)
{