Add hotkeys for viewport bookmarks.

This commit is contained in:
Paul Chote
2016-07-09 01:08:36 +01:00
parent 196dd04b5d
commit 2ed6706f59

View File

@@ -450,17 +450,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{ "CycleStatusBarsKey", "Cycle status bars display" },
{ "TogglePixelDoubleKey", "Toggle pixel doubling" },
{ "ToggleMuteKey", "Toggle audio mute" },
{ "TogglePlayerStanceColorsKey", "Toggle player stance colors" },
{ "MapScrollUp", "Map scroll up" },
{ "MapScrollDown", "Map scroll down" },
{ "MapScrollLeft", "Map scroll left" },
{ "MapScrollRight", "Map scroll right" },
{ "MapPushTop", "Map push to top" },
{ "MapPushBottom", "Map push to bottom" },
{ "MapPushLeftEdge", "Map push to left edge" },
{ "MapPushRightEdge", "Map push to right edge" }
{ "TogglePlayerStanceColorsKey", "Toggle player stance colors" }
};
var header = ScrollItemWidget.Setup(hotkeyHeader, returnTrue, doNothing);
@@ -471,6 +461,29 @@ namespace OpenRA.Mods.Common.Widgets.Logic
BindHotkeyPref(kv, ks, globalTemplate, hotkeyList);
}
// Viewport
{
var hotkeys = new Dictionary<string, string>()
{
{ "MapScrollUp", "Scroll up" },
{ "MapScrollDown", "Scroll down" },
{ "MapScrollLeft", "Scroll left" },
{ "MapScrollRight", "Scroll right" },
{ "MapPushTop", "Jump to top edge" },
{ "MapPushBottom", "Jump to bottom edge" },
{ "MapPushLeftEdge", "Jump to left edge" },
{ "MapPushRightEdge", "Jump to right edge" }
};
var header = ScrollItemWidget.Setup(hotkeyHeader, returnTrue, doNothing);
header.Get<LabelWidget>("LABEL").GetText = () => "Viewport Commands";
hotkeyList.AddChild(header);
foreach (var kv in hotkeys)
BindHotkeyPref(kv, ks, globalTemplate, hotkeyList);
}
// Observer
{
var hotkeys = new Dictionary<string, string>()