Hook up observer view keybindings. Fixes #4435.

Uses 0-9 to select view (plus shift to cycle backwards), '-' for                 combined shroud and '=' for world view.
This commit is contained in:
Paul Chote
2014-03-22 21:50:05 +13:00
parent a31cdec87a
commit 3a8c94d8f8
6 changed files with 77 additions and 11 deletions

View File

@@ -279,6 +279,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
{ "GuardKey", "Guard" }
};
var observerHotkeys = new Dictionary<string, string>()
{
{ "ObserverCombinedView", "All Players" },
{ "ObserverWorldView", "Disable Shroud" }
};
var gs = Game.Settings.Game;
var ks = Game.Settings.Keys;
@@ -304,6 +310,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
foreach (var kv in specialHotkeys)
BindHotkeyPref(kv, ks, globalTemplate, hotkeyList);
var observerHeader = ScrollItemWidget.Setup(hotkeyHeader, () => true, () => {});
observerHeader.Get<LabelWidget>("LABEL").GetText = () => "Observer Commands";
hotkeyList.AddChild(observerHeader);
foreach (var kv in observerHotkeys)
BindHotkeyPref(kv, ks, globalTemplate, hotkeyList);
var unitHeader = ScrollItemWidget.Setup(hotkeyHeader, () => true, () => {});
unitHeader.Get<LabelWidget>("LABEL").GetText = () => "Unit Commands";
hotkeyList.AddChild(unitHeader);