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): right drag pans, middle drag rotates, move key draws line
Olcay Seygan23a55cacc6ab
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 289a545b1..24ddc45a6 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -169,9 +169,9 @@ found and fixed — EA's own, not port damage.**- Ctrl+Q now takes infantry only, not every armed thing you own.- A box drawn with Ctrl held takes those units back out of your selection instead of replacing it, so a group is trimmed by dragging over the corner of it rather than picked again from scratch. Held with Alt the box keeps only what can shoot: drag across your base and you get the tanks, not the dozers and supply trucks standing among them. Both are drag-only, and a single click still means exactly what it always did.- A box dragged over your army and your economy together takes the army. The dozers, workers, supply trucks and hackers standing among the tanks stay where they are, and ambulances and troop carriers go with the soldiers they look after. A box with nobody military in it takes the workers the way it always did.-- The three buttons each do one thing now. Left selects, and only selects. Right gives orders, and nothing it does moves the camera. The camera is on the middle button, and it scrolls the way the right button used to: the spot you pressed on stays put, and the further you pull away from it the faster the map runs. Hold Ctrl and the same drag turns the view instead. The wheel zooms toward whatever the cursor is over and the screen edges still scroll. The classic scheme, where left both selected and commanded and right scrolled and deselected, is gone rather than switched off, and the two checkboxes that used to choose between them are out of the options screen.+- The three buttons are split cleanly now. Left selects, and only selects. A right click gives the order, and a right drag scrolls the map the way it did in 2003: the spot you pressed on stays put, and the further you pull away from it the faster the map runs. The drag only starts once the pointer has really travelled, so a click your hand wobbles a pixel or two is still an order and the camera does not twitch. A pan never throws away the building on your cursor or the power you were about to aim. The middle button turns the view, with no key held, and a middle click without a drag puts the camera back where it started. The wheel zooms toward whatever the cursor is over and the screen edges still scroll. The classic scheme, where left both selected and commanded and right scrolled and deselected, is gone rather than switched off, and the two checkboxes that used to choose between them are out of the options screen.- An isometric camera, on Options > Controls. It looks at the battlefield from far off through a narrow lens, so a tank at the top of the screen is drawn the same size as one at the bottom and a base reads like a city-builder's plan instead of shrinking into the distance. It buys no extra sight. The normal camera's corners, edges and centre are laid over the isometric screen as closely as a flat picture allows, hills and ultrawide screens included: the normal camera still sees a little more at the far corners and the isometric one the same amount more at the near corners, because a perspective view is wider at the back than at the front and an isometric one is not. Pan across a ridge and the picture holds its size and its angle; it does not rise and dip with the ground under it. You still turn and zoom it the way you always did, and the box takes effect the moment you tick it, mid-match included.-- Drag the right button and you draw a line: the selection spreads itself evenly along it, in the order the units already stand, so a column arrives as a firing line instead of a queue. It is the line you actually drew, curves and all, however far you keep drawing it: a long sweep used to give up partway through and finish as one straight run to the cursor, and now it holds its shape to the end. Letting go over the sidebar finishes the order rather than leaving the line stuck to the cursor. Draw the line with the left button while attack move is armed and the whole line is an attack move: artillery spread across a front, each gun firing on what walks into it, instead of one clump on one spot. The left button, because that is what attack move is aimed with; with F armed a right drag draws nothing. Armed with attack instead, every unit fires on its own station along the line, which is a barrage laid across a ridge in one drag. This is what the right button freed up. `FormationDrag = no` in Options.ini turns it off if you would rather a slipped click did nothing.+- Press V, or the move button, then drag the left button and you draw a line: the selection spreads itself evenly along it, in the order the units already stand, so a column arrives as a firing line instead of a queue. It is the line you actually drew, curves and all, however far you keep drawing it: a long sweep used to give up partway through and finish as one straight run to the cursor, and now it holds its shape to the end. Letting go over the sidebar finishes the order rather than leaving the line stuck to the cursor. Draw the line with the left button while attack move is armed and the whole line is an attack move: artillery spread across a front, each gun firing on what walks into it, instead of one clump on one spot. Guard draws the same way. Every line is drawn with the left button, the one armed orders are aimed with, and the right button never draws one: its drag is the camera. Without an order armed a left drag is the selection box it always was. Armed with attack instead, every unit fires on its own station along the line, which is a barrage laid across a ridge in one drag. `FormationDrag = no` in Options.ini turns the line off if you would rather an armed drag did nothing.- Selected units draw a thread to wherever they are going, with the pointer, tinted, sitting on the spot. Every order draws one: move, attack move, attack, force fire, ground fire, enter, dock, repair, heal, capture, hack, guard, a waypoint path. Green for a move, pink for an attack-move, red for anything that shoots, so a group told three different things reads as three different colours. Units standing together and headed the same way share one thread, from the middle of the knot to the middle of where they are going, so twenty tanks sent across the map draw one line instead of twenty laid on top of each other; a selection spread over the map draws one per knot, and a flank sent on its own still shows. An angry mob draws one thread for the whole mob, not one per rioter. An attack move and a shot at the ground both point at the spot you clicked: the attack move's thread used to wander off to whichever free ground each unit was steering for, and ground fire pointed at the middle of the nearest map cell. An attack move stays pink from start to finish, too. A unit that stopped to fight used to swing its thread onto the enemy it was fighting, and only swung it back to your destination once the enemy was dead. A dot and a ring stood in for the pointer for a while, and players asked for the pointer back. It is not a flash at the moment of the order: the line is asked of the unit every frame, so it lasts until the unit gets there, changes its mind or leaves your selection, and it shows on the formation line while you are still drawing it. A unit that has walked off the edge of the screen still draws its line, which is how you see where the half of your army you cannot see is headed. The animated ring the ground used to sprout wherever you clicked is gone: it flashed for a second and told you nothing the marker sitting on the destination does not, and that marker stays for as long as the order does. A marker that has just appeared slides the last few pixels up out of the bottom right and fades in as it lands, over about an eighth of a second, so a fresh order catches your eye without anything flashing. Aircraft draw their thread from the click, not from the moment they leave the runway. A plane parked on its airfield answers an order by starting its takeoff and puts the order itself aside until the wheels are up, so the taxi and the climb, which is exactly the stretch where you are wondering whether the strike went out at all, used to show nothing.- A unit standing guard draws its marker on the ground it is guarding. A guard order clears the unit's goal on the way in, so every guard marker used to sit in the bottom left corner of the map with a thread running the whole way across it, whatever the unit was actually watching.- A is attack and D is attack move, each arming the next order click. A click on the ground with A held down is a shot at that ground, on your own tank a shot at your own tank, and the mode drops again the moment the order goes out, so nothing stays armed behind your back. The click keeps your group, too: an attack click that was not a drag used to run the same deselect an ordinary left click runs, so the order arrived a moment after the units it was meant for had been dropped. Both orders are aimed with the left button, the way a special power is, and a right click puts the key down again without giving any order. Holding ctrl no longer forces fire: A is the one way to shoot the ground, and ctrl on a move is only the shared pace. The two keys turn each other off, and the letters they took were sitting on grid commands that moved.@@ -624,7 +624,7 @@ A third pass went through the generals' powers, promotions and unit abilities.- Both are an ordinary web page with a stylesheet, in the game's Window folder. Change the colours, the sizes or the order there and the next match you watch draws it that way, and the page opens in a browser too.- A minimised command bar stays minimised. Changing seats, or clicking another player's unit while watching, put the whole bar back up over the battlefield you had just cleared. A new match still opens with the bar up.- The command bar's frame is drawn new, in the same steel as the boards. Each panel holds one thing and is exactly its size, the radar, the command grid, the portrait with the experience bar, and wears a steel border outside it. Grey for America, red for China, sand for GLA. It slides and minimises with the bar, and like the boards it is a page in the Window folder; take the page away and the old painted bar comes back.-- The command bar is laid out anew, all of it running rightwards from the bottom left corner, and it is smaller: at 1920x1080 it stands 248 pixels tall where the old bar took 312, and it ends a third of the way across, so the rest of the screen's bottom edge is battlefield but for the general's powers in the corner. The radar sits in the corner, taller than before so its top lines up with the power bar's, with your general's experience bar standing beside it, and on its top edge the under-attack light, the skills key with your rank's stars on that, and over the stars the idle worker button whenever a worker stands idle. Next to it is one grid of eighteen buttons, six across and three down, and every button is its own key: Q W E R T Y over A S D F G H over Z X C V B N. No more two-key building shortcuts and no second bars: a dozer's buildings, a factory's units, a unit's abilities and upgrades and its orders all share the grid, each a single press. The orders stay put whatever you select. For a unit, A attacks, S stops, D attack-moves, V moves, Z ejects the passengers, X guards and C holds position; for a building, N sells it, B sets its rally point and Z empties its garrison. Workers keep three of their own: N clears mines on every side's worker and dozer, H swaps a GLA worker between real and fake buildings, and B is the Demolition worker's suicide charge. Everything else packs into the top left corner, two rows at a time, Q A W Z S E X D R C and on, so the buildings you reach for most sit under your fingers; what a building makes comes first and its upgrades after. Only the buttons your selection has are drawn, and with nothing selected the grid stays as a plate of bare steel. Its buttons are a fifth bigger than the rest of the bar's, so what you build stands out. Attack, hold position and move are buttons now, where no unit ever had one, with pictures painted to sit among the game's own: a crosshair on a red plate over a burning sky, a raised palm on a blue one, an arrow on a green diamond. V, or a click on the arrow, is a move for the left button: the next click on the ground sends the selection there, and a drag lays them out along the line the way a right drag does. Beside the grid, on the bottom edge of the screen, runs a portrait bar only as long as what it holds. Select one unit and its upgrades follow its portrait; select a group and the bar holds every kind of unit in it once, each with how many you have, the one Tab has picked lit and the rest dimmed. The power bar lies along the top of the grid, and your money sits on its left end, so both are one glance from the buttons you spend them on. The Legacy mouse and keyboard and the W A S D camera are gone from the Options screen: there is one way to play, and an Options.ini that still names them loads as it always did.+- The command bar is laid out anew, all of it running rightwards from the bottom left corner, and it is smaller: at 1920x1080 it stands 248 pixels tall where the old bar took 312, and it ends a third of the way across, so the rest of the screen's bottom edge is battlefield but for the general's powers in the corner. The radar sits in the corner, taller than before so its top lines up with the power bar's, with your general's experience bar standing beside it, and on its top edge the under-attack light, the skills key with your rank's stars on that, and over the stars the idle worker button whenever a worker stands idle. Next to it is one grid of eighteen buttons, six across and three down, and every button is its own key: Q W E R T Y over A S D F G H over Z X C V B N. No more two-key building shortcuts and no second bars: a dozer's buildings, a factory's units, a unit's abilities and upgrades and its orders all share the grid, each a single press. The orders stay put whatever you select. For a unit, A attacks, S stops, D attack-moves, V moves, Z ejects the passengers, X guards and C holds position; for a building, N sells it, B sets its rally point and Z empties its garrison. Workers keep three of their own: N clears mines on every side's worker and dozer, H swaps a GLA worker between real and fake buildings, and B is the Demolition worker's suicide charge. Everything else packs into the top left corner, two rows at a time, Q A W Z S E X D R C and on, so the buildings you reach for most sit under your fingers; what a building makes comes first and its upgrades after. Only the buttons your selection has are drawn, and with nothing selected the grid stays as a plate of bare steel. Its buttons are a fifth bigger than the rest of the bar's, so what you build stands out. Attack, hold position and move are buttons now, where no unit ever had one, with pictures painted to sit among the game's own: a crosshair on a red plate over a burning sky, a raised palm on a blue one, an arrow on a green diamond. V, or a click on the arrow, is a move for the left button: the next click on the ground sends the selection there, and a left drag lays them out along the line you draw. Beside the grid, on the bottom edge of the screen, runs a portrait bar only as long as what it holds. Select one unit and its upgrades follow its portrait; select a group and the bar holds every kind of unit in it once, each with how many you have, the one Tab has picked lit and the rest dimmed. The power bar lies along the top of the grid, and your money sits on its left end, so both are one glance from the buttons you spend them on. The Legacy mouse and keyboard and the W A S D camera are gone from the Options screen: there is one way to play, and an Options.ini that still names them loads as it always did.- Every panel of the bar is only as big as what it holds now, and stands on the bottom of the screen. The radar's border runs out to the screen's left edge. The power bar lies in a steel groove of its own along the top of the command grid, twenty cells that light up from the left with your production and fill the groove when full, the consumption marked by a white needle across it. The money stands on the power bar's left end in a steel plate of its own, the figure in a dark well. Everything the old painting filled round them is battlefield again, and a click there lands on the battlefield.- The bar's own buttons are drawn to match, steel caps lit gold under the pointer and pressed in when pushed. The menu is a small square with three bars in the screen's top left corner. The idle worker button is a key like the smoke signals', a hard hat on it, in a steel tab over your rank's stars, where it no longer hides the end of the power bar. Each button stands in its own dark cell with steel running between them, and the steel is laid over the edge of every picture the way a frame holds a card, the whole picture showing inside it. The production queue and the general's powers are framed the same way. The power bar is sunk into the same steel as the build grid, lying along its top, and is as long as the grid on every side, where it used to change length from one faction to the next. The build grid's panel no longer carries an empty strip down its left side. There is no chat button any more: Enter opens the chat as it always did. The beacon button is gone from the bar too; the smoke signals over the radar are how you point your team at a spot. The portrait sits in the radar's lit steel too. The experience bar beside it is ten gold rungs in a sunk groove, climbing from the bottom as you earn your way to the next rank, and your rank stands in a steel tab on the portrait's top right corner, a key sunk in it like the idle worker's with one star for every rank there is, gold up to the one you hold. A watcher has nothing to promote and no longer gets the tab, which used to hang half into the screen's corner. Its button goes with it: a watcher who clicked a unit used to find an empty patch of screen there that still showed the promotions tooltip and opened the promotion screen. The portrait's grid is steel between dark cells on every side, where America's was drawn in blue lines that matched nothing else on the bar. That key is the promotions button: point at it and it comes up with a gold rim, it blinks bright in your side's own steel while you have a promotion to spend, and a click opens the promotion screen. That screen is rebuilt in the same steel and half its old size: each rank's promotions stand in a grid of build-button cells five wide, like the command grid, an empty place a dark hole, each rank in a steel well of its own with its heading, the wells a plate's thickness apart, the grid's steel laid over the edge of every picture so the picture sits in its cell like a card in a frame, your rank and the points to spend on one line over the experience bar, and Done in the last row's spare place. A gold rim marks what you have bought and a light one what you can buy now. It comes up the way the Esc menu does, the battlefield behind it dimmed to 65% black and the screen fading in over an eighth of a second; the side's old painted screen no longer fades in over it for the first nine frames. The bar has no minimise arrow any more: it is only as big as what it holds. The radar sits sunk in a bezel of lit steel, bright along the top and shadowed down the right, and the build grid and the money wear the same steel, the figure in a dark window of its own, and the under-attack light is a long red lamp set in a steel tab on its top left corner, dark until you are hit and then blinking. No words on it, so it reads the same in any language.- The general's powers you have bought and can fire, the column that climbed the right edge of the screen, stand in the bottom right corner now in a tray of the bar's own steel. The first sits in the corner against the right edge of the screen, and each one you gain takes the place to the left of the last, three to a row before a new row starts above, so the tray is only ever as big as what you hold and an empty one takes no room at all. Each power sits on a dark cell three quarters the size of a build button, where the side's old tray art used to frame it. It is always out; there is no button to fold it away.@@ -654,7 +654,7 @@ A third pass went through the generals' powers, promotions and unit abilities.- Selecting a GLA supply stash no longer puts reach circles round every defence on the map. The stash spawns workers, a worker carries a weapon for clearing mines, and that was enough to count the stash as armed.- Two buildings can no longer be put down on the same spot online. A build order travels to the other players before anything appears on the ground, and every click made while it was in flight was answered by a map that still showed the square as empty - so a shift-held row on a bad connection came out as buildings standing inside each other. The ghost now knows about the orders you have already spent, and turns red over them or slides to the square beside; and the order itself is checked again where it lands, on every machine, after the first building is standing. A second one aimed at the same ground is refused there and costs you nothing. What the ghost remembered of each order was the square around the building rather than the building, and a building standing at an angle, which is how most of them come out, fills barely half its square: a shift-clicked row of them found its neighbour in the way, slid off, and left a gap. It remembers the building's own outline now, and five Power Plants clicked side by side stand wall to wall.- A building you put down next to another snaps against it. Click a little short of the neighbour, or a little into it, and the ghost slides along the way you stepped until the two touch, lined up with it. Clicking out a row by eye used to leave a strip of dirt at every other joint, or zigzag when the buildings stood at an angle to the row: the grid only has room for a building every 10, a diagonal building touches its neighbour somewhere in between, and a ghost pushed back out of a neighbour was thrown a whole square too far. Leave more than a square and a half between them and the gap stays where you put it.-- The right button drops the building on your cursor whether the click travelled or not. Sending a dozer off somewhere in the middle of a shift-held row moved it and left the ghost riding the cursor, because the cancel only counted a press that had not moved a pixel and a hand on the way to a destination always moves a few.+- A right click drops the building on your cursor even when the click wobbled on the way. Pull far enough to scroll the map and the building stays, so you can go and find the spot first. Sending a dozer off somewhere in the middle of a shift-held row moved it and left the ghost riding the cursor, because the cancel only counted a press that had not moved a pixel and a hand on the way to a destination always moves a few.- The command bar is driven by its own grid of keys - the buttons in the shape they are in, under your left hand - and there is no longer a switch for it. It shipped off by default, which meant nobody ever saw it.- Escape cancels what you were doing before it opens the menu.diff --git a/GeneralsMD/Code/GameEngine/Include/Common/DrawnPath.h b/GeneralsMD/Code/GameEngine/Include/Common/DrawnPath.hindex 47674f1c1..043eb2e79 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/DrawnPath.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/DrawnPath.h@@ -18,7 +18,7 @@// FILE: DrawnPath.h //////////////////////////////////////////////////////////////////////////////-// The curve the player traces with the right button, and the arithmetic that turns it into+// The curve the player traces with the left button after arming a move, and the arithmetic that turns it into// standing room. Both sides of the engine need the same answers: the logic to decide who goes// where, the client to draw it while the line is still being dragged. Written once here so the// two pictures cannot drift apart.diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.hindex 0e5bea2c3..66c5c5090 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h@@ -390,7 +390,7 @@ public:Bool m_buildPlacementShadows; ///< whether that structure casts a shadow while it rides the cursorBool m_zoomToCursor; ///< the mouse wheel zooms toward whatever the cursor is overBool m_isometricCamera; ///< the tactical view from far off down a narrow cone, near enough orthographic- Bool m_formationDrag; ///< dragging the right button spreads the selection along the line drawn+ Bool m_formationDrag; ///< with the move, attack move or guard key armed, a left drag spreads the selection along the line drawnBool m_showAllyCursors; ///< in a network game, draw where each ally's mouse is pointingBool m_chromaLighting; ///< put the state of the match on Razer hardwareInt m_menuTransitionSpeed; ///< percent of the authored speed the menus slide and fade at; 100 = as drawndiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.hindex d4e20b6ef..ce872ee03 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h@@ -141,7 +141,7 @@ extern void pickAndPlayUnitVoiceResponse( const DrawableList *list, GameMessage:///< does the stop key cancel a building that is going up, rather than stopping a unit?extern Bool Command_stopMeansCancelConstruction( Int selectionCount, Bool locallyControlled, Bool underConstruction );-/** Does this right-button press start a formation line? setting is TheGlobalData->m_formationDrag. */+/** Does this left-button press, made with a line order armed, start a formation line? setting is TheGlobalData->m_formationDrag. */extern Bool Command_formationDragArmed( Bool setting, Bool haveMovableSelection,Bool guiCommandPending );diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.hindex 1fdf434bf..123036565 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h@@ -1122,7 +1122,7 @@ public: // ********************************************************************Bool isGuardArmed( void ) const { return m_guardArmed; }// the move key arms the order a right click gives, for the left button: the next order click is- // that move, and a left drag the formation line a right drag draws+ // that move, and a left drag draws the formation linevoid toggleMoveArmed( void ) { m_moveArmed = !m_moveArmed; m_attackMoveToMode = FALSE; m_forceAttackArmed = FALSE; m_guardArmed = FALSE; }Bool isMoveArmed( void ) const { return m_moveArmed; }Bool isLineOrderArmed( void ) const { return m_attackMoveToMode || m_guardArmed || m_moveArmed; } ///< a left drag draws a move, attack move or guard line; force fire's left drag is the attack circle@@ -1158,8 +1158,7 @@ public: // ********************************************************************void setDrawRMBScrollAnchor(Bool b) { m_drawRMBScrollAnchor = b; }void setMoveRMBScrollAnchor(Bool b) { m_moveRMBScrollAnchor = b; }- // The camera scroll moved from the right button to the middle one; the two INI fields keep their- // shipped names because InGameUI.ini sets them and an unknown field is a parse error.+ // The right-drag camera scroll these two fields were named for is back on the right button.Bool shouldMoveScrollAnchor( void ) const { return m_moveRMBScrollAnchor; }private:diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.hindex 2d5a8b58f..8ba7cd247 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h@@ -39,8 +39,10 @@ public:LookAtTranslator();~LookAtTranslator();virtual GameMessageDisposition translateGameMessage(const GameMessage *msg);- /// where the middle-button scroll was started from, or NULL if no such scroll is running+ /// where the right-button pan was started from, or NULL if no such pan is runningconst ICoord2D* getScrollAnchor( void );+ /// a right drag is panning the camera, so the release that ends it is not a click+ Bool isRightDragPanning( void ) const { return m_isScrolling && m_scrollType == SCROLL_RMB; }Bool hasMouseMovedRecently( void );/// scrolling, turning or tilting the camera by hand, with the mouse or the keys, right nowBool isMovingCamera( void ) const { return m_isScrolling || m_isRotating || m_isPitching; }@@ -53,17 +55,18 @@ private:{MAX_VIEW_LOCS = 8};- // the middle button drags the camera; the right one gives orders+ // a right click gives an order and a right drag pans; the middle button turns the cameraenum{SCROLL_NONE = 0,SCROLL_KEY,SCROLL_SCREENEDGE,- SCROLL_MMB // middle-button drag pan+ SCROLL_RMB // right-button drag pan};ICoord2D m_anchor;ICoord2D m_originalAnchor;- ICoord2D m_currentPos;+ ICoord2D m_currentPos;+ Bool m_rightPanArmed; // the right button is down and has not yet moved far enough to be a panBool m_isScrolling; // set to true if we are in the act of RMB scrollingBool m_isRotating; // set to true if we are in the act of MMB rotatingReal m_freeRotateAngle; // heading the drag has asked for, before SnapCameraRotateTo45 quantizes itdiff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cppindex c3e160b66..32bcd40d8 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp@@ -1130,7 +1130,7 @@ GlobalData::GlobalData()m_snapCameraRotateTo45 = TRUE;m_zoomToCursor = TRUE;m_isometricCamera = FALSE;- // the right button no longer scrolls, so a right-drag is free to mean something+ // a left drag with the move, attack move or guard key armed draws a formation linem_formationDrag = TRUE;m_showAllyCursors = TRUE;m_chromaLighting = TRUE; //costs nothing on a machine with no Razer server: the handshake fails oncediff --git a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cppindex c577b47a3..28958328f 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp@@ -218,8 +218,8 @@ const OptionDef TheOptionCatalog[] =OPTION_BOOL, APPLY_LIVE, 0, 1,get_m_snapCameraRotateTo45, set_m_snapCameraRotateTo45 },- // MiddleMousePans used to sit here. The middle button is the only camera drag there is now, so- // there is nothing left to choose: it pans, and Ctrl turns the same drag into a rotate.+ // MiddleMousePans used to sit here. There is nothing left to choose: a right drag pans and a+ // middle drag turns the camera.// Back on Options > Controls: players split on whether the wheel should chase the cursor.{ "ZoomToCursor", OPT_WND( "CheckZoomToCursor" ), "GUI:ZoomToCursor",@@ -232,9 +232,9 @@ const OptionDef TheOptionCatalog[] =OPTION_BOOL, APPLY_LIVE, 0, 1,get_m_isometricCamera, set_m_isometricCamera },- // A right drag over the ground spreads the selection along the line drawn instead of sending- // everyone to one point. On by default - the right button stopped scrolling, so the drag was- // free - and here for anyone who would rather a slipped click did nothing at all.+ // With the move, attack move or guard key armed, a left drag over the ground spreads the+ // selection along the line drawn instead of sending everyone to one point. On by default, and+ // here for anyone who would rather that drag did nothing at all.{ "FormationDrag", "", "",OPTION_BOOL, APPLY_LIVE, 0, 1,get_m_formationDrag, set_m_formationDrag },diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex d152b64bd..0f5881db1 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -7875,7 +7875,7 @@ void InGameUI::postDraw( void )}}- // draw the scroll anchor, which sits on the middle button now+ // draw the anchor of a right-drag panif (TheLookAtTranslator && m_drawRMBScrollAnchor){const ICoord2D* anchor = TheLookAtTranslator->getScrollAnchor();diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cppindex cb12ca6c8..3e5d30279 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp@@ -131,7 +131,8 @@ Bool Command_stopMeansCancelConstruction( Int selectionCount, Bool locallyContro//-------------------------------------------------------------------------------------------------/**- * Is this right-button press the start of a formation line?+ * Is this left-button press, made with the move, attack move or guard key armed, the start of a+ * formation line?* A GUI command waiting for a target owns the next click, and with nothing of your own selected* there is nobody to spread, so both of those leave the drag meaning nothing.*/@@ -4042,16 +4043,14 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessagem_mouseRightDragAnchor = msg->getArgument( 0 )->pixel;m_mouseRightDown = (UnsignedInt) msg->getArgument( 2 )->integer;- // attack move and guard draw their line with the left button only- m_formationDragAnchor = m_mouseRightDragAnchor;- m_formationDragArmed = isFormationDragArmed() && !TheInGameUI->isLineOrderArmed();-+ // a right drag pans the camera (LookAtXlat) and never draws a formation linebreak;}//------------------------------------------------------------------------------ // Attack move and guard are aimed with the left button, so with either armed a left drag draws- // the same line a right drag does. The attack key keeps its left drag for the attack circle.+ // A formation line is drawn with the left button, and only once the move, attack move or guard+ // key is armed: a left drag without one is a selection box. The attack key keeps its left+ // drag for the attack circle.case GameMessage::MSG_RAW_MOUSE_LEFT_DOUBLE_CLICK:case GameMessage::MSG_RAW_MOUSE_LEFT_BUTTON_DOWN:{@@ -4102,11 +4101,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessagem_mouseRightDragLift = msg->getArgument( 0 )->pixel;m_mouseRightUp = (UnsignedInt) msg->getArgument( 2 )->integer;- if( m_formationDragArmed )- finishFormationDrag( m_mouseRightDragLift );-// a structure waiting to be placed is dropped by the same release, over in- // SelectionXlat, which sees it whether this was a click or a drag+ // SelectionXlat, unless the release ended a panbreak;}@@ -4133,22 +4129,24 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage}case GameMessage::MSG_MOUSE_RIGHT_CLICK:{- // The right button is the order button, always. It used to depend on UseAlternateMouse,- // which is gone: a click here commands, a drag draws a formation line, and neither of- // them scrolls.- //- // The one exception is the attack, attack move or guard key. Those orders are aimed with the- // left button, so a right click while one is armed puts the key down and gives no order.+ // A right click is an order. A right drag pans the camera (LookAtXlat), so a release that+ // travelled past the drag tolerance, or was held too long, gives no order at all.+ const Bool isRightClick = TheMouse->isClick(&m_mouseRightDragAnchor, &m_mouseRightDragLift,+ NULL, NULL,+ m_mouseRightDown, m_mouseRightUp);++ // The one exception is the move, attack, attack move or guard key. Those orders are aimed+ // with the left button, so a right click while one is armed puts the key down and gives no+ // order. A pan leaves the key armed.if( TheInGameUI->isOrderKeyArmed() ){- TheInGameUI->clearAttackMoveToMode();+ if( isRightClick )+ TheInGameUI->clearAttackMoveToMode();disp = DESTROY_MESSAGE;break;}- if (TheMouse->isClick(&m_mouseRightDragAnchor, &m_mouseRightDragLift,- NULL, NULL,- m_mouseRightDown, m_mouseRightUp))+ if (isRightClick){Bool isPoint = (msg->getArgument(0)->pixelRegion.height() == 0 && msg->getArgument(0)->pixelRegion.width() == 0);diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cppindex b502b266b..a237e4e29 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp@@ -70,6 +70,14 @@ Int SCROLL_AMT = 100;static const Int edgeScrollSize = 3;+static Bool isAtScreenEdge( const ICoord2D& pos )+{+ const Int width = (Int)TheDisplay->getWidth();+ const Int height = (Int)TheDisplay->getHeight();+ return pos.x < edgeScrollSize || pos.y < edgeScrollSize+ || pos.x >= width - edgeScrollSize || pos.y >= height - edgeScrollSize;+}+static Mouse::MouseCursor prevCursor = Mouse::ARROW;//-----------------------------------------------------------------------------@@ -107,6 +115,7 @@ void LookAtTranslator::stopScrolling( void )//-----------------------------------------------------------------------------LookAtTranslator::LookAtTranslator() :+ m_rightPanArmed(false),m_isScrolling(false),m_isRotating(false),m_freeRotateAngle(0.0f),@@ -138,7 +147,7 @@ LookAtTranslator::~LookAtTranslator()const ICoord2D* LookAtTranslator::getScrollAnchor(void){- if (m_isScrolling && m_scrollType == SCROLL_MMB)+ if (isRightDragPanning()){return &m_anchor;}@@ -249,13 +258,25 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage}//------------------------------------------------------------------------------ // The right button belongs to the order layer - a click commands, a drag draws a formation- // line - so here it only keeps the idle timer honest: a player who is right-clicking is not- // away from the keyboard.+ // A right click is an order and a right drag pans. The press only arms the pan: it starts+ // once the cursor has left the mouse's drag tolerance, so a click that wobbles a pixel or two+ // still reaches CommandXlat as an order and never nudges the camera. The anchor stays where+ // the button went down and the camera runs away from it, faster the further the cursor gets.case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:+ case GameMessage::MSG_RAW_MOUSE_RIGHT_DOUBLE_CLICK:+ {+ m_lastMouseMoveFrame = TheGameLogic->getFrame();+ m_anchor = msg->getArgument( 0 )->pixel;+ m_rightPanArmed = true;+ break;+ }+case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP:{m_lastMouseMoveFrame = TheGameLogic->getFrame();+ m_rightPanArmed = false;+ if (isRightDragPanning())+ stopScrolling();break;}@@ -269,24 +290,13 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessagem_currentPos = msg->getArgument( 0 )->pixel;m_timestamp = TheGameClient->getFrame();- // The middle button is the camera: drag it and the map follows the cursor, hold ctrl and- // the drag turns the camera instead. It used to be the other way round, with a- // MiddleMousePans switch in Options.ini deciding; there is no switch now because the- // right button no longer scrolls anything and the pan has to live somewhere. The- // click-to-reset below works either way.- if( !TheKeyboard->isCtrl() )- {- m_isRotating = false;- if (!TheInGameUI->isSelecting() && !m_isScrolling)- setScrolling(SCROLL_MMB);- }- else- {- m_isRotating = true;- // the drag turns this, and under SnapCameraRotateTo45 the camera stands on whichever- // eighth it is nearest - so start it where the camera already is.- m_freeRotateAngle = TheTacticalView->getAngle();- }+ // The middle button turns the camera: drag it sideways and the heading follows. The pan+ // is on the right button, so no modifier is needed. A click without a drag puts the+ // camera back, below.+ m_isRotating = true;+ // the drag turns this, and under SnapCameraRotateTo45 the camera stands on whichever+ // eighth it is nearest - so start it where the camera already is.+ m_freeRotateAngle = TheTacticalView->getAngle();break;}@@ -299,8 +309,6 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessageconst UnsignedInt PIXEL_OFFSET = 5;m_isRotating = false;- if (m_scrollType == SCROLL_MMB)- stopScrolling();Int dx = m_currentPos.x-m_originalAnchor.x;if (dx<0) dx = -dx;Int dy = m_currentPos.y-m_originalAnchor.y;@@ -324,17 +332,25 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessagem_lastMouseMoveFrame = TheGameLogic->getFrame();m_currentPos = msg->getArgument( 0 )->pixel;-- UnsignedInt height = TheDisplay->getHeight();- UnsignedInt width = TheDisplay->getWidth();if (TheInGameUI->getInputEnabled() == FALSE) {// We don't care how we're scrolling, just stop.if (m_isScrolling)stopScrolling();+ m_rightPanArmed = false;break;}+ // a right press that has travelled past the drag tolerance is a pan, not an order+ if (m_rightPanArmed+ && ((UnsignedInt)abs(m_currentPos.x - m_anchor.x) > TheMouse->m_dragTolerance+ || (UnsignedInt)abs(m_currentPos.y - m_anchor.y) > TheMouse->m_dragTolerance))+ {+ m_rightPanArmed = false;+ if (!TheInGameUI->isSelecting() && !m_isScrolling)+ setScrolling(SCROLL_RMB);+ }+// retail disables edge scrolling entirely in a window; EdgeScrollInWindowedMode in// Options.ini turns it back on for people who play windowed or borderless. Either way// the pointer has to be over the window: the position below is the last one the mouse@@ -347,19 +363,14 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessageif (m_isScrolling){- if ( m_scrollType == SCROLL_SCREENEDGE- && (!edgeScrollAllowed- || (m_currentPos.x >= edgeScrollSize && m_currentPos.y >= edgeScrollSize && m_currentPos.y < height-edgeScrollSize && m_currentPos.x < width-edgeScrollSize)) )+ if ( m_scrollType == SCROLL_SCREENEDGE && (!edgeScrollAllowed || !isAtScreenEdge(m_currentPos)) ){stopScrolling();}}- else if (edgeScrollAllowed)+ else if (edgeScrollAllowed && isAtScreenEdge(m_currentPos)){- if ( m_currentPos.x < edgeScrollSize || m_currentPos.y < edgeScrollSize || m_currentPos.y >= height-edgeScrollSize || m_currentPos.x >= width-edgeScrollSize )- {- setScrolling(SCROLL_SCREENEDGE);- }+ setScrolling(SCROLL_SCREENEDGE);}// rotate the view@@ -473,11 +484,11 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage{switch (m_scrollType){- case SCROLL_MMB:+ case SCROLL_RMB:{// The anchor stays where the button went down and the camera runs away from it,- // faster the further the cursor gets. This is what the right button used to do,- // and it is what the hand expects; a one-to-one drag of the world is not the same+ // faster the further the cursor gets. This is the retail right-drag scroll, and it+ // is what the hand expects; a one-to-one drag of the world is not the same// gesture and reads as sluggish at these scroll factors.if (TheInGameUI->shouldMoveScrollAnchor()){diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cppindex d633cee05..019fbd225 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp@@ -52,6 +52,7 @@#include "GameClient/GameText.h"#include "GameClient/GameWindowManager.h"#include "GameClient/Keyboard.h"+#include "GameClient/LookAtXlat.h"#include "GameClient/SelectionInfo.h"#include "GameClient/SelectionPriority.h"#include "GameClient/SelectionXlat.h"@@ -1161,6 +1162,11 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa//-----------------------------------------------------------------------------case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP:{+ // a right drag panned the camera, and a pan takes nothing back: a player can look around+ // with a structure on the cursor or a GUI command waiting and still have it on release+ if( TheLookAtTranslator->isRightDragPanning() )+ break;+// a signal armed off the command bar is all the right button takes backif( TheInGameUI->isSignalArmed() ){@@ -1169,15 +1175,15 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa}//- // The right button drops whatever is armed, and it does so on a drag as well as on a- // click. A dozer placing a row of structures with shift held is the case that made this- // matter: the player right-clicks to send it somewhere, the cursor travels a few pixels- // while the button is down, the order goes out as a formation move - and the ghost used- // to stay riding the cursor because the cancel only ran on a strict click.+ // The right button drops whatever is armed, and it does so on a release that wobbled as+ // well as on a strict click. A dozer placing a row of structures with shift held is the+ // case that made this matter: the player right-clicks to send it somewhere, the cursor+ // travels a few pixels while the button is down, and the ghost used to stay riding the+ // cursor because the cancel only ran on a strict click.//// Nothing here eats the message. The order itself arrives as the separate- // MSG_MOUSE_RIGHT_CLICK the meta translator inserts, and CommandXlat still needs this- // release to close off a formation drag it started.+ // MSG_MOUSE_RIGHT_CLICK the meta translator inserts, and LookAtXlat still needs this+ // release to end a pan.//if( TheInGameUI->getGUICommand() ){diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cppindex a5b59684f..8213516cd 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp@@ -53,6 +53,7 @@#include "Common/Radar.h"#include "GameClient/GameWindowManager.h"#include "GameClient/WindowXlat.h"+#include "GameClient/LookAtXlat.h"#include "GameClient/Shell.h"#include "GameClient/Display.h"@@ -269,6 +270,14 @@ GameMessageDisposition WindowTranslator::translateGameMessage(const GameMessage{forceKeepMessage = TRUE;}+ // A middle drag turning the camera owns the mouse the same way, or a release over the+ // command bar leaves the camera turning with every move until the next middle click.+ if( TheLookAtTranslator && TheLookAtTranslator->isMovingCamera()+ && ( msg->getType() == GameMessage::MSG_RAW_MOUSE_POSITION+ || msg->getType() == GameMessage::MSG_RAW_MOUSE_MIDDLE_BUTTON_UP ) )+ {+ forceKeepMessage = TRUE;+ }#if defined(_DEBUG) || defined(_INTERNAL) //debug hack to view object under mouse statsTheMousePos.x = mousePos.x;TheMousePos.y = mousePos.y;diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.hindex 409203e8a..20e7977db 100644--- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h+++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h@@ -79,7 +79,7 @@ protected:virtual void drawPlaceAngle( View *view ); ///< draw place building angle if neededvirtual void drawBuildGrid( void ); ///< the pathfinder's build grid under a pending structurevirtual void drawAttackCircleFill( void ); ///< the wash on the ground inside an attack circle- virtual void drawFormationLine( void ); ///< the line a right drag is spreading the selection along+ virtual void drawFormationLine( void ); ///< the line an armed left drag is spreading the selection alongvirtual void drawOrderHints( void ); ///< a line from each selected unit to where its order sends itvirtual void drawAttackCircle( void ); ///< the circle a left drag is sweeping targets out ofvirtual void drawAllyCursorLights( void ); ///< the patch of an ally's colour lying under their cursordiff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cppindex a3b481370..75d234a9a 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp@@ -871,7 +871,7 @@ void W3DInGameUI::drawSelectionRegion( void )} // end drawSelectionRegion//--------------------------------------------------------------------------------------------------/** draw the line a right drag is spreading the selection along. Where each unit will stand is+/** draw the line an armed left drag is spreading the selection along. Where each unit will stand is* said by the cursor sitting there, not by a mark on the line *///-------------------------------------------------------------------------------------------------void W3DInGameUI::drawFormationLine( void )diff --git a/GeneralsMD/Code/Tests/test_camera_behavior.inc b/GeneralsMD/Code/Tests/test_camera_behavior.incindex 0339abe85..f75d80de0 100644--- a/GeneralsMD/Code/Tests/test_camera_behavior.inc+++ b/GeneralsMD/Code/Tests/test_camera_behavior.inc@@ -248,3 +248,54 @@ TEST(arrow_keys_scroll_the_camera_and_w_a_s_d_stay_grid_keys)press(KEY_RIGHT, FALSE);CHECK(!f.ui->scrolling);}++TEST(right_drag_pans_past_the_drag_tolerance_and_middle_drag_turns)+{+ CHECK(bootOnce());+ CameraInputFixture f;+ GameClient *savedClient = TheGameClient;+ TheGameClient = getTestGameClient();+ // no edge scrolling, so the pointer positions below mean only what the buttons make of them+ f.global->m_windowed = TRUE;+ f.global->m_edgeScrollInWindowedMode = FALSE;+ f.global->m_snapCameraRotateTo45 = FALSE;+ f.mouse.m_dragTolerance = 4;+ const auto mouse = [&f](GameMessage::Type type, Int x, Int y)+ {+ GameMessage *message = newInstance(GameMessage)(type);+ const ICoord2D pixel = {x, y};+ message->appendPixelArgument(pixel);+ f.camera.translateGameMessage(message);+ message->deleteInstance();+ };++ // a right click that wobbles inside the tolerance stays an order and moves nothing+ mouse(GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN, 300, 300);+ mouse(GameMessage::MSG_RAW_MOUSE_POSITION, 303, 302);+ CHECK(!f.ui->scrolling);+ CHECK(!f.camera.isRightDragPanning());+ mouse(GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP, 303, 302);+ CHECK(!f.ui->scrolling);++ // past the tolerance the same button pans, anchored where it went down, until it comes up+ mouse(GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN, 300, 300);+ mouse(GameMessage::MSG_RAW_MOUSE_POSITION, 340, 300);+ CHECK(f.ui->scrolling);+ CHECK(f.camera.isRightDragPanning());+ CHECK(f.camera.getScrollAnchor() != NULL && f.camera.getScrollAnchor()->x == 300);+ mouse(GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP, 340, 300);+ CHECK(!f.ui->scrolling);+ CHECK(!f.camera.isRightDragPanning());++ // a middle drag turns the camera and pans nothing, with no modifier held+ const Real before = f.view.getAngle();+ mouse(GameMessage::MSG_RAW_MOUSE_MIDDLE_BUTTON_DOWN, 300, 300);+ mouse(GameMessage::MSG_RAW_MOUSE_POSITION, 350, 300);+ CHECK(!f.ui->scrolling);+ CHECK(f.camera.isMovingCamera());+ CHECK(f.view.getAngle() != before);+ mouse(GameMessage::MSG_RAW_MOUSE_MIDDLE_BUTTON_UP, 350, 300);+ CHECK(!f.camera.isMovingCamera());++ TheGameClient = savedClient;+}diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex 2cf4312c6..bb316cc6a 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -1101,14 +1101,15 @@ TEST(income_sharing_splits_evenly_and_keeps_the_remainder)CHECK_EQ( IncomeAllyShare( 200, 1 ), 0u );}-/* CommandXlat.cpp: a right drag spreads the selection along the line drawn, but only when there is- a selection to spread and no GUI command already waiting for the click. */+/* CommandXlat.cpp: with the move, attack move or guard key armed, a left drag spreads the selection+ along the line drawn, but only when there is a selection to spread and no GUI command already+ waiting for the click. The right button never draws it; a right drag pans. */extern Bool Command_formationDragArmed( Bool setting, Bool haveMovableSelection,Bool guiCommandPending );-TEST(formation_drag_takes_the_right_button_only_when_it_is_asked_for)+TEST(formation_drag_takes_the_armed_left_button_only_when_it_is_asked_for){- /* on by default: a right drag with your own units selected draws the line. */+ /* on by default: an armed left drag with your own units selected draws the line. */CHECK( Command_formationDragArmed( true, true, false ) );/* off is off. */@@ -12940,8 +12941,8 @@ TEST(build_placement_preview_defaults_are_the_ones_the_game_always_used)// and the income trickle is off unless somebody asks for itCHECK_EQ( scratch->m_moneyPerMinute, 0 );- // the right button stopped scrolling when the mouse went onto one scheme, which is what freed- // a right drag to draw a formation line; that is on unless somebody turns it off+ // a left drag with the move, attack move or guard key armed draws a formation line; that is on+ // unless somebody turns it offCHECK( scratch->m_formationDrag );delete scratch;