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): put the mouse on one scheme, BAR style
Olcay Seygana3c59655d9b2
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b1dd1b0b7..bfd1e9a25 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -115,7 +115,8 @@ found and fixed — EA's own, not port damage.**- A reservation lapses within half a second if the shot never arrives.- 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.-- Hold Ctrl and 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. Ticks on the line show where each unit lands before you let go. The camera still scrolls on a plain right drag; if you never scroll that way, `FormationDrag = 2` in Options.ini puts the line on the bare right button, and `0` turns it off.+- 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: drag it and the ground follows the cursor, 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.+- 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. Ticks on the line show where each unit lands before you let go. 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.- Ctrl+D takes every unit of the kinds you have selected that is on the screen, and pressed twice inside half a second takes them across the whole map. One tank selected and two keystrokes is your whole armour, wherever it is standing. It was on Shift+Ctrl+E, which is three fingers for something you do in every fight, and it only ever reached across the map when the screen had nothing left to give - so the wide selection happened to you instead of being asked for.## Aircraft, guards, and orders that used to be ignoreddiff --git a/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd b/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wndindex d5d9ae5b2..02b22f4ce 100644--- a/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd+++ b/GeneralsMD/Code/Data/Window/Menus/OptionsMenu.wnd@@ -3555,7 +3555,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = USER;- SCREENRECT = UPPERLEFT: 151 100, BOTTOMRIGHT: 635 212, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 151 100, BOTTOMRIGHT: 635 188, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:ScrollParent";STATUS = ENABLED;STYLE = USER;@@ -3597,56 +3597,9 @@ WINDOWIMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;CHILD- WINDOW- WINDOWTYPE = CHECKBOX;- SCREENRECT = UPPERLEFT: 160 104, BOTTOMRIGHT: 352 128, CREATIONRESOLUTION: 800 600;- NAME = "OptionsMenu.wnd:CheckAlternateMouse";- STATUS = ENABLED+IMAGE+BORDER;- STYLE = CHECKBOX+MOUSETRACK;- SYSTEMCALLBACK = "[None]";- INPUTCALLBACK = "[None]";- TOOLTIPCALLBACK = "[None]";- DRAWCALLBACK = "[None]";- FONT = NAME: "Arial", SIZE: 14, BOLD: 0;- HEADERTEMPLATE = "MinorTitle";- TOOLTIPTEXT = "TOOLTIP:AlternateMouse";- TOOLTIPDELAY = -1;- TEXT = "GUI:AlternateMouse";- TEXTCOLOR = ENABLED: 255 255 255 255, ENABLEDBORDER: 0 0 0 255,- DISABLED: 192 192 192 255, DISABLEDBORDER: 64 64 64 255,- HILITE: 186 255 12 255, HILITEBORDER: 0 0 0 255;- ENABLEDDRAWDATA = IMAGE: NoImage, COLOR: 255 0 0 255, BORDERCOLOR: 255 128 128 255,- IMAGE: Active-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,- IMAGE: Active-Checked, COLOR: 0 0 255 255, BORDERCOLOR: 128 128 255 255,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;- DISABLEDDRAWDATA = IMAGE: NoImage, COLOR: 128 128 128 255, BORDERCOLOR: 192 192 192 255,- IMAGE: Disabled-Unchecked, COLOR: 255 255 255 0, BORDERCOLOR: 192 192 192 255,- IMAGE: Disabled-Checked, COLOR: 64 64 64 255, BORDERCOLOR: 254 254 254 255,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;- HILITEDRAWDATA = IMAGE: NoImage, COLOR: 0 255 0 255, BORDERCOLOR: 128 255 128 255,- IMAGE: Active-HiLighted, COLOR: 255 255 255 0, BORDERCOLOR: 128 128 255 255,- IMAGE: Active-Checked, COLOR: 255 255 0 255, BORDERCOLOR: 254 254 254 255,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0,- IMAGE: NoImage, COLOR: 255 255 255 0, BORDERCOLOR: 255 255 255 0;- END- CHILDWINDOWWINDOWTYPE = STATICTEXT;- SCREENRECT = UPPERLEFT: 160 160, BOTTOMRIGHT: 624 184, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 160 136, BOTTOMRIGHT: 624 160, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:ScrollSpeedLabel";STATUS = ENABLED;STYLE = STATICTEXT+MOUSETRACK;@@ -3693,7 +3646,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = HORZSLIDER;- SCREENRECT = UPPERLEFT: 167 184, BOTTOMRIGHT: 611 208, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 167 160, BOTTOMRIGHT: 611 184, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:SliderScrollSpeed";STATUS = ENABLED+IMAGE+TABSTOP;STYLE = HORZSLIDER+MOUSETRACK;@@ -3815,7 +3768,7 @@ WINDOWCHILDWINDOWWINDOWTYPE = CHECKBOX;- SCREENRECT = UPPERLEFT: 160 128, BOTTOMRIGHT: 352 152, CREATIONRESOLUTION: 800 600;+ SCREENRECT = UPPERLEFT: 160 104, BOTTOMRIGHT: 352 128, CREATIONRESOLUTION: 800 600;NAME = "OptionsMenu.wnd:Retaliation";STATUS = ENABLED+IMAGE+BORDER;STYLE = CHECKBOX+MOUSETRACK;diff --git a/GeneralsMD/Code/GameEngine/Include/Common/AcademyStats.h b/GeneralsMD/Code/GameEngine/Include/Common/AcademyStats.hindex ca9eb920e..7a4f40c89 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/AcademyStats.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/AcademyStats.h@@ -238,8 +238,7 @@ private://| Tier 3 (Advanced advice) |//+--------------------------+- //25) Did the player use the new alternate interface in the options?- //Uses TheGlobalData->m_useAlternateMouse+ //25) retired: there is only one mouse interface now, so there is nothing to ask about.//26) Player did not use the new "double click location attack move/guard"UnsignedInt m_doubleClickAttackMoveOrdersGiven;diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.hindex 65d97d1f8..1d3201c28 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h@@ -138,7 +138,6 @@ public:Bool m_enableDynamicLOD;Bool m_enableStaticLOD;Int m_terrainLODTargetTimeMS;- Bool m_useAlternateMouse;Bool m_clientRetaliationModeEnabled;Bool m_doubleClickAttackMove;Bool m_rightMouseAlwaysScrolls;@@ -355,9 +354,8 @@ public:Bool m_snapCameraRotateTo45; ///< quantize the camera heading to 45 degrees when a middle-drag rotate endsBool m_gridBuildPlacement; ///< quantize structure placement to the pathfinder's build gridBool m_nudgeBuildPlacement; ///< slide a blocked structure to the nearest spot it does fit- Bool m_middleMousePans; ///< middle-button drag pans the camera instead of rotating itBool m_zoomToCursor; ///< the mouse wheel zooms toward whatever the cursor is over- Int m_formationDrag; ///< 0 off, 1 ctrl and the right button draw a formation line, 2 the right button alone+ Bool m_formationDrag; ///< dragging the right button spreads the selection along the line drawnBool m_showHudOverlay; ///< draw the fps / elapsed time / income line in the cornerBool m_showPlacementRangeRing; ///< while placing a structure, ring its weapon rangeBool m_workersReturnToSupply; ///< a worker that finishes a build job goes back to the dock it leftdiff --git a/GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.h b/GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.hindex 81c352fab..69f359771 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.h@@ -86,7 +86,6 @@ public:void setOnlineIPAddress(AsciiString IP); // convenience functionvoid setLANIPAddress(UnsignedInt IP); // convenience functionvoid setOnlineIPAddress(UnsignedInt IP); // convenience function- Bool getAlternateMouseModeEnabled(void); // convenience functionBool getRetaliationModeEnabled(); // convenience functionBool getDoubleClickAttackMoveEnabled(void); // convenience functionReal getScrollFactor(void); // convenience functiondiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.hindex 6a85976bd..411c5dd12 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h@@ -60,7 +60,7 @@ private:UnsignedInt m_mouseRightUp; // when the mouse up happened// latched the moment the right button goes down: whether this drag is drawing a formation line.- // Latched rather than asked again, so letting go of ctrl halfway through does not abandon a line+ // Latched rather than asked again, so a selection that changes mid-drag cannot abandon a line// the player is already dragging.Bool m_formationDragArmed;@@ -134,15 +134,10 @@ 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 );-/** Is this right-button press the start of a formation line rather than a camera scroll?- * setting is TheGlobalData->m_formationDrag: 0 off, 1 ctrl and the right button, 2 the right- * button on its own. */-extern Bool Command_formationDragArmed( Int setting, Bool ctrlHeld, Bool haveMovableSelection,+/** Does this right-button press start a formation line? setting is TheGlobalData->m_formationDrag. */+extern Bool Command_formationDragArmed( Bool setting, Bool haveMovableSelection,Bool guiCommandPending );-///< the same question against the live UI; LookAtXlat asks it to keep its hands off the scroll-extern Bool CommandXlat_isFormationDragArmed( void );-class Player;/** Single-player test hook: make this player the one at the keyboard, throwing away any AI behind* it first. FALSE if that player cannot be played (yourself, neutral, observer, beaten) or thisdiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.hindex f96d91415..0bfbd3cf4 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h@@ -762,8 +762,6 @@ public: // ********************************************************************Bool isDrawableCaptionBold( void ) { return m_drawableCaptionBold; }Color getDrawableCaptionColor( void ) { return m_drawableCaptionColor; }- inline Bool shouldMoveRMBScrollAnchor( void ) { return m_moveRMBScrollAnchor; }-Bool isClientQuiet( void ) const { return m_clientQuiet; }Bool isInWaypointMode( void ) const { return m_waypointMode; }Bool isInForceAttackMode( void ) const { return m_forceAttackMode; }diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.hindex 8fd2ffb03..0fd21fe3b 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/LookAtXlat.h@@ -39,7 +39,6 @@ public:LookAtTranslator();~LookAtTranslator();virtual GameMessageDisposition translateGameMessage(const GameMessage *msg);- virtual const ICoord2D* getRMBScrollAnchor(void); // get m_anchor ICoord2D if we're RMB scrollingBool hasMouseMovedRecently( void );void setCurrentPos( const ICoord2D& pos );@@ -67,13 +66,14 @@ private:{MAX_VIEW_LOCS = 8};+ // The right button used to be in here as SCROLL_RMB. It is not any more: the right button+ // gives orders now, and the camera drag lives on the middle one.enum{SCROLL_NONE = 0,- SCROLL_RMB,SCROLL_KEY,SCROLL_SCREENEDGE,- SCROLL_MMB // middle-button drag pan (MiddleMousePans in Options.ini)+ SCROLL_MMB // middle-button drag pan};ICoord2D m_anchor;ICoord2D m_originalAnchor;diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cppindex 7fb8aa343..aa31d4f36 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp@@ -192,9 +192,8 @@ GlobalData* GlobalData::m_theOriginal = NULL;{ "SnapCameraRotateTo45", INI::parseBool, NULL, offsetof( GlobalData, m_snapCameraRotateTo45 ) },{ "GridBuildPlacement", INI::parseBool, NULL, offsetof( GlobalData, m_gridBuildPlacement ) },{ "NudgeBuildPlacement", INI::parseBool, NULL, offsetof( GlobalData, m_nudgeBuildPlacement ) },- { "MiddleMousePans", INI::parseBool, NULL, offsetof( GlobalData, m_middleMousePans ) },{ "ZoomToCursor", INI::parseBool, NULL, offsetof( GlobalData, m_zoomToCursor ) },- { "FormationDrag", INI::parseInt, NULL, offsetof( GlobalData, m_formationDrag ) },+ { "FormationDrag", INI::parseBool, NULL, offsetof( GlobalData, m_formationDrag ) },{ "ShowHudOverlay", INI::parseBool, NULL, offsetof( GlobalData, m_showHudOverlay ) },{ "ShowPlacementRangeRing", INI::parseBool, NULL, offsetof( GlobalData, m_showPlacementRangeRing ) },{ "WorkersReturnToSupply", INI::parseBool, NULL, offsetof( GlobalData, m_workersReturnToSupply ) },@@ -1051,11 +1050,9 @@ GlobalData::GlobalData()//m_edgeScrollInWindowedMode = TRUE;m_snapCameraRotateTo45 = TRUE;- // middle-drag stays a rotate by default (it snaps to 45 degrees on release); pan is opt-in- m_middleMousePans = FALSE;m_zoomToCursor = TRUE;- // ctrl plus the right button, so plain right-drag scrolling is untouched- m_formationDrag = 1;+ // the right button no longer scrolls, so a right-drag is free to mean something+ m_formationDrag = TRUE;m_snapBuildPlacementTo45 = TRUE;m_gridBuildPlacement = TRUE;@@ -1318,7 +1315,6 @@ void GlobalData::parseGameDataDefinition( INI* ini )// override INI values with user preferencesOptionPreferences optionPref;- TheWritableGlobalData->m_useAlternateMouse = optionPref.getAlternateMouseModeEnabled();TheWritableGlobalData->m_clientRetaliationModeEnabled = optionPref.getRetaliationModeEnabled();TheWritableGlobalData->m_doubleClickAttackMove = optionPref.getDoubleClickAttackMoveEnabled();TheWritableGlobalData->m_keyboardScrollFactor = optionPref.getScrollFactor();diff --git a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cppindex de6770619..df6f23c19 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/OptionsCatalog.cpp@@ -42,14 +42,13 @@OPTION_BOOL_ACCESSORS( m_edgeScrollInWindowedMode )OPTION_BOOL_ACCESSORS( m_snapCameraRotateTo45 )-OPTION_BOOL_ACCESSORS( m_middleMousePans )OPTION_BOOL_ACCESSORS( m_zoomToCursor )+OPTION_BOOL_ACCESSORS( m_formationDrag )OPTION_INT_ACCESSORS( m_bloomIntensity )OPTION_INT_ACCESSORS( m_bloomThreshold )OPTION_INT_ACCESSORS( m_windowMode )OPTION_INT_ACCESSORS( m_msaaLevel )OPTION_INT_ACCESSORS( m_healthBarMode )-OPTION_INT_ACCESSORS( m_formationDrag )//-----------------------------------------------------------------------------static const unsigned TheMsaaSamples[ OPTION_MSAA_LEVEL_COUNT ] = { 0, 2, 4, 8, 16 };@@ -105,20 +104,17 @@ const OptionDef TheOptionCatalog[] =OPTION_BOOL, APPLY_LIVE, 0, 1,get_m_snapCameraRotateTo45, set_m_snapCameraRotateTo45 },- { "MiddleMousePans", "", "",- OPTION_BOOL, APPLY_LIVE, 0, 1,- get_m_middleMousePans, set_m_middleMousePans },-+ // 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.{ "ZoomToCursor", "", "",OPTION_BOOL, APPLY_LIVE, 0, 1,get_m_zoomToCursor, set_m_zoomToCursor },- // Which drag draws the line a selection spreads itself along. 0 is off, 1 is Ctrl and the right- // button, which is the default because it leaves right-drag scrolling exactly where it was, and- // 2 is the bare right button for players who never scroll that way and want the drag on one- // hand. Under 2 a right drag with units selected no longer moves the camera.+ // 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.{ "FormationDrag", "", "",- OPTION_INT, APPLY_LIVE, 0, 2,+ OPTION_BOOL, APPLY_LIVE, 0, 1,get_m_formationDrag, set_m_formationDrag },// Eight rows used to sit here: grid and nudge build placement, snap-to-45 building rotation, thediff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/AcademyStats.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/AcademyStats.cppindex a35542530..3d8fe7a74 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/AcademyStats.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/AcademyStats.cpp@@ -246,8 +246,7 @@ void AcademyStats::init( const Player *player )//| Tier 3 (Advanced advice) |//+--------------------------+- //25) Did the player use the new alternate interface in the options?- //Uses TheGlobalData->m_useAlternateMouse+ //25) retired: there is only one mouse interface now, so there is nothing to ask about.//26) Player did not use the new "double click location attack move/guard"m_doubleClickAttackMoveOrdersGiven = 0;@@ -892,21 +891,10 @@ void AcademyStats::evaluateTier3Advice( AcademyAdviceInfo *info, Int numAvailablBool choosing = numAvailableTips != -1;Int availableTips = 0;- //25) Did the player use the new alternate interface in the options?- if( !TheGlobalData->m_useAlternateMouse )- {- availableTips++;- Int rand = GameClientRandomValue( 0, numAvailableTips - 1 );- Int limit = maxAdviceTips - info->numTips;- if( choosing && rand < limit )- {- info->advice[ info->numTips ].concat( TheGameText->fetch( "ACADEMY:AlternateMouseInterface" ) );- info->numTips++;- }- numAvailableTips--;- }+ //25) used to nag the player about the alternate mouse interface in the options. There is no+ // option and no other interface now, so there is nothing to advise.- //26) Player did not use the new "double click location attack move/guard"+ //26) Player did not use the new "double click location attack move/guard"if( !m_doubleClickAttackMoveOrdersGiven ){availableTips++;@@ -1221,8 +1209,7 @@ void AcademyStats::xfer( Xfer *xfer )//| Tier 3 (Advanced advice) |//+--------------------------+- //25) Did the player use the new alternate interface in the options?- //Uses TheGlobalData->m_useAlternateMouse+ //25) retired: there is only one mouse interface now, so there is nothing to ask about.//26) Player did not use the new "double click location attack move/guard"xfer->xferUnsignedInt( &m_doubleClickAttackMoveOrdersGiven );diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cppindex 3108492fe..363ae805c 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp@@ -264,9 +264,9 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg,const DrawableList *drawableList = TheInGameUI->getAllSelectedLocalDrawables(); // locally-owned only// see if the user wants to move the tactical view- if ( drawableList->empty()- || (! TheGlobalData->m_useAlternateMouse && msg == GWM_RIGHT_DOWN)- || (TheGlobalData->m_useAlternateMouse && msg == GWM_LEFT_DOWN) )+ // Left on the radar looks, right on the radar orders - the same division the world+ // has. It used to depend on UseAlternateMouse, which no longer exists.+ if( drawableList->empty() || msg == GWM_LEFT_DOWN ){TheTacticalView->lookAt( &world );break;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cppindex d3ba54bb5..1b7abb093 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp@@ -98,9 +98,6 @@ static GameWindow * comboBoxResolution = NULL;static NameKeyType comboBoxDetailID = NAMEKEY_INVALID;static GameWindow * comboBoxDetail = NULL;-static NameKeyType checkAlternateMouseID = NAMEKEY_INVALID;-static GameWindow * checkAlternateMouse = NULL;-static NameKeyType checkRetaliationID = NAMEKEY_INVALID;static GameWindow * checkRetaliation = NULL;@@ -374,18 +371,6 @@ void OptionPreferences::setOnlineIPAddress( UnsignedInt IP )(*this)["GameSpyIPAddress"] = tmp;}-Bool OptionPreferences::getAlternateMouseModeEnabled(void)-{- OptionPreferences::const_iterator it = find("UseAlternateMouse");- if (it == end())- return TheGlobalData->m_useAlternateMouse;-- if (stricmp(it->second.str(), "yes") == 0) {- return TRUE;- }- return FALSE;-}-Bool OptionPreferences::getRetaliationModeEnabled(void){OptionPreferences::const_iterator it = find("Retaliation");@@ -896,7 +881,6 @@ static void setDefaults( void )//-------------------------------------------------------------------------------------------------// Mouse Mode- GadgetCheckBoxSetChecked(checkAlternateMouse, FALSE);GadgetCheckBoxSetChecked(checkRetaliation, TRUE );GadgetCheckBoxSetChecked( checkDoubleClickAttackMove, FALSE );@@ -1360,9 +1344,6 @@ static void saveOptions( void )//-------------------------------------------------------------------------------------------------// mouse mode- TheWritableGlobalData->m_useAlternateMouse = GadgetCheckBoxIsChecked(checkAlternateMouse);- (*pref)["UseAlternateMouse"] = TheWritableGlobalData->m_useAlternateMouse ? AsciiString("yes") : AsciiString("no");-TheWritableGlobalData->m_clientRetaliationModeEnabled = GadgetCheckBoxIsChecked(checkRetaliation);(*pref)["Retaliation"] = TheWritableGlobalData->m_clientRetaliationModeEnabled? AsciiString("yes") : AsciiString("no");@@ -1534,8 +1515,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )comboBoxLANIP = TheWindowManager->winGetWindowFromId( NULL, comboBoxLANIPID);comboBoxOnlineIPID = TheNameKeyGenerator->nameToKey( AsciiString( "OptionsMenu.wnd:ComboBoxOnlineIP" ) );comboBoxOnlineIP = TheWindowManager->winGetWindowFromId( NULL, comboBoxOnlineIPID);- checkAlternateMouseID = TheNameKeyGenerator->nameToKey( AsciiString( "OptionsMenu.wnd:CheckAlternateMouse" ) );- checkAlternateMouse = TheWindowManager->winGetWindowFromId( NULL, checkAlternateMouseID);checkRetaliationID = TheNameKeyGenerator->nameToKey( AsciiString( "OptionsMenu.wnd:Retaliation" ) );checkRetaliation = TheWindowManager->winGetWindowFromId( NULL, checkRetaliationID);checkDoubleClickAttackMoveID = TheNameKeyGenerator->nameToKey( AsciiString( "OptionsMenu.wnd:CheckDoubleClickAttackMove" ) );@@ -1946,7 +1925,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )// GadgetCheckBoxSetChecked(checkAudioSurround, TheAudio->getSpeakerSurround());// set the mouse mode- GadgetCheckBoxSetChecked(checkAlternateMouse, TheGlobalData->m_useAlternateMouse);GadgetCheckBoxSetChecked(checkRetaliation, TheGlobalData->m_clientRetaliationModeEnabled);GadgetCheckBoxSetChecked( checkDoubleClickAttackMove, TheGlobalData->m_doubleClickAttackMove );diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex 0f41a4772..e426f4556 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -4537,23 +4537,9 @@ void InGameUI::postDraw( void )}}- // draw RMB scroll anchor- if (TheLookAtTranslator && m_drawRMBScrollAnchor)- {- const ICoord2D* anchor = TheLookAtTranslator->getRMBScrollAnchor();- if (anchor)- {- static const Int w = 2;- static const Int h = 2;- static const Int r = 4; // ratio- static const Color mainColor = GameMakeColor(0, 255, 0, 255);- static const Color dropColor = GameMakeColor(0, 0, 0, 255);- TheDisplay->drawFillRect( anchor->x-w*r-1, anchor->y-h-1, w*2*r+3, h*2+3, dropColor );- TheDisplay->drawFillRect( anchor->x-w-1, anchor->y-h*r-1, w*2+3, h*2*r+3, dropColor );- TheDisplay->drawFillRect( anchor->x-w*r, anchor->y-h, w*2*r+1, h*2+1, mainColor );- TheDisplay->drawFillRect( anchor->x-w, anchor->y-h*r, w*2+1, h*2*r+1, mainColor );- }- }+ // The right-button scroll anchor used to be drawn here. The right button does not scroll any+ // more, so there is nothing to mark. DrawRMBScrollAnchor and MoveRMBScrollAnchor stay in the+ // INI table above because shipped InGameUI.ini sets them and an unknown field is a parse error.//draw superweapon ready multipliersTheControlBar->drawSpecialPowerShortcutMultiplierText();diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cppindex c446c2aa6..75cc0bfab 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp@@ -128,23 +128,17 @@ Bool Command_stopMeansCancelConstruction( Int selectionCount, Bool locallyContro//-------------------------------------------------------------------------------------------------/*** Is this right-button press the start of a formation line?- * A GUI command waiting for a target owns the next click whatever the mouse settings say, and with- * nothing of your own selected there is nobody to spread, so both of those fall through to the- * camera scroll the right button has always been.+ * 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.*/-Bool Command_formationDragArmed( Int setting, Bool ctrlHeld, Bool haveMovableSelection,- Bool guiCommandPending )+Bool Command_formationDragArmed( Bool setting, Bool haveMovableSelection, Bool guiCommandPending ){- if( setting <= 0 || guiCommandPending || !haveMovableSelection )- return FALSE;-- return setting >= 2 || ctrlHeld;+ return setting && !guiCommandPending && haveMovableSelection;}-Bool CommandXlat_isFormationDragArmed( void )+static Bool isFormationDragArmed( void ){return Command_formationDragArmed( TheGlobalData->m_formationDrag,- TheInGameUI->isInForceAttackMode(),TheInGameUI->getSelectCount() > 0&& TheInGameUI->areSelectedObjectsControllable(),TheInGameUI->getGUICommand() != NULL );@@ -3883,7 +3877,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessagem_mouseRightDragAnchor = msg->getArgument( 0 )->pixel;m_mouseRightDown = (UnsignedInt) msg->getArgument( 2 )->integer;- m_formationDragArmed = CommandXlat_isFormationDragArmed();+ m_formationDragArmed = isFormationDragArmed();break;}@@ -3955,9 +3949,9 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage//-----------------------------------------------------------------------------case GameMessage::MSG_MOUSE_RIGHT_DOUBLE_CLICK:{- if( TheGlobalData->m_useAlternateMouse && TheGlobalData->m_doubleClickAttackMove )+ if( TheGlobalData->m_doubleClickAttackMove ){- // create the message and append arguments for a guard location+ // create the message and append arguments for a guard locationGameMessage *newMsg = TheMessageStream->appendMessage( GameMessage::MSG_DO_GUARD_POSITION );Coord3D pos;TheTacticalView->screenToTerrain( &msg->getArgument( 0 )->pixel, &pos );@@ -3974,9 +3968,10 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage}case GameMessage::MSG_MOUSE_RIGHT_CLICK:{- // right click is only actioned here if we're in alternate mouse mode- if (TheGlobalData->m_useAlternateMouse- && TheMouse->isClick(&m_mouseRightDragAnchor, &m_mouseRightDragLift, m_mouseRightDown, m_mouseRightUp))+ // 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.+ if (TheMouse->isClick(&m_mouseRightDragAnchor, &m_mouseRightDragLift, m_mouseRightDown, m_mouseRightUp)){Bool isPoint = (msg->getArgument(0)->pixelRegion.height() == 0 && msg->getArgument(0)->pixelRegion.width() == 0);@@ -4018,21 +4013,9 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage//-----------------------------------------------------------------------------case GameMessage::MSG_MOUSE_LEFT_DOUBLE_CLICK:{- if( !TheGlobalData->m_useAlternateMouse && TheGlobalData->m_doubleClickAttackMove )- {- // create the message and append arguments for a guard location- GameMessage *newMsg = TheMessageStream->appendMessage( GameMessage::MSG_DO_GUARD_POSITION );- Coord3D pos;- TheTacticalView->screenToTerrain( &msg->getArgument( 0 )->pixel, &pos );- newMsg->appendLocationArgument(pos);- newMsg->appendIntegerArgument(GUARDMODE_NORMAL);-- ThePlayerList->getLocalPlayer()->getAcademyStats()->recordDoubleClickAttackMoveOrderGiven();-- TheInGameUI->triggerDoubleClickAttackMoveGuardHint();-- break;- }+ // The double-click attack move used to sit here as well, for the classic mouse. There is+ // only one mouse now and its orders are on the right button, so this case does nothing of+ // its own.//intentional fall through}case GameMessage::MSG_MOUSE_LEFT_CLICK:@@ -4052,7 +4035,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessageTheTacticalView->screenToTerrain( &msg->getArgument( 0 )->pixel, &pos );const CommandButton *command = TheInGameUI->getGUICommand();- // maintain this as the list of GUI button initiated commands that fire with left click in alt mouse mode+ // maintain this as the list of GUI button initiated commands that fire with left clickBool isFiringGUICommand = (command && (command->getCommandType() == GUI_COMMAND_SPECIAL_POWER|| command->getCommandType() == GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT|| command->getCommandType() == GUI_COMMAND_FIRE_WEAPON@@ -4060,8 +4043,10 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage|| command->getCommandType() == GUICOMMANDMODE_HIJACK_VEHICLE|| command->getCommandType() == GUICOMMANDMODE_CONVERT_TO_CARBOMB));- // in alternate mouse mode, this left click is only actioned here if we're firing a gui command- if ((TheGlobalData->m_useAlternateMouse) && (! isFiringGUICommand))+ // The left button selects and nothing else. The one exception is a GUI command that is+ // already armed and waiting for a target, which is aimed with the left button because the+ // right one cancels it.+ if( !isFiringGUICommand )break;Bool controllable = TheInGameUI->areSelectedObjectsControllable()diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cppindex dde751ecb..2b9028244 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/LookAtXlat.cpp@@ -48,7 +48,6 @@#include "GameClient/View.h"#include "GameClient/Drawable.h"#include "GameClient/LookAtXlat.h"-#include "GameClient/CommandXlat.h" // for the formation drag, which takes the right button away#include "GameLogic/Module/UpdateModule.h"#include "GameLogic/GameLogic.h"@@ -138,15 +137,6 @@ LookAtTranslator::~LookAtTranslator()TheLookAtTranslator = NULL;}-const ICoord2D* LookAtTranslator::getRMBScrollAnchor(void)-{- if (m_isScrolling && m_scrollType == SCROLL_RMB)- {- return &m_anchor;- }- return NULL;-}-Bool LookAtTranslator::hasMouseMovedRecently( void ){if (m_lastMouseMoveFrame > TheGameLogic->getFrame())@@ -286,31 +276,13 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage}//-----------------------------------------------------------------------------+ // The right button belongs to the order layer now - a click commands, a drag draws a+ // formation line - so nothing here touches the camera. Both cases stay only to keep the+ // idle timer honest: a player who is right-clicking is not away from the keyboard.case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_DOWN:- {- m_lastMouseMoveFrame = TheGameLogic->getFrame();-- m_anchor = msg->getArgument( 0 )->pixel;- m_currentPos = msg->getArgument( 0 )->pixel;-- // a right button that is about to draw a formation line is not a scroll; this translator- // runs before CommandTranslator, so it has to ask the same question for itself- if (!TheInGameUI->isSelecting() && !m_isScrolling && !CommandXlat_isFormationDragArmed())- {- setScrolling(SCROLL_RMB);- }- break;- }-- //-----------------------------------------------------------------------------case GameMessage::MSG_RAW_MOUSE_RIGHT_BUTTON_UP:{m_lastMouseMoveFrame = TheGameLogic->getFrame();-- if (m_scrollType == SCROLL_RMB)- {- stopScrolling();- }break;}@@ -324,9 +296,12 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessagem_currentPos = msg->getArgument( 0 )->pixel;m_timestamp = TheGameClient->getFrame();- // MiddleMousePans in Options.ini swaps the middle-drag from rotate to pan; the- // click-to-reset below still works either way.- if( TheGlobalData->m_middleMousePans )+ // 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)@@ -545,35 +520,6 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessagem_anchor = m_currentPos;}break;- case SCROLL_RMB:- {- if (TheInGameUI->shouldMoveRMBScrollAnchor())- {- Int maxX = TheDisplay->getWidth()/2;- Int maxY = TheDisplay->getHeight()/2;-- if (m_currentPos.x + maxX < m_anchor.x)- m_anchor.x = m_currentPos.x + maxX;- else if (m_currentPos.x - maxX > m_anchor.x)- m_anchor.x = m_currentPos.x - maxX;-- if (m_currentPos.y + maxY < m_anchor.y)- m_anchor.y = m_currentPos.y + maxY;- else if (m_currentPos.y - maxY > m_anchor.y)- m_anchor.y = m_currentPos.y - maxY;- }-- offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * (m_currentPos.x - m_anchor.x);- offset.y = TheGlobalData->m_verticalScrollSpeedFactor * (m_currentPos.y - m_anchor.y);- Coord2D vec;- vec.x = offset.x;- vec.y = offset.y;- vec.normalize();- // Add in the window scroll amount as the minimum.- offset.x += TheGlobalData->m_horizontalScrollSpeedFactor * vec.x * sqr(TheGlobalData->m_keyboardScrollFactor);- offset.y += TheGlobalData->m_verticalScrollSpeedFactor * vec.y * sqr(TheGlobalData->m_keyboardScrollFactor);- }- break;case SCROLL_KEY:{if (scrollDir[DIR_UP])diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cppindex 985b81b97..46b119aaf 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp@@ -1035,8 +1035,8 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa//when you right click.if( !TheInGameUI->getGUICommand() && !TheKeyboard->isShift() && !TheKeyboard->isCtrl() && !TheKeyboard->isAlt() ){- //No GUI command mode, so deselect everyone if we're in alternate mouse mode.- if( TheGlobalData->m_useAlternateMouse && TheInGameUI->getPendingPlaceSourceObjectID() == INVALID_ID )+ //No GUI command mode, so a click on empty ground deselects everyone.+ if( TheInGameUI->getPendingPlaceSourceObjectID() == INVALID_ID ){if( !TheInGameUI->getPreventLeftClickDeselectionInAlternateMouseModeForOneClick() ){@@ -1128,11 +1128,8 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessadisp = DESTROY_MESSAGE;TheInGameUI->setScrolling( FALSE );}- else if( !TheGlobalData->m_useAlternateMouse )- {- //No GUI command mode, so deselect everyone if we're in regular mouse mode.- deselectAll();- }+ // The right button used to deselect here in the classic mouse mode. It does not any+ // more: it is the order button, and an order that hits nothing is simply no order.}break;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cppindex e8b862d66..3ad336741 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/SelectionInfo.cpp@@ -195,56 +195,11 @@ extern Bool contextCommandForNewSelection(const DrawableList *currentlySelectedDreturn FALSE;}- if (TheGlobalData->m_useAlternateMouse) {- // context sensitive commands never apply when selecting in alternate mouse mode- return FALSE;- }-- if (outSelectionInfo->currentCountMine > 0) {- if (outSelectionInfo->newCountEnemies > 0) {- if (outSelectionInfo->newCountEnemies == 1 && selectionIsPoint) {- return TheGameClient->evaluateContextCommand(newEnemy, newEnemy->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;- }-- return selectionIsPoint;- }-- if (outSelectionInfo->newCountMine > 0) {- if (outSelectionInfo->newCountMine == 1 && selectionIsPoint && !TheInGameUI->isInPreferSelectionMode()) {- return TheGameClient->evaluateContextCommand(newMine, newMine->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;- }-- return FALSE;- }-- if (outSelectionInfo->newCountFriends > 0) {- if (outSelectionInfo->newCountFriends == 1 && selectionIsPoint) {- return TheGameClient->evaluateContextCommand(newFriendly, newFriendly->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;- }- return FALSE;- }-- if (outSelectionInfo->currentCountMineInfantry > 0 && outSelectionInfo->newCountGarrisonableBuildings == 1) {- return TRUE;- }-- if (outSelectionInfo->newCountCivilians > 0) {- if (outSelectionInfo->newCountCivilians == 1 && selectionIsPoint) {- return TheGameClient->evaluateContextCommand(newCivilian, newCivilian->getPosition(), CommandTranslator::EVALUATE_ONLY) != GameMessage::MSG_INVALID;- }- return FALSE;- }-- if (outSelectionInfo->newCountCrates > 0) {- return (outSelectionInfo->newCountCrates == 1 && selectionIsPoint);- }- }-- if (outSelectionInfo->currentCountMine == 0) {- return FALSE;- }-- return selectionIsPoint;+ // Everything below this line used to work out whether a left click on an enemy, an ally, a+ // garrisonable building or a crate should command instead of select. It cannot any more: the+ // left button selects and the right button orders, so the answer is always no. The counting+ // above is still wanted - the caller reads the counts for the cursor and the selection filters.+ return FALSE;}//-------------------------------------------------------------------------------------------------diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex 75fe5bba4..18e07f378 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -924,28 +924,22 @@ TEST(ctrl_is_force_fire_only_while_the_attack_move_cursor_is_down)CHECK( !CommandXlat_isForceAttackTargeting( false, true ) );}-/* CommandXlat.cpp: the right button already scrolls the camera, so the formation line has to be- sure it is wanted before it takes that drag away. LookAtXlat asks the same question one- translator earlier, which is why the rule is a function rather than a condition written twice. */-extern Bool Command_formationDragArmed( Int setting, Bool ctrlHeld, Bool haveMovableSelection,+/* 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. */+extern Bool Command_formationDragArmed( Bool setting, Bool haveMovableSelection,Bool guiCommandPending );TEST(formation_drag_takes_the_right_button_only_when_it_is_asked_for){- /* setting 1, the default: ctrl and the right button together, and nothing else. */- CHECK( Command_formationDragArmed( 1, true, true, false ) );- CHECK( !Command_formationDragArmed( 1, false, true, false ) );-- /* setting 2: the right button on its own, ctrl or no ctrl. */- CHECK( Command_formationDragArmed( 2, false, true, false ) );- CHECK( Command_formationDragArmed( 2, true, true, false ) );+ /* on by default: a right drag with your own units selected draws the line. */+ CHECK( Command_formationDragArmed( true, true, false ) );/* off is off. */- CHECK( !Command_formationDragArmed( 0, true, true, false ) );+ CHECK( !Command_formationDragArmed( false, true, false ) );/* nobody to spread, or a GUI command already waiting for this click. */- CHECK( !Command_formationDragArmed( 2, true, false, false ) );- CHECK( !Command_formationDragArmed( 2, true, true, true ) );+ CHECK( !Command_formationDragArmed( true, false, false ) );+ CHECK( !Command_formationDragArmed( true, true, true ) );}/* AssaultTransportAIUpdate.cpp: the troop crawler deploys its passengers at a target and used to@@ -8039,7 +8033,7 @@ TEST(gameplay_conveniences_are_forced_on_and_left_the_catalog)Options.ini that names one still wins over the default. */static const char *const hidden[] ={- "MiddleMousePans", "ZoomToCursor", "EdgeScrollInWindowedMode", "SnapCameraRotateTo45", NULL+ "FormationDrag", "ZoomToCursor", "EdgeScrollInWindowedMode", "SnapCameraRotateTo45", NULL};for( Int i = 0; hidden[ i ] != NULL; ++i ){diff --git a/GeneralsMD/Code/Tools/optionsmenu_layout.py b/GeneralsMD/Code/Tools/optionsmenu_layout.pyindex 94aa262e1..be47be0ec 100644--- a/GeneralsMD/Code/Tools/optionsmenu_layout.py+++ b/GeneralsMD/Code/Tools/optionsmenu_layout.py@@ -72,9 +72,13 @@ RULES = ["Line1", "Line2", "Line3", "Line4"]# positioned by hand, so it gets a name on the way through.NAME_THE_UNNAMED = [("GUI:AntiAliasing", "AntiAliasingLabel")]+# Controls that are in the shipped file and are not wanted at all. CheckAlternateMouse chose+# between the classic mouse and the alternate one; there is one mouse now, so the choice is gone.+DELETE = ["CheckAlternateMouse"]+# The new controls, cloned from a control of the same kind that is already in the file.# (page, template, name, text key, left, top, width, height)-CHECK, LABEL, COMBO, SLIDER = "CheckAlternateMouse", "DetailLabel", "ComboBoxDetail", "SliderGamma"+CHECK, LABEL, COMBO, SLIDER = "Retaliation", "DetailLabel", "ComboBoxDetail", "SliderGamma"CONTROLS = [# Display: the two device settings and the two bloom knobs, in the space the audio panel left@@ -120,12 +124,11 @@ RELAYOUT = [("VoiceVolumeLabel", 160, 216, 183, 24),("SliderVoiceVolume", 164, 240, 208, 24),- ("ScrollParent", 151, 100, 484, 112),- ("CheckAlternateMouse", 160, 104, 192, 24),+ ("ScrollParent", 151, 100, 484, 88),+ ("Retaliation", 160, 104, 192, 24),("CheckDoubleClickAttackMove", 387, 104, 246, 24),- ("Retaliation", 160, 128, 192, 24),- ("ScrollSpeedLabel", 160, 160, 464, 24),- ("SliderScrollSpeed", 167, 184, 444, 24),+ ("ScrollSpeedLabel", 160, 136, 464, 24),+ ("SliderScrollSpeed", 167, 160, 444, 24),("NetworkParent", 151, 100, 484, 96),("StaticTextOnlineIpAddresses", 152, 104, 88, 24),@@ -204,6 +207,14 @@ def drawn_text(window):return match.group(1) if match else None+def drop_by_name(root, names):+ """Delete every window with one of these names, wherever it sits."""+ wanted = set(names)+ for node in list(root.walk()):+ node.children = [child for child in node.children+ if (child.name or "").split(":")[-1] not in wanted]++def drop_by_text(root, texts):"""Delete every window drawing one of these strings, wherever it sits."""wanted = set(texts)@@ -224,6 +235,7 @@ def build(layout):node.name = _named(name)drop_by_text(layout.root, HEADINGS)+ drop_by_name(layout.root, DELETE)for name in RULES:detach(old, name)