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.

fix(gameclient): follow the cursor while held on the radar

Olcay Seyganb9576a4e2b5f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9bb66aeeb..6c5ba7e0f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1239,7 +1239,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same
- Classic's command bar lets the battlefield have the ground it shows. A click on the battlefield between its three pieces, or over the sloped shoulders of the build grid's plate, reaches the unit standing there; only the painted metal keeps it. Change the resolution with the bar minimised and the build tooltip used to come back 245 pixels too high at 1920x1080, as far as the bar had dropped; it stays over the radar now. The Chinese beacon button, the red one with the exclamation mark, no longer sits on a black card: EA's picture of it had no transparent corners, and the lit and pressed versions always did.
- Classic's command bar empties when you let your worker go, as 1.04's did. Reforged's habit of showing a builder's buildings with nothing selected had leaked into Classic, so a dozer's build menu stayed on the bar after you dropped it, and was there from the first second of a match before you had picked anything. In Reforged that builder's menu now also comes back after a resolution change; it used to leave the bar empty until you clicked something.
- Classic brings back 1.04's Alternate Mouse Setup, on its Controls page where EA had it and off until you tick it. Ticked, the right button gives the order and the left one only selects: a left click on open ground drops your selection, a right drag still scrolls the map, a double right click is the guard order when Double Click Guard is ticked, and the radar looks on the left button and sends units on the right. It is saved under the name 1.04 gave it, so a settings file 1.04 wrote keeps your choice. Reforged has one mouse, no box, and ignores the setting. The orders are 1.04's either way, so the box changes nothing about a match or its replay.
-- Both of Classic's mouse setups now answer every click the way 1.04 did, checked against EA's code one case at a time. The attack move button waits for its click again, like guard: the left button aims it whichever setup you play, and a right click takes it back with your units still selected. Until now a right click there threw your whole selection away, and with the Alternate Mouse Setup ticked the left click did nothing while the right one fired it. A right click that takes back a waiting command gives no order behind it. With a dozer's building on the cursor a right click drops the building and lets go of the dozer, as it did in 2003. The right press starts the scroll at once and only a real click deselects, so a press held for a quarter of a second, or one the scroll carried the camera away from, keeps your selection. The radar sends a plain move, or an attack move when that button is waiting, and Alt held over it no longer makes a waypoint. Dragging on it leaves the camera where the press put it. Reforged's mouse is untouched.
+- Both of Classic's mouse setups now answer every click the way 1.04 did, checked against EA's code one case at a time. The attack move button waits for its click again, like guard: the left button aims it whichever setup you play, and a right click takes it back with your units still selected. Until now a right click there threw your whole selection away, and with the Alternate Mouse Setup ticked the left click did nothing while the right one fired it. A right click that takes back a waiting command gives no order behind it. With a dozer's building on the cursor a right click drops the building and lets go of the dozer, as it did in 2003. The right press starts the scroll at once and only a real click deselects, so a press held for a quarter of a second, or one the scroll carried the camera away from, keeps your selection. The radar sends a plain move, or an attack move when that button is waiting, and Alt held over it no longer makes a waypoint. Hold the look button on it and the camera follows the cursor over the map until you let go; it used to sit where the press put it, so crossing the map meant clicking your way over it. A selection box dragged onto the radar from the battlefield still leaves the camera where it is.
- Supply piles stop shouting their cash over the whole map. A small pile shows its amount only while your cursor is on it or close by, in a smaller font; a big supply dock keeps its label all the time. Classic has the same labels now, with the radar still leaving the piles off.
- The Esc menu and the general's promotion screen close the way they open, in both interfaces. Both used to vanish in a single frame, and Classic's Esc menu had lost its opening flash as well. Classic plays 1.04's flash and fade, forwards to open and backwards to close; Reforged fades its pages out over a little more than a tenth of a second, as fast as they fade in.
- Every graphics setting is on the Graphics and Effects pages. Shadows, clouds, ground lighting, soft water edges, trees, extra animations, heat haze, texture resolution and the particle limit used to hide in a popup that only opened if you picked Custom from the detail box on another page, so choosing High never showed you what High turns on. Pick a preset now and its settings change in front of you; touch any one of them and the box reads Custom. Texture filtering and the number of anisotropic samples, which needed a text editor, sit there too.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
index 6176d30a9..1a3415b81 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
@@ -340,13 +340,11 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg,
// divides the world the other way round, and so did the radar in the game as shipped,
// except under EA's Alternate Mouse Setup, which looked with the left.
const UnsignedInt lookButton = TheGlobalData->leftButtonOrders() ? GWM_RIGHT_DOWN : GWM_LEFT_DOWN;
- // the classic mouse's look is 1.04's, the press alone: a drag on the radar left the camera
- // where it was
+ // that look button held on the radar keeps the camera under the cursor, Classic included
if( drawableList->empty() || msg == lookButton )
{
radarLookAt( &world );
- if( !TheGlobalData->isClassicMouse() )
- s_radarLookDrag = (msg == GWM_LEFT_DOWN) ? GWM_LEFT_DRAG : GWM_RIGHT_DRAG;
+ s_radarLookDrag = (msg == GWM_LEFT_DOWN) ? GWM_LEFT_DRAG : GWM_RIGHT_DRAG;
break;
}