Merge pull request #2801 from Mailaender/hotkey-cleanup

Remove inconsistencies that crash C&C mod
This commit is contained in:
Matthias Mailänder
2013-03-26 14:28:49 -07:00
12 changed files with 39 additions and 32 deletions

View File

@@ -53,6 +53,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
objectivesButton.IsVisible = () => world.LocalPlayer != null;
}
var moneybin = gameRoot.Get("INGAME_MONEY_BIN");
moneybin.Get<OrderButtonWidget>("SELL").Key = Game.Settings.Keys.SellKey;
moneybin.Get<OrderButtonWidget>("POWER_DOWN").Key = Game.Settings.Keys.PowerDownKey;
moneybin.Get<OrderButtonWidget>("REPAIR").Key = Game.Settings.Keys.RepairKey;
optionsBG.Get<ButtonWidget>("DISCONNECT").OnClick = () => LeaveGame(optionsBG, world);
optionsBG.Get<ButtonWidget>("SETTINGS").OnClick = () => Ui.OpenWindow("SETTINGS_MENU");

View File

@@ -41,6 +41,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
{
w.Pressed = () => world.OrderGenerator is T;
w.OnMouseDown = mi => world.ToggleInputMode<T>();
w.OnKeyPress = ki => world.ToggleInputMode<T>();
}
}
}

View File

@@ -176,6 +176,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
SetupKeyBinding(repairKey, "Switch to Repair-Cursor:", () => keyConfig.RepairKey, k => keyConfig.RepairKey = k);
specialHotkeyList.AddChild(repairKey);
var tabCycleKey = ScrollItemWidget.Setup(specialHotkeyTemplate, () => false, () => {});
SetupKeyBinding(tabCycleKey, "Cycle Tabs (+Shift to Reverse):", () => keyConfig.CycleTabsKey, k => keyConfig.CycleTabsKey = k);
specialHotkeyList.AddChild(tabCycleKey);
var unitCommandHotkeyList = keys.Get<ScrollPanelWidget>("UNITCOMMANDHOTKEY_LIST");
var unitCommandHotkeyTemplate = unitCommandHotkeyList.Get<ScrollItemWidget>("UNITCOMMANDHOTKEY_TEMPLATE");