diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs index 92bdab650e..be81802353 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncConquestObjectivesLogic.cs @@ -46,7 +46,6 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic foreach (var p in world.Players.Where(a => !a.NonCombatant)) { Player pp = p; - var c = world.LobbyInfo.ClientWithIndex(pp.ClientIndex); var item = itemTemplate.Clone(); var nameLabel = item.Get("NAME"); nameLabel.GetText = () => pp.WinState == WinState.Lost ? pp.PlayerName + " (Dead)" : pp.PlayerName; @@ -58,7 +57,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic item.Get("FACTION").GetText = () => pp.Country.Name; var team = item.Get("TEAM"); - team.GetText = () => (c.Team == 0) ? "-" : c.Team.ToString(); + team.GetText = () => (pp.PlayerReference.Team == 0) ? "-" : pp.PlayerReference.Team.ToString(); scrollpanel.AddChild(item); item.Get("KILLS").GetText = () => pp.Kills.ToString(); diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs index b961612561..cedab28475 100644 --- a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs +++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs @@ -123,6 +123,9 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic BindOrderButton(world, sidebarRoot, "SELL_BUTTON", "sell"); BindOrderButton(world, sidebarRoot, "REPAIR_BUTTON", "repair"); + sidebarRoot.Get("SELL_BUTTON").Key = Game.Settings.Keys.SellKey; + sidebarRoot.Get("REPAIR_BUTTON").Key = Game.Settings.Keys.RepairKey; + var powerManager = world.LocalPlayer.PlayerActor.Trait(); var playerResources = world.LocalPlayer.PlayerActor.Trait(); sidebarRoot.Get("CASH").GetText = () => diff --git a/OpenRA.Mods.RA/Widgets/Logic/IngameChromeLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/IngameChromeLogic.cs index a7356190e2..640e1b79c8 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/IngameChromeLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/IngameChromeLogic.cs @@ -53,6 +53,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic objectivesButton.IsVisible = () => world.LocalPlayer != null; } + var moneybin = gameRoot.Get("INGAME_MONEY_BIN"); + moneybin.Get("SELL").Key = Game.Settings.Keys.SellKey; + moneybin.Get("POWER_DOWN").Key = Game.Settings.Keys.PowerDownKey; + moneybin.Get("REPAIR").Key = Game.Settings.Keys.RepairKey; + optionsBG.Get("DISCONNECT").OnClick = () => LeaveGame(optionsBG, world); optionsBG.Get("SETTINGS").OnClick = () => Ui.OpenWindow("SETTINGS_MENU"); diff --git a/OpenRA.Mods.RA/Widgets/Logic/OrderButtonsChromeLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/OrderButtonsChromeLogic.cs index 907f21b5cb..c98b86a752 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/OrderButtonsChromeLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/OrderButtonsChromeLogic.cs @@ -41,6 +41,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { w.Pressed = () => world.OrderGenerator is T; w.OnMouseDown = mi => world.ToggleInputMode(); + w.OnKeyPress = ki => world.ToggleInputMode(); } } } diff --git a/OpenRA.Mods.RA/Widgets/Logic/SettingsMenuLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/SettingsMenuLogic.cs index 7530023eed..3c643c0df2 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/SettingsMenuLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/SettingsMenuLogic.cs @@ -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("UNITCOMMANDHOTKEY_LIST"); var unitCommandHotkeyTemplate = unitCommandHotkeyList.Get("UNITCOMMANDHOTKEY_TEMPLATE"); diff --git a/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs b/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs index 7e181fb528..32e3b65e4e 100644 --- a/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs +++ b/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs @@ -53,15 +53,6 @@ namespace OpenRA.Mods.RA.Widgets if (e.KeyName == Game.Settings.Keys.ToSelectionKey) return ToSelection(); - if (e.KeyName == Game.Settings.Keys.SellKey) - return PerformSwitchToSellMode(); - - if (e.KeyName == Game.Settings.Keys.PowerDownKey) - return PerformSwitchToPowerDownMode(); - - if (e.KeyName == Game.Settings.Keys.RepairKey) - return PerformSwitchToRepairMode(); - if (!World.Selection.Actors.Any()) // Put all functions, that are no unit-functions, before this line! return false; @@ -196,23 +187,5 @@ namespace OpenRA.Mods.RA.Widgets Game.viewport.Center(World.Selection.Actors); return true; } - - bool PerformSwitchToSellMode() - { - World.ToggleInputMode(); - return true; - } - - bool PerformSwitchToPowerDownMode() - { - World.ToggleInputMode(); - return true; - } - - bool PerformSwitchToRepairMode() - { - World.ToggleInputMode(); - return true; - } } } diff --git a/mods/cnc/bits/nopower.shp b/mods/cnc/bits/nopower.shp new file mode 100644 index 0000000000..b57ce96fd6 Binary files /dev/null and b/mods/cnc/bits/nopower.shp differ diff --git a/mods/cnc/bits/poweroff.shp b/mods/cnc/bits/poweroff.shp new file mode 100644 index 0000000000..04a194e6da Binary files /dev/null and b/mods/cnc/bits/poweroff.shp differ diff --git a/mods/cnc/chrome/ingame.yaml b/mods/cnc/chrome/ingame.yaml index 779d911eed..21d839f3b0 100644 --- a/mods/cnc/chrome/ingame.yaml +++ b/mods/cnc/chrome/ingame.yaml @@ -112,7 +112,6 @@ Container@PLAYER_WIDGETS: ImageCollection:order-icons ImageName:options ToggleButton@SELL_BUTTON: - Key: [ X:82 Y:0-24 Width:30 @@ -126,7 +125,6 @@ Container@PLAYER_WIDGETS: Y:5 ImageCollection:order-icons ToggleButton@REPAIR_BUTTON: - Key: ] X:122 Y:0-24 Width:30 diff --git a/mods/cnc/cursors.yaml b/mods/cnc/cursors.yaml index 854dd17291..356daf14e4 100644 --- a/mods/cnc/cursors.yaml +++ b/mods/cnc/cursors.yaml @@ -272,4 +272,16 @@ Cursors: start:213 length:1 x:12 - y:12 \ No newline at end of file + y:12 + + nopower: cursor + powerdown-blocked: + start:0 + length: 1 + x: 12 + y: 12 + powerdown: + start:1 + length: 3 + x: 12 + y: 12 \ No newline at end of file diff --git a/mods/cnc/notifications.yaml b/mods/cnc/notifications.yaml index 48e4d674ed..fe9699c073 100644 --- a/mods/cnc/notifications.yaml +++ b/mods/cnc/notifications.yaml @@ -29,6 +29,8 @@ Sounds: CashTickUp: CashTickDown: LevelUp: text2 + DisablePower: bleep11 + EnablePower: bleep12 ChatLine: scold1 TabClick: button ClickSound: button diff --git a/mods/cnc/sequences/misc.yaml b/mods/cnc/sequences/misc.yaml index fbb4ebf640..7017e13d48 100644 --- a/mods/cnc/sequences/misc.yaml +++ b/mods/cnc/sequences/misc.yaml @@ -269,3 +269,13 @@ overlay: Start: 0 target-invalid: Start: 1 + +powerdown: + disabled: speed + Start: 3 + +poweroff: + offline: + Start: 0 + Length: * + Tick: 160 \ No newline at end of file