Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

feat(gameclient): finish the quality-of-life sweep

Olcay Seygan5e3f7b90f573
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
index e71db2676..a00200d58 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
@@ -332,6 +332,8 @@ public:
Bool m_showHudOverlay; ///< draw the fps / elapsed time / income line in the corner
Bool m_showPlacementRangeRing; ///< while placing a structure, ring its weapon range
Bool m_workersReturnToSupply; ///< a worker that finishes a build job goes back to the dock it left
+ Bool m_alwaysShowWaypointLines; ///< draw a selected unit's queued waypoint path without holding the waypoint key
+ Bool m_detailedBuildTooltips; ///< put build time, weapon range and damage in the build tooltip
Bool m_buildMapCache;
AsciiString m_initialFile; ///< If this is specified, load a specific map/replay from the command-line
AsciiString m_pendingFile; ///< If this is specified, use this map at the next game start
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h
index d2ae93066..4bbcf41fb 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h
@@ -247,6 +247,9 @@ public:
MSG_META_SHORTCUT_SLOT06, ///< press general's power shortcut bar slot 06
MSG_META_SHORTCUT_SLOT07, ///< press general's power shortcut bar slot 07
MSG_META_SHORTCUT_SLOT08, ///< press general's power shortcut bar slot 08
+ MSG_META_SHORTCUT_SLOT09, ///< press general's power shortcut bar slot 09 (fork: the bar holds 11)
+ MSG_META_SHORTCUT_SLOT10, ///< press general's power shortcut bar slot 10 (fork)
+ MSG_META_SHORTCUT_SLOT11, ///< press general's power shortcut bar slot 11 (fork)
MSG_META_VIEW_COMMAND_CENTER, ///< center view on command center
MSG_META_VIEW_LAST_RADAR_EVENT, ///< center view on last radar event
MSG_META_SELECT_HERO, ///< selects player's hero character, if exists...
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.h b/GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.h
index af0424839..78f690557 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.h
@@ -117,6 +117,8 @@ public:
Bool getShowHudOverlay(void);
Bool getShowPlacementRangeRing(void);
Bool getWorkersReturnToSupply(void);
+ Bool getAlwaysShowWaypointLines(void);
+ Bool getDetailedBuildTooltips(void);
Int getTextureReduction(void);
void getResolution(Int *xres, Int *yres);
Bool get3DShadowsEnabled(void);
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
index 933395350..182b227d9 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
@@ -836,7 +836,6 @@ protected:
void evaluateContextUI( void );
/// add the common commands of this drawable to the common command set
- void addCommonCommands( Drawable *draw, Bool firstDrawable );
/// switch the interface context to the new mode and populate as needed
void switchToContext( ControlBarContext context, Drawable *draw );
@@ -858,7 +857,6 @@ protected:
void postProcessCommands( void );
// the following methods are for resetting data for vaious contexts
- void resetCommonCommandData( void ); /// reset shared command data
void resetContainData( void ); /// reset container data we use to tie controls to objects IDs for containment
void resetBuildQueueData( void ); /// reset the build queue data we use to die queue entires to control
void resetBuildQueueButtons( void ); /// attach the queue button windows and wipe them to empty
@@ -875,7 +873,6 @@ protected:
void updateMultiSelectStrip( void );
void layoutMultiSelectTiles( Int count ); ///< make sure count cells exist, laid out n x n over the right HUD
void cancelLastQueuedUnit( const ThingTemplate *thing ); ///< right-click on a build button
- void populateBuildQueue( Object *producer );
void populateStructureInventory( Object *building );
void populateBeacon( Object *beacon );
void populateUnderConstruction( Object *objectUnderConstruction );
@@ -961,7 +958,6 @@ protected:
GameWindow *m_specialPowerShortcutParent;
GameWindow *m_commandWindows[ MAX_COMMANDS_PER_SET ]; ///< command window controls for easy access
- const CommandButton *m_commonCommands[ MAX_COMMANDS_PER_SET ]; ///< shared commands we will use for multi-selection
CommandButton *m_buildPageButton[ BUILD_PAGE_COUNT ]; ///< the two menu buttons a paged builder opens on
CommandButton *m_buildPageBackButton; ///< takes a page back to the menu buttons
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp
index de8487263..5b7b9538c 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GameLOD.cpp
@@ -373,6 +373,8 @@ void GameLODManager::init(void)
TheWritableGlobalData->m_showHudOverlay = optionPref.getShowHudOverlay();
TheWritableGlobalData->m_showPlacementRangeRing = optionPref.getShowPlacementRangeRing();
TheWritableGlobalData->m_workersReturnToSupply = optionPref.getWorkersReturnToSupply();
+ TheWritableGlobalData->m_alwaysShowWaypointLines = optionPref.getAlwaysShowWaypointLines();
+ TheWritableGlobalData->m_detailedBuildTooltips = optionPref.getDetailedBuildTooltips();
setStaticLODLevel(userSetDetail);
}
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
index 66acf357b..fb969725e 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
@@ -189,6 +189,8 @@ GlobalData* GlobalData::m_theOriginal = NULL;
{ "ShowHudOverlay", INI::parseBool, NULL, offsetof( GlobalData, m_showHudOverlay ) },
{ "ShowPlacementRangeRing", INI::parseBool, NULL, offsetof( GlobalData, m_showPlacementRangeRing ) },
{ "WorkersReturnToSupply", INI::parseBool, NULL, offsetof( GlobalData, m_workersReturnToSupply ) },
+ { "AlwaysShowWaypointLines", INI::parseBool, NULL, offsetof( GlobalData, m_alwaysShowWaypointLines ) },
+ { "DetailedBuildTooltips", INI::parseBool, NULL, offsetof( GlobalData, m_detailedBuildTooltips ) },
{ "MinCameraHeight", INI::parseReal, NULL, offsetof( GlobalData, m_minCameraHeight ) },
{ "TerrainHeightAtEdgeOfMap", INI::parseReal, NULL, offsetof( GlobalData, m_terrainHeightAtEdgeOfMap ) },
{ "UnitDamagedThreshold", INI::parseReal, NULL, offsetof( GlobalData, m_unitDamagedThresh ) },
@@ -998,6 +1000,8 @@ GlobalData::GlobalData()
m_showHudOverlay = FALSE;
m_showPlacementRangeRing = FALSE;
m_workersReturnToSupply = FALSE;
+ m_alwaysShowWaypointLines = FALSE;
+ m_detailedBuildTooltips = FALSE;
m_animateWindows = TRUE;
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp
index da9c4e5ca..7bdc144aa 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp
@@ -355,6 +355,9 @@ AsciiString GameMessage::getCommandTypeAsAsciiString(GameMessage::Type t)
CHECK_IF(MSG_META_SHORTCUT_SLOT06)
CHECK_IF(MSG_META_SHORTCUT_SLOT07)
CHECK_IF(MSG_META_SHORTCUT_SLOT08)
+ CHECK_IF(MSG_META_SHORTCUT_SLOT09)
+ CHECK_IF(MSG_META_SHORTCUT_SLOT10)
+ CHECK_IF(MSG_META_SHORTCUT_SLOT11)
CHECK_IF(MSG_META_VIEW_COMMAND_CENTER)
CHECK_IF(MSG_META_VIEW_LAST_RADAR_EVENT)
CHECK_IF(MSG_META_SELECT_HERO)
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
index 2eec6e091..f89bc1581 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
@@ -1032,11 +1032,6 @@ ControlBar::ControlBar( void )
m_animateDownWindow = NULL;
m_animTime = 0;
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++)
- {
- m_commonCommands[i] = 0;
- }
-
m_currContext = CB_CONTEXT_NONE;
m_defaultControlBarPosition.x = m_defaultControlBarPosition.y = 0;
m_genStarFlash = FALSE;
@@ -4142,7 +4137,11 @@ void ControlBar::drawSpecialPowerShortcutMultiplierText()
// the button's text: the key that presses it (SHORTCUT_SLOTnn, F1..), then how many
// of its superweapons are ready - a "1" is superfluous (Lorenzen)
UnicodeString text;
- if( i < 8 )
+ // the bar holds MAX_SPECIAL_POWER_SHORTCUTS buttons, but only eight SHORTCUT_SLOT meta
+ // events existed, so slots 9-11 could never be labelled or bound. They have events now;
+ // whether they carry a key is up to CommandMap.ini, and getMetaKeyLabel returns empty
+ // for an unbound one.
+ if( i < MAX_SPECIAL_POWER_SHORTCUTS )
text = getMetaKeyLabel( (GameMessage::Type)(GameMessage::MSG_META_SHORTCUT_SLOT01 + i) );
const SpecialPowerTemplate *spTemplate = command->getSpecialPowerTemplate();
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
index 739d29ccf..ce7f5dde6 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommand.cpp
@@ -631,116 +631,6 @@ void ControlBar::resetBuildQueueButtons( void )
} // end resetBuildQueueButtons
-//-------------------------------------------------------------------------------------------------
-//-------------------------------------------------------------------------------------------------
-void ControlBar::populateBuildQueue( Object *producer )
-{
-/// @todo srj -- remove hard-coding here, please
- static const CommandButton *cancelUnitCommand = findCommandButton( "Command_CancelUnitCreate" );
-/// @todo srj -- remove hard-coding here, please
- static const CommandButton *cancelUpgradeCommand = findCommandButton( "Command_CancelUpgradeCreate" );
-
- // attach and wipe the queue buttons
- resetBuildQueueButtons();
-
- // step through each object being built and set the image data for the buttons
- ProductionUpdateInterface *pu = producer->getProductionUpdateInterface();
- if( pu == NULL )
- return; // sanity
- const ProductionEntry *production;
- Int windowIndex = 0;
- const Image *image;
- for( production = pu->firstProduction();
- production;
- production = pu->nextProduction( production ) )
- {
-
- // don't go above how many queue windows we have
- if( windowIndex >= MAX_BUILD_QUEUE_BUTTONS )
- break; // exit for
-
- // set the command into the queue button
- if( production->getProductionType() == PRODUCTION_UNIT )
- {
-
- // set the control command
- setControlCommand( m_queueData[ windowIndex ].control, cancelUnitCommand );
- m_queueData[ windowIndex ].type = PRODUCTION_UNIT;
- m_queueData[ windowIndex ].productionID = production->getProductionID();
-
- // set the images
- m_queueData[ windowIndex ].control->winEnable( TRUE );
- m_queueData[ windowIndex ].control->winSetStatus( WIN_STATUS_USE_OVERLAY_STATES );
- image = production->getProductionObject()->getButtonImage();
- GadgetButtonSetEnabledImage( m_queueData[ windowIndex ].control, image );
-
- //No longer used.
- //image = TheMappedImageCollection->findImageByName( production->getProductionObject()->getInventoryImageName( INV_IMAGE_HILITE ) );
- //GadgetButtonSetHiliteSelectedImage( m_queueData[ windowIndex ].control, image );
- //image = TheMappedImageCollection->findImageByName( production->getProductionObject()->getInventoryImageName( INV_IMAGE_PUSHED ) );
- //GadgetButtonSetHiliteImage( m_queueData[ windowIndex ].control, image );
-
- //Show the veterancy rank of the object being constructed in the queue
- const Image *image = calculateVeterancyOverlayForThing( production->getProductionObject() );
- GadgetButtonDrawOverlayImage( m_queueData[ windowIndex ].control, image );
- //
- // note we're not setting a disabled image into the queue button ... when there is
- // nothing in the queue we set the button to disabled, we want to leave the disabled
- // queue button graphic we already have in place
- //
- // image = TheMappedImageCollection->findImageByName( production->getProductionObject()->getInventoryImageName( INV_IMAGE_DISABLED ) );
- // GadgetButtonSetDisabledImage( m_queueData[ windowIndex ].control, image );
-
- } // end if
- else
- {
- const UpgradeTemplate *ut = production->getProductionUpgrade();
-
- // set the control command
- setControlCommand( m_queueData[ windowIndex ].control, cancelUpgradeCommand );
- m_queueData[ windowIndex ].type = PRODUCTION_UPGRADE;
- m_queueData[ windowIndex ].upgradeToResearch = production->getProductionUpgrade();
-
- // set the images
- m_queueData[ windowIndex ].control->winEnable( TRUE );
- m_queueData[ windowIndex ].control->winSetStatus( WIN_STATUS_USE_OVERLAY_STATES );
- image = ut->getButtonImage();
- GadgetButtonSetEnabledImage( m_queueData[ windowIndex ].control, image );
-
- //No longer used
- //image = TheMappedImageCollection->findImageByName( ut->getQueueImageName( UpgradeTemplate::UPGRADE_HILITE ) );
- //GadgetButtonSetHiliteSelectedImage( m_queueData[ windowIndex ].control, image );
- //image = TheMappedImageCollection->findImageByName( ut->getQueueImageName( UpgradeTemplate::UPGRADE_PUSHED ) );
- //GadgetButtonSetHiliteImage( m_queueData[ windowIndex ].control, image );
- //
- // note we're not setting a disabled image into the queue button ... when there is
- // nothing in the queue we set the button to disabled, we want to leave the disabled
- // queue button graphic we already have in place
- //
- // image = TheMappedImageCollection->findImageByName( ut->getQueueImageName( UpgradeTemplate::UPGRADE_DISABLED ) );
- // GadgetButtonSetDisabledImage( m_queueData[ windowIndex ].control, image );
-
- } // end else
-
- // we have filled up this window now
- windowIndex++;
-
- } // end for
-
- //
- // the panel has MAX_BUILD_QUEUE_BUTTONS windows but the queue can run to 100; when it
- // overflows, the last cell wears the whole queue's length as its badge
- //
- if( pu->getProductionCount() > MAX_BUILD_QUEUE_BUTTONS )
- GadgetButtonSetCount( m_queueData[ MAX_BUILD_QUEUE_BUTTONS - 1 ].control, pu->getProductionCount() );
-
- //
- // save the count of things being produced in the build queue, when it changes we will
- // repopulate the queue to visually show the change
- //
- m_displayedQueueCount = pu->getProductionCount();
-
-} // end populateBuildQueue
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
index db894c4d3..ca7d8d99a 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarMultiSelect.cpp
@@ -49,165 +49,6 @@
-//-------------------------------------------------------------------------------------------------
-/** Reset the common command data */
-//-------------------------------------------------------------------------------------------------
-void ControlBar::resetCommonCommandData( void )
-{
- Int i;
-
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
- m_commonCommands[ i ] = NULL;
- //Clear out any remnant overlays.
- GadgetButtonDrawOverlayImage( m_commandWindows[ i ], NULL );
- }
-
-} // end resetCommonCommandData
-
-//-------------------------------------------------------------------------------------------------
-/** add the common commands of this drawable to the common command set */
-//-------------------------------------------------------------------------------------------------
-void ControlBar::addCommonCommands( Drawable *draw, Bool firstDrawable )
-{
- Int i;
- const CommandButton *command;
-
- // sanity
- if( draw == NULL )
- return;
-
- Object* obj = draw->getObject();
- if (!obj)
- return;
-
- if (obj->isKindOf(KINDOF_IGNORED_IN_GUI)) // ignore these guys
- return;
-
- // get the command set of this drawable
- const CommandSet *commandSet = findCommandSet( obj->getCommandSetString() );
- if( commandSet == NULL )
- {
-
- //
- // if there is no command set for this drawable, none of the selected drawables
- // can possibly have matching commands so we'll get rid of them all
- //
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
-
- m_commonCommands[ i ] = NULL;
- if (m_commandWindows[ i ])
- {
- m_commandWindows[ i ]->winHide( TRUE );
- }
- // After Every change to the m_commandWIndows, we need to show fill in the missing blanks with the images
- // removed from multiplayer branch
- //showCommandMarkers();
-
- } // end for i
-
- return;
-
- } // end if
-
-
- //
- // easy case, if we're adding the first drawable we simply just add any of the commands
- // in its set that can be multi-select commands to the common command set
- //
- if( firstDrawable == TRUE )
- {
-
- // just add each command that is classified as a common command
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
- // our implementation doesn't necessarily make use of the max possible command buttons
- if (! m_commandWindows[ i ]) continue;
-
- // get command
- command = commandSet->getCommandButton(i);
-
- // add if present and can be used in a multi select. Unit builds are allowed too: the
- // later drawables only keep a slot whose button is identical, so they survive only
- // when every selected factory shares the same command set (processCommandUI then
- // routes the build to the selected factory with the shortest queue)
- if( command && ( BitTest( command->getOptions(), OK_FOR_MULTI_SELECT ) == TRUE ||
- command->getCommandType() == GUI_COMMAND_UNIT_BUILD ) )
- {
-
- // put it in the common command set
- m_commonCommands[ i ] = command;
-
- // show and enable this control
- m_commandWindows[ i ]->winHide( FALSE );
- m_commandWindows[ i ]->winEnable( TRUE );
-
- // set the command into the control
- setControlCommand( m_commandWindows[ i ], command );
-
- } // end if
-
- } // end for i
-
- } // end if
- else
- {
-
- // go through each command one by one
- for( i = 0; i < MAX_COMMANDS_PER_SET; i++ )
- {
-
- // our implementation doesn't necessarily make use of the max possible command buttons
- if (! m_commandWindows[ i ]) continue;
-
- // get the command
- command = commandSet->getCommandButton(i);
-
- Bool attackMove = (command && command->getCommandType() == GUI_COMMAND_ATTACK_MOVE) ||
- (m_commonCommands[ i ] && m_commonCommands[ i ]->getCommandType() == GUI_COMMAND_ATTACK_MOVE);
-
- // Kris: When any units have attack move, they all get it. This is to allow
- // combat units to be selected with the odd dozer or pilot and still retain that ability.
- if( attackMove && !m_commonCommands[ i ] )
- {
- // put it in the common command set
- m_commonCommands[ i ] = command;
-
- // show and enable this control
- m_commandWindows[ i ]->winHide( FALSE );
- m_commandWindows[ i ]->winEnable( TRUE );
-
- // set the command into the control
- setControlCommand( m_commandWindows[ i ], command );
- }
- else if( command != m_commonCommands[ i ] && !attackMove )
- {
- //
- // if this command does not match the command that is in the common command set then
- // *neither* this command OR the command in the common command set are really common
- // commands, so we will remove the one that has been stored in the common set
- //
-
- // remove the common command
- m_commonCommands[ i ] = NULL;
-
- //
- // hide the window control cause it should have been made visible from a command
- // that was placed in this common 'slot' earlier
- //
- m_commandWindows[ i ]->winHide( TRUE );
- }
-
- } // end if
-
- } // end else
-
- // After Every change to the m_commandWIndows, we need to show fill in the missing blanks with the images
- // removed from multiplayer branch
- //showCommandMarkers();
-
-} // end addCommonCommands
//-------------------------------------------------------------------------------------------------
/** Populate the visible command bar with commands that are common to all the objects
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
index e9424f809..4b10d0313 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
@@ -93,6 +93,7 @@
#include "GameLogic/ScriptEngine.h"
#include "GameNetwork/NetworkInterface.h"
+#include "GameLogic/Weapon.h" // WeaponTemplate/WeaponBonus for the detailed build tooltip
#ifdef _INTERNAL
// for occasional debugging...
//#pragma optimize("", off)
@@ -413,6 +414,46 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton,
cost.format( TheGameText->fetch("TOOLTIP:Cost"), costToBuild );
}
+ //
+ // DetailedBuildTooltips: retail tells you the price and nothing about what you get.
+ // Append build time, health, and the best weapon's range and damage, all read off the
+ // template - there is no Object yet to ask.
+ //
+ if( TheGlobalData->m_detailedBuildTooltips )
+ {
+ UnicodeString stats;
+ Int buildSecs = thingTemplate->calcTimeToBuild( player ) / LOGICFRAMES_PER_SECOND;
+ stats.format( L"\nTime %ds", buildSecs );
+
+ // no bonuses: these are the template's own numbers, before veterancy or upgrades
+ WeaponBonus noBonus;
+ Real bestRange = 0.0f;
+ Real bestDamage = 0.0f;
+ const WeaponTemplateSet *wts = thingTemplate->findWeaponTemplateSet( WeaponSetFlags() );
+ if( wts )
+ {
+ for( Int ws = PRIMARY_WEAPON; ws < WEAPONSLOT_COUNT; ++ws )
+ {
+ const WeaponTemplate *wt = wts->getNth( (WeaponSlotType)ws );
+ if( wt == NULL )
+ continue;
+ if( wt->getUnmodifiedAttackRange() > bestRange )
+ bestRange = wt->getUnmodifiedAttackRange();
+ if( wt->getPrimaryDamage( noBonus ) > bestDamage )
+ bestDamage = wt->getPrimaryDamage( noBonus );
+ }
+ }
+
+ if( bestDamage > 0.0f )
+ {
+ UnicodeString weap;
+ weap.format( L" Dmg %d Range %d", REAL_TO_INT( bestDamage ), REAL_TO_INT( bestRange ) );
+ stats.concat( weap );
+ }
+
+ descrip.concat( stats );
+ }
+
// ask each prerequisite to give us a list of the non satisfied prerequisites
for( Int i=0; i<thingTemplate->getPrereqCount(); i++ )
{
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
index c7e4818da..b7ebb756a 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
@@ -814,6 +814,24 @@ Bool OptionPreferences::getWorkersReturnToSupply(void)
return stricmp(it->second.str(), "yes") == 0;
}
+Bool OptionPreferences::getAlwaysShowWaypointLines(void)
+{
+ OptionPreferences::const_iterator it = find("AlwaysShowWaypointLines");
+ if (it == end())
+ return TheGlobalData->m_alwaysShowWaypointLines;
+
+ return stricmp(it->second.str(), "yes") == 0;
+}
+
+Bool OptionPreferences::getDetailedBuildTooltips(void)
+{
+ OptionPreferences::const_iterator it = find("DetailedBuildTooltips");
+ if (it == end())
+ return TheGlobalData->m_detailedBuildTooltips;
+
+ return stricmp(it->second.str(), "yes") == 0;
+}
+
Int OptionPreferences::getTextureReduction(void)
{
OptionPreferences::const_iterator it = find("TextureReduction");
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
index e0bc831d3..c4e3668a6 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
@@ -2638,6 +2638,9 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
case GameMessage::MSG_META_SHORTCUT_SLOT06:
case GameMessage::MSG_META_SHORTCUT_SLOT07:
case GameMessage::MSG_META_SHORTCUT_SLOT08:
+ case GameMessage::MSG_META_SHORTCUT_SLOT09:
+ case GameMessage::MSG_META_SHORTCUT_SLOT10:
+ case GameMessage::MSG_META_SHORTCUT_SLOT11:
{
// the general's power shortcut bar, one key per visible button
TheControlBar->pressSpecialPowerShortcut( t - GameMessage::MSG_META_SHORTCUT_SLOT01 );
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
index a728da07c..929251bad 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp
@@ -162,6 +162,9 @@ static const LookupListRec GameMessageMetaTypeNames[] =
{ "SHORTCUT_SLOT06", GameMessage::MSG_META_SHORTCUT_SLOT06 },
{ "SHORTCUT_SLOT07", GameMessage::MSG_META_SHORTCUT_SLOT07 },
{ "SHORTCUT_SLOT08", GameMessage::MSG_META_SHORTCUT_SLOT08 },
+ { "SHORTCUT_SLOT09", GameMessage::MSG_META_SHORTCUT_SLOT09 },
+ { "SHORTCUT_SLOT10", GameMessage::MSG_META_SHORTCUT_SLOT10 },
+ { "SHORTCUT_SLOT11", GameMessage::MSG_META_SHORTCUT_SLOT11 },
{ "SELECT_HERO", GameMessage::MSG_META_SELECT_HERO },
{ "SELECT_ALL", GameMessage::MSG_META_SELECT_ALL },
{ "SELECT_ALL_AIRCRAFT", GameMessage::MSG_META_SELECT_ALL_AIRCRAFT },
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp
index cb6dd3abf..cae10ae50 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp
@@ -188,7 +188,10 @@ void W3DWaypointBuffer::drawWaypoints(RenderInfoClass &rinfo)
- if( TheInGameUI->isInWaypointMode() )
+ // AlwaysShowWaypointLines: retail only draws the queued path while the waypoint key is held,
+ // so you cannot see an order you already gave. With this on, any selected unit that still has
+ // a goal path left shows it.
+ if( TheInGameUI->isInWaypointMode() || TheGlobalData->m_alwaysShowWaypointLines )
{
//Create a default light environment with no lights and only full ambient.
//@todo: Fix later by copying default scene light environement from W3DScene.cpp.