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): take the force attack button off the command bar
Olcay Seygane1c90fb569c7
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 958fd9b79..9a308fe97 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -91,7 +91,7 @@ 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 (that hold is yours to move on the launcher's Command bar page), 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.- An attack move and a Ctrl attack fire on the left click in every mouse setup. With the right button giving orders, A then a right click attack-moved, and Ctrl fired only on a right click, so the same hands did different things depending on one checkbox. Now A, or Ctrl held, then a left click is the attack everywhere, and a right click with A armed puts the key down without an order. Ctrl with a right click gives none. Plain orders stay on whichever button your setup gives them.-- Combat units that attack-move now have a Force Attack button on the command bar, under Attack Move and left of Stop. Base defences that shoot have it too: the Patriot Battery of every general, the Gattling Cannon, the Fire Base, the Stinger Site and the Bunker, wherever their bar has a free place, so a defence can fire on the ground or on a friendly. So does the Air Force General's Combat Chinook. In the Bunker and the Chinook it is the soldiers inside who fire, and Ctrl on a garrisoned Bunker now takes a unit as its target as well as the ground; before, only the ground. A Tunnel Network's bar is full, and so is the Infantry General's ten-man Bunker, so neither gets the button. It arms the same fire-on-whatever-is-under-the-pointer mode the hold key has always given. The hold is Ctrl until you change it on the launcher's Hotkeys page, Command bar tab, and the button wears whatever you bound. Shift on top of that hold keeps it: the pointer stays the force-fire one, and a drag draws the attack line instead of the circle. This version's data checksum differs, so it cannot join a game hosted on an older one.+- Ctrl on a garrisoned Bunker fires on a unit as well as the ground, where it used to take only the ground. The soldiers inside do the shooting, and the Air Force General's Combat Chinook takes a Ctrl target the same way. Shift on top of the Ctrl hold keeps it: the pointer stays the force-fire one, and a drag draws the attack line instead of the circle. The Force Attack button 3.1.0 put on the command bar is gone again, since Ctrl already did everything it did, and each bar has its old empty place back.- The dark plate behind Exit, Restart and the options screen in a match covers the whole picture. It used to sit in a 4:3 frame in the middle, so a widescreen left the battlefield bright down both sides. The box itself keeps the shape it was drawn in.- Buildings select together again, which the one interface had taken away. Shift-click them, drag a box over them, or double-click one for every building of its kind on the screen; select four War Factories and each tank you click goes to whichever has the shortest queue. Double-click a unit and every one of that kind whose feet sit in the picture is taken, including the ones sitting past the camera's far clip that used to be skipped. A building and a unit still never share a selection.- Formation lines are back for everyone. With move, attack move or guard armed, a left drag spreads the selection along the line you draw again; since the one interface it drew a selection box instead, because the line was switched off for the Classic mouse that every player now runs. A drag with no order armed is still the selection box.diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cppindex c2e01ab6e..034263041 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp@@ -4403,24 +4403,10 @@ void ControlBar::setControlCommand( GameWindow *button, const CommandButton *com// wears it in its top left corner.if( TheHotKeyManager ){- // Force Attack wears the BEGIN_FORCEATTACK hold from MetaMap (Ctrl until the player- // rebinds it on the launcher's Command bar tab). Showing H or F on the cameo would- // steal that letter and lie about the key. Do not addHotKey it: the hold is already- // MSG_META_BEGIN_FORCEATTACK, and binding the button to that key would toggle on every press.- const Bool forceAttack = commandButton->getCommandType() == GUI_COMMAND_FORCE_ATTACK;- const WideChar letter = forceAttack ? 0 : HotKeyManager::playerButtonKey( commandButton->getName(),+ const WideChar letter = HotKeyManager::playerButtonKey( commandButton->getName(),TheGameText ? TheGameText->fetchEnglishHotKey( commandButton->getTextLabel() ) : 0,commandButton->getCommandType() );- if( forceAttack )- {- const UnicodeString chord = MetaMap_chordLabel( GameMessage::MSG_META_BEGIN_FORCEATTACK );- GadgetButtonSetText( button, chord );- if( chord.isEmpty() )- button->winClearStatus( WIN_STATUS_SHORTCUT_BUTTON );- else- button->winSetStatus( WIN_STATUS_SHORTCUT_BUTTON );- }- else if( letter != 0 )+ if( letter != 0 ){TheHotKeyManager->addHotKey( button, HotKeyManager::nameOf( letter ) );const WideChar text[ 2 ] = { letter, 0 };diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cppindex 226bd583c..730519087 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp@@ -397,15 +397,6 @@ void ControlBar::populateCommand( Object *obj )types[ i ] = ( set[ i ] && !BitTest( set[ i ]->getOptions(), SCRIPT_ONLY ) ) ? set[ i ]->getCommandType() : GUI_COMMAND_NONE;windowed[ i ] = m_commandWindows[ i ] != NULL;}- {- const Int forceSlot = ControlBar_forceAttackSlot( types, MAX_COMMANDS_PER_SET, ControlBar_forceFires( obj ) );- const CommandButton *force = forceSlot >= 0 ? findCommandButton( AsciiString( "Command_ForceAttack" ) ) : NULL;- if( force )- {- set[ forceSlot ] = force;- types[ forceSlot ] = force->getCommandType();- }- }ControlBar_fitCommandSlots( types, windowed, MAX_COMMANDS_PER_SET, shown );// a window nothing is fitted to stays empty: its own slot is empty or script onlydiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cppindex 58c862a0c..a400e46c4 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp@@ -337,11 +337,6 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control,TheInGameUI->setGUICommand( NULL );TheMessageStream->appendMessage( GameMessage::MSG_META_TOGGLE_ATTACKMOVE );}- else if( commandButton->getCommandType() == GUI_COMMAND_FORCE_ATTACK )- {- TheInGameUI->setGUICommand( NULL );- TheMessageStream->appendMessage( GameMessage::MSG_META_TOGGLE_FORCEATTACK );- }else if( BitTest( commandButton->getOptions(), COMMAND_OPTION_NEED_TARGET ) ){if (commandButton->getOptions() & USES_MINE_CLEARING_WEAPONSET)