Add a Hotkey class for user-configurable keys. Fixes #3779.

Users can now define and use hotkeys that include modifiers (ctrl/meta/shift/alt).
This commit is contained in:
Paul Chote
2013-10-20 11:53:41 +13:00
parent aab6fec68b
commit 7ffbfb9b7e
16 changed files with 297 additions and 52 deletions

View File

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
var labelWidth = Game.Renderer.Fonts[label.Font].Measure(button.TooltipText).X;
label.Bounds.Width = labelWidth;
var hotkeyLabel = "({0})".F(button.Key.ToUpperInvariant());
var hotkeyLabel = "({0})".F(button.Key.DisplayString());
hotkey.GetText = () => hotkeyLabel;
hotkey.Bounds.X = labelWidth + 2 * label.Bounds.X;