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
feat(gameclient): select several buildings together again
Olcay Seygan801e441daa52
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1f33d72dc..5c7fef5a8 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -46,6 +46,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, 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.+- 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. A building and a unit still never share a selection.- 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.diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cppindex 0533f26ae..852c3bd16 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp@@ -5817,8 +5817,8 @@ Bool Drawable::isSelectable( void ) const//-------------------------------------------------------------------------------------------------Bool Drawable::isMassSelectable( void ) const{- // the game as shipped, where a structure was only ever selected on its own- return getObject() && getObject()->isMassSelectable() && !getObject()->isKindOf( KINDOF_STRUCTURE );+ // structures group too; SelectionXlat keeps them out of a selection of units+ return getObject() && getObject()->isMassSelectable();}//-------------------------------------------------------------------------------------------------diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cppindex dbdda6c41..fd4087860 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp@@ -580,9 +580,9 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa// buildings and units stay in separate selections, and a double click that// gathers everything of a kind may only gather what a box would - things// you can click one at a time but never sweep up used to come along. Classic keeps- // 1.04's rule, which put back everything that was selected- const Bool keep = TheGlobalData->isClassicMouse() ? (draw && draw->isSelectable())- : (draw && draw->isMassSelectable() && draw->isKindOf( KINDOF_STRUCTURE ) == picked->isKindOf( KINDOF_STRUCTURE ));+ // 1.04's rule, which put back everything that was selected of the same kind+ const Bool keep = draw && draw->isKindOf( KINDOF_STRUCTURE ) == picked->isKindOf( KINDOF_STRUCTURE )+ && ( TheGlobalData->isClassicMouse() ? draw->isSelectable() : draw->isMassSelectable() );if (keep) {TheInGameUI->selectDrawable(draw);selectMore->appendObjectIDArgument(draw->getObject()->getID());@@ -816,55 +816,16 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessaBool addToGroup = TheInGameUI->isInPreferSelectionMode();- const Bool classic = TheGlobalData->isClassicMouse();if (si.currentCountEnemies > 0 ||si.currentCountCivilians > 0 ||- si.currentCountFriends > 0 ||- (classic && si.currentCountMineBuildings > 0))+ si.currentCountFriends > 0){// force a new group creationaddToGroup = FALSE;}- // Classic is the game as shipped: a structure is only ever selected on its own, when it is the- // one thing clicked or the only selectable thing in the box (EA's Firebase case)- if (si.newCountMine > 0 && classic)- {- si.selectMine = TRUE;- if ( si.newCountMineBuildings == 1 && si.newCountMine == 1 )- {- addToGroup = FALSE;- si.selectMineBuildings = TRUE;- }- else if ( si.newCountMineBuildings > 0 )- {- Bool onlyTheOneBuildingIsSelectableAnyway = TRUE;- DrawableID buildingID = INVALID_DRAWABLE_ID;- for (DrawableListIt it = drawablesThatWillSelect.begin(); it != drawablesThatWillSelect.end(); ++it)- {- const Drawable *d = *it;- if ( d->isKindOf( KINDOF_STRUCTURE ) )- {- if ( buildingID == INVALID_DRAWABLE_ID )- buildingID = d->getID();- else if ( buildingID != d->getID() )- onlyTheOneBuildingIsSelectableAnyway = FALSE;- }- else if ( d->isSelectable() )- onlyTheOneBuildingIsSelectableAnyway = FALSE;-- if ( ! onlyTheOneBuildingIsSelectableAnyway )- break;- }- if ( onlyTheOneBuildingIsSelectableAnyway )- {- addToGroup = FALSE;- si.selectMineBuildings = TRUE;- }- }- }// If there are any of my units, then select those.- else if (si.newCountMine > 0)+ if (si.newCountMine > 0){si.selectMine = TRUE;