Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(gameclient): six fixed orders keep their keys with grid keys on
Olcay Seygan3974cf43a1d3
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0cd6d6f04..704a6c05c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -37,7 +37,7 @@ found and fixed — EA's own, not port damage.**- Every key is yours to move. The launcher's Hotkeys page draws the command bar of every building and unit each general can field, cameos and letters as the game shows them, and a click and a keypress gives any button a new letter or none. Two buttons on one bar that would share a letter are marked before you play. The keyboard commands are there too, from bookmarks and team keys to the camera, along with the ones Zero Hour never bound: select every fighting unit, vehicle or aircraft, every barracks, war factory or airfield, the next idle worker or unit, pause, the general's promotions, the three signals to your allies and the general's powers. Your keys are yours alone; the other players in a match keep theirs, and a match never refuses you for them. Every mod you install brings its own generals to the page, ShockWave's fifteen next to Zero Hour's thirteen, and a key you give a ShockWave button stays with ShockWave.- Some keys now mean one thing on every bar: A attack move, S stop, G guard, Y rally point, V evacuate, N sell, C combat drop, and H for land mines, camo netting and the GLA worker's switch to fake buildings. Sell sits on its own key, so emptying a bunker can never sell it. The 188 buttons Zero Hour had put on one of those letters take another, kept off the grid keys where the bar leaves room (the Avenger is J now), and no bar gained a clash doing it.- Export and Import on the Hotkeys page take your keys to a file and back, for another PC or a fresh install. Before an import the page tells you how many keys it changes and how many would clash; a file with a line it cannot read changes nothing and quotes that line. Keys for a mod you have not installed come along and wait for it.-- Grid keys, one switch on the Hotkeys page: a button's key is its place on the bar, so the first button of a Command Center is Q and so is the first of a Barracks, a War Factory or a dozer. The keyboard's Q W E R T Y over A S D F G H covers the first six columns and B over N the last, so every key on the bar sits in the 18-key block under your left hand and sell stays on N. With the grid on, the grid wins: attack move, stop, guard and rally point take the key of the place they stand on like any other button. The letter on each button changes to match, and type select, select all, stop and the rest that sat on those letters step aside to Z or to keys right of the letters, with the page showing where each went.+- Grid keys, one switch on the Hotkeys page: a button's key is its place on the bar, so the first button of a Command Center is Q and so is the first of a Barracks, a War Factory or a dozer. Every key on the bar sits in the 18-key block under your left hand, Q W E R T Y over A S D F G H over Z X C V B N. Attack move, stop, guard, rally point, evacuate and combat drop keep A, S, G, Y, V and C wherever they stand; the other twelve letters are places, Q W E R T along the top with Z X D F B under them, H in the sixth column and N, still sell, in the last. The places attack move and rally point usually hold have no letter of their own, so a button that lands there has no key. The letter on each button changes to match, and type select, select all, scatter and the rest that sat on those letters step aside to P and the keys right of the letters, with the page showing where each went.## The command bar moves to the middlediff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h b/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.hindex 2134e83d3..3472b6d55 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/HotKey.h@@ -114,7 +114,7 @@ public:* took the key away, and labelKey, the letter after the label's '&', where the player left the* button alone; upper case. Attack move, stop, guard, rally point, evacuate and sell have their* fixed letters and no other button gets one. With grid keys on (INI::parseCommandBarGridDefinition) a button on the command bar,- * barSlot its ButtonCommand number less one, gets its place's key instead, fixed orders too, and any other button+ * barSlot its ButtonCommand number less one, gets its place's key instead, except attack move, stop, guard, rally point, evacuate and combat drop, and any other button* (barSlot -1) loses a letter the grid uses. */static WideChar playerButtonKey( const AsciiString& button, WideChar labelKey, Int barSlot,Int commandType );diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cppindex be5048ae8..b0a560db9 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp@@ -306,20 +306,25 @@ AsciiString HotKeyManager::searchHotKey( const UnicodeString& uStr )static std::map< std::string, WideChar > s_playerButtonKeys;/** Grid keys (Hotkeys.ini's CommandBarGrid), by command bar slot: ControlBar.wnd's ButtonCommand01- * to 14 stand two rows of seven read down the columns, so Q W E R T Y over A S D F G H take the- * first six columns and the last column, slots 13 and 14, takes B over N from the keyboard's third- * row, so sell keeps its N. With grid keys on the grid wins on the bar: a fixed order (FIXED_KEYS)- * takes its place's key like any other button. The launcher's Hotkeys page draws the same table+ * to 14 stand two rows of seven read down the columns, and take the twelve letters of the Q W E R T+ * Y / A S D F G H / Z X C V B N block that are no GRID_FIXED_KEYS. Q W E R T top the first five+ * columns, Z X D F B under them, each under its own column where the fixed A, S and G leave a gap;+ * the sixth column is H under attack move's place (slot 11) and the seventh N, sell's key, under+ * the rally point's (slot 13). Those two places have no key: a fixed order standing there shows+ * its own letter, any other button none. The launcher's Hotkeys page draws the same table* (hotkeys.js, GRID_KEYS). */-static const WideChar GRID_KEYS[] = { 'Q', 'A', 'W', 'S', 'E', 'D', 'R', 'F', 'T', 'G', 'Y', 'H', 'B', 'N' };+static const WideChar GRID_KEYS[] = { 'Q', 'Z', 'W', 'X', 'E', 'D', 'R', 'F', 'T', 'B', 0, 'H', 0, 'N' };static const Int GRID_KEY_COUNT = sizeof( GRID_KEYS ) / sizeof( GRID_KEYS[ 0 ] );static Bool s_commandGrid = FALSE;-/** The owner's fixed keys, 2026-10-12, on every bar while grid keys are off: A attack move, S stop,- * G guard, Y rally point, V evacuate, N sell, C combat drop, and H for land mines, camo netting- * and the GLA's fake and real switches, which go by button name. No other button may have one of- * these letters. The launcher holds the same tables (hotkeys.js, FIXED_KEYS). */+/** The owner's fixed keys, 2026-10-12, on every bar: A attack move, S stop, G guard, Y rally+ * point, V evacuate, N sell, C combat drop, and H for land mines, camo netting and the GLA's fake+ * and real switches, which go by button name. No other button may have one of these letters.+ * With grid keys on only GRID_FIXED_KEYS hold, on any bar and slot; sell and the H buttons take+ * their place's key. The launcher holds the same tables (hotkeys.js, FIXED_KEYS and+ * GRID_FIXED_LETTERS). */static const WideChar FIXED_KEYS[] = { 'A', 'S', 'G', 'Y', 'V', 'N', 'C', 'H' };+static const WideChar GRID_FIXED_KEYS[] = { 'A', 'S', 'G', 'Y', 'V', 'C' };static const char *const FIXED_H_BUTTONS[] ={"command_upgradechinamines", "command_upgradeempmines", "command_upgradecamonetting", "command_upgradeglacamonetting",@@ -423,9 +428,13 @@ WideChar HotKeyManager::playerButtonKey( const AsciiString& button, WideChar lablower.toLower();Int ownMod = -1;const std::string bare = withoutModPrefix( lower.str(), &ownMod );+ const WideChar fixed = fixedButtonKey( AsciiString( bare.c_str() ), commandType );if( s_commandGrid && barSlot >= 0 )+ {+ if( fixed != 0 && isOneOf( fixed, GRID_FIXED_KEYS, (Int)( sizeof( GRID_FIXED_KEYS ) / sizeof( GRID_FIXED_KEYS[ 0 ] ) ) ) )+ return fixed;return barSlot < GRID_KEY_COUNT ? GRID_KEYS[ barSlot ] : 0;- const WideChar fixed = fixedButtonKey( AsciiString( bare.c_str() ), commandType );+ }if( fixed != 0 )return fixed;