Skip to content

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.

feat(gameclient): grid keys follow a qwerty, asdfgh, zxcvbn grid

Olcay Seyganed2d07b2e57c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4543bb2ee..ed569ed1b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -33,8 +33,8 @@ found and fixed — EA's own, not port damage.**
- The choice between a Classic and a Reforged interface is gone. There is one, laid out the way Zero Hour shipped, and the orders Reforged added now live on the keys you already know: A attack-moves, holding Ctrl fires on whatever is under the cursor as it did in 2003, a guard order can cover a patch of ground instead of one spot, and orders queue up one after another. Everything your base is building stands on the screen as a line of text each, the six closest to done first and "+N more" for the rest. Superweapon countdowns are listed the same way, up to eighteen. Both lists are in bold type, the build list in white and each countdown in its owner's colour. The promotion screen no longer darkens the battlefield behind it. Whether the right button gives orders, or the left as in 1.04, is a setting in the launcher.
- 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, R rally point, V evacuate or sell, C combat drop, and F for land mines, camo netting and the GLA worker's switch to fake buildings. Where a bunker, fire base, palace or tunnel has both evacuate and sell, V empties it and sell moves to O, so a slipped finger never sells a full bunker. The 182 buttons Zero Hour had put on one of those letters take another from their own name (the Avenger is E now), and no bar gained a clash doing 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 over A S D F covers the first four columns and Z X over C V the next two, with the fixed keys' places stepping one key along the row to J, K, T, L, N and B. The letter on each button changes to match, and type select, select all, scatter and the rest that sat on those letters step aside, with the page showing where each went.
+- Some keys now mean one thing on every bar: A attack move, S stop, G guard, R rally point, V evacuate or sell, C combat drop, and F for land mines, camo netting and the GLA worker's switch to fake buildings. Where a bunker, fire base, palace or tunnel has both evacuate and sell, V empties it and sell moves to O, so a slipped finger never sells a full bunker. The 182 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.
+- 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, with the places of A, S, R, F and G, which keep their orders, taking J, K, U, L and M. The bar is two rows deep, so Z X C V B N has no place on it, and the last column is for the mouse. The letter on each button changes to match, and type select, select all, scatter and the rest that sat on those letters step aside, with the page showing where each went.
## The command bar moves to the middle
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp
index a01b0f203..497e7a919 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp
@@ -306,12 +306,12 @@ 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 over A S D F take the first
- * four columns and Z X C V the next two. A, S, R, F, C and V belong to the fixed orders
- * (FIXED_KEYS), so their places take the next free key along the keyboard row instead: J, K, T, L,
- * N and B. Slots 13 and 14, the last column, get no key. The launcher's Hotkeys page draws the
- * same table (hotkeys.js, GRID_KEYS). */
-static const WideChar GRID_KEYS[] = { 'Q', 'J', 'W', 'K', 'E', 'D', 'T', 'L', 'Z', 'N', 'X', 'B' };
+ * 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 keyboard's third row, Z X C V B N, has no place. A, S, R, F and G
+ * belong to the fixed orders (FIXED_KEYS), so their places take a key off the grid instead: J, K,
+ * U, L and M. Slots 13 and 14, the last column, get no key. The launcher's Hotkeys page draws
+ * the same table (hotkeys.js, GRID_KEYS). */
+static const WideChar GRID_KEYS[] = { 'Q', 'J', 'W', 'K', 'E', 'D', 'U', 'L', 'T', 'M', 'Y', 'H' };
static const Int GRID_KEY_COUNT = sizeof( GRID_KEYS ) / sizeof( GRID_KEYS[ 0 ] );
static Bool s_commandGrid = FALSE;