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): let a held right button on the radar follow the cursor
Olcay Seyganc9e3807ba943
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 99d6e702f..ad44d1f71 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -155,6 +155,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.+- Holding the right button on the radar now carries the camera with the cursor when the left button gives orders. The radar has looked with the held button since the last version, but only the left one ever got the drag: the right press moved the camera once and then sat there, so in the game's default setup crossing the map still meant clicking your way over it.- 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.diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cppindex 9b19cb60e..4746d8dc0 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp@@ -184,7 +184,14 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessagemsg->getType() == GameMessage::MSG_RAW_MOUSE_RIGHT_DOUBLE_CLICK )m_rightClickTaken = FALSE;if( m_rightClickTaken && msg->getType() == GameMessage::MSG_RAW_MOUSE_RIGHT_DRAG )+ {+ // The windows still see the drag, so a right press that looked on the radar keeps the camera+ // under the cursor, but the battlefield never does and cannot scroll under it.+ ICoord2D mousePos = msg->getArgument(0)->pixel;+ ICoord2D delta = msg->getArgument(1)->pixel;+ TheWindowManager->winProcessMouseEvent(GWM_RIGHT_DRAG, &mousePos, &delta);return DESTROY_MESSAGE;+ }if( m_rightClickTaken && msg->getType() == GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP ){m_rightClickTaken = FALSE;diff --git a/GeneralsMD/Code/Tests/test_minimap_input.inc b/GeneralsMD/Code/Tests/test_minimap_input.incindex cb7afdc36..3061fff65 100644--- a/GeneralsMD/Code/Tests/test_minimap_input.inc+++ b/GeneralsMD/Code/Tests/test_minimap_input.inc@@ -391,9 +391,9 @@ TEST(minimap_drag_works_during_keyboard_scroll_and_pins_to_a_letterboxed_pictureCHECK(f.windows.winGetGrabWindow() == NULL);}-/* 1.04's radar in both of its mouse setups: the look button moves the camera on the press and a drag- after it leaves the camera alone. */-TEST(minimap_classic_looks_on_the_press_in_both_mouse_setups)+/* Classic's radar in both of 1.04's mouse setups: the look button moves the camera on the press, the+ camera follows the cursor while that button is held, and stops following on the release. */+TEST(minimap_classic_look_follows_the_held_button_in_both_mouse_setups){CHECK(bootOnce());for (Int alternate = 0; alternate < 2; ++alternate)@@ -409,12 +409,18 @@ TEST(minimap_classic_looks_on_the_press_in_both_mouse_setups)const GameMessage::Type lookDrag = alternate ? GameMessage::MSG_RAW_MOUSE_LEFT_DRAG : GameMessage::MSG_RAW_MOUSE_RIGHT_DRAG;const GameMessage::Type lookUp = alternate ? GameMessage::MSG_RAW_MOUSE_LEFT_BUTTON_UP : GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP;+ // the cursor is over the radar before it presses there, as it always is in the game+ f.event(messages, GameMessage::MSG_RAW_MOUSE_POSITION, 120, 220);f.event(messages, lookDown, 120, 220);CHECK(f.engine.view.lookAtCalls == 1);+ const Coord3D pressed = *f.engine.view.getPosition();f.event(messages, lookDrag, 150, 250);- CHECK(f.engine.view.lookAtCalls == 1);+ CHECK(f.engine.view.lookAtCalls == 2);+ CHECK(f.engine.view.getPosition()->x != pressed.x || f.engine.view.getPosition()->y != pressed.y);f.event(messages, lookUp, 150, 250);CHECK(messages.commands.getFirstMessage() == NULL);+ f.event(messages, lookDrag, 180, 280);+ CHECK(f.engine.view.lookAtCalls == 2);}}