Skip to content

Commit 3161971

Browse files
committed
tweak(gui): Configure player money per minute in GameData
1 parent 8d675a8 commit 3161971

File tree

6 files changed

+22
-4
lines changed

6 files changed

+22
-4
lines changed

Generals/Code/GameEngine/Include/Common/GlobalData.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ class GlobalData : public SubsystemInterface
410410

411411
// TheSuperHackers @feature L3-M 21/08/2025 toggle the money per minute display, false shows only the original current money
412412
Bool m_showMoneyPerMinute;
413+
Bool m_allowMoneyPerMinuteForPlayer;
413414

414415
Real m_shakeSubtleIntensity; ///< Intensity for shaking a camera with SHAKE_SUBTLE
415416
Real m_shakeNormalIntensity; ///< Intensity for shaking a camera with SHAKE_NORMAL

Generals/Code/GameEngine/Source/Common/GlobalData.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,11 @@ GlobalData* GlobalData::m_theOriginal = NULL;
442442

443443
{ "CameraAudibleRadius", INI::parseReal, NULL, offsetof( GlobalData, m_cameraAudibleRadius ) },
444444
{ "GroupMoveClickToGatherAreaFactor", INI::parseReal, NULL, offsetof( GlobalData, m_groupMoveClickToGatherFactor ) },
445+
446+
#if !PRESERVE_RETAIL_BEHAVIOR
447+
{ "AllowMoneyPerMinuteForPlayer", INI::parseBool, NULL, offsetof( GlobalData, m_allowMoneyPerMinuteForPlayer ) },
448+
#endif
449+
445450
{ "ShakeSubtleIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeSubtleIntensity ) },
446451
{ "ShakeNormalIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeNormalIntensity ) },
447452
{ "ShakeStrongIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeStrongIntensity ) },
@@ -943,6 +948,7 @@ GlobalData::GlobalData()
943948
m_gameTimeFontSize = 8;
944949

945950
m_showMoneyPerMinute = FALSE;
951+
m_allowMoneyPerMinuteForPlayer = FALSE;
946952

947953
m_debugShowGraphicalFramerate = FALSE;
948954

Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,8 +1880,10 @@ void InGameUI::update( void )
18801880
if( moneyPlayer)
18811881
{
18821882
Money *money = moneyPlayer->getMoney();
1883-
Bool showIncome = TheGlobalData->m_showMoneyPerMinute;
1884-
if (!showIncome)
1883+
Bool wantShowIncome = TheGlobalData->m_showMoneyPerMinute;
1884+
Bool canShowIncome = TheGlobalData->m_allowMoneyPerMinuteForPlayer || TheControlBar->isObserverControlBarOn();
1885+
Bool doShowIncome = wantShowIncome && canShowIncome;
1886+
if (!doShowIncome)
18851887
{
18861888
UnsignedInt currentMoney = money->countMoney();
18871889
if( lastMoney != currentMoney )

GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ class GlobalData : public SubsystemInterface
417417

418418
// TheSuperHackers @feature L3-M 21/08/2025 toggle the money per minute display, false shows only the original current money
419419
Bool m_showMoneyPerMinute;
420+
Bool m_allowMoneyPerMinuteForPlayer;
420421

421422
Real m_shakeSubtleIntensity; ///< Intensity for shaking a camera with SHAKE_SUBTLE
422423
Real m_shakeNormalIntensity; ///< Intensity for shaking a camera with SHAKE_NORMAL

GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,11 @@ GlobalData* GlobalData::m_theOriginal = NULL;
442442

443443
{ "CameraAudibleRadius", INI::parseReal, NULL, offsetof( GlobalData, m_cameraAudibleRadius ) },
444444
{ "GroupMoveClickToGatherAreaFactor", INI::parseReal, NULL, offsetof( GlobalData, m_groupMoveClickToGatherFactor ) },
445+
446+
#if !PRESERVE_RETAIL_BEHAVIOR
447+
{ "AllowMoneyPerMinuteForPlayer", INI::parseBool, NULL, offsetof( GlobalData, m_allowMoneyPerMinuteForPlayer ) },
448+
#endif
449+
445450
{ "ShakeSubtleIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeSubtleIntensity ) },
446451
{ "ShakeNormalIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeNormalIntensity ) },
447452
{ "ShakeStrongIntensity", INI::parseReal, NULL, offsetof( GlobalData, m_shakeStrongIntensity ) },
@@ -952,6 +957,7 @@ GlobalData::GlobalData()
952957
m_gameTimeFontSize = 8;
953958

954959
m_showMoneyPerMinute = FALSE;
960+
m_allowMoneyPerMinuteForPlayer = FALSE;
955961

956962
m_debugShowGraphicalFramerate = FALSE;
957963

GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,8 +1936,10 @@ void InGameUI::update( void )
19361936
if( moneyPlayer)
19371937
{
19381938
Money *money = moneyPlayer->getMoney();
1939-
Bool showIncome = TheGlobalData->m_showMoneyPerMinute;
1940-
if (!showIncome)
1939+
Bool wantShowIncome = TheGlobalData->m_showMoneyPerMinute;
1940+
Bool canShowIncome = TheGlobalData->m_allowMoneyPerMinuteForPlayer || TheControlBar->isObserverControlBarOn();
1941+
Bool doShowIncome = wantShowIncome && canShowIncome;
1942+
if (!doShowIncome)
19411943
{
19421944
UnsignedInt currentMoney = money->countMoney();
19431945
if( lastMoney != currentMoney )

0 commit comments

Comments
 (0)