Skip to content

Conversation

@L3-M
Copy link

@L3-M L3-M commented Nov 26, 2025

This change implements a GameData.ini option to enable or disable Money Per Minute for Players in Generals and Zero Hour.

The new option is EnablePlayerMoneyPerMinute, which is disabled by default and can be set to yes/no in GameData.ini.

@L3-M L3-M self-assigned this Nov 26, 2025
@L3-M L3-M added Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Nov 26, 2025
{
Money *money = moneyPlayer->getMoney();
Bool showIncome = TheGlobalData->m_showMoneyPerMinute;
Bool showIncome = TheGlobalData->m_showMoneyPerMinute && TheGlobalData->m_enablePlayerMoneyPerMinute;
Copy link

@xezon xezon Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok to show income as Observer.

It's not ok to show income as Player with PRESERVE_RETAIL_BEHAVIOR.

@L3-M L3-M force-pushed the L3-M/money-gamedata branch from 6486d37 to d060937 Compare November 26, 2025 16:18
@Mauller
Copy link

Mauller commented Nov 26, 2025

is the new variable really necessary when you already have m_showMoneyPerMinute?

@xezon
Copy link

xezon commented Nov 26, 2025

is the new variable really necessary when you already have m_showMoneyPerMinute?

I think it is, because m_showMoneyPerMinute is a user setting and the other is mod setting.

m_gameTimeFontSize = 8;

m_showMoneyPerMinute = FALSE;
m_enablePlayerMoneyPerMinute = FALSE;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better name this "allowMoneyPerMinuteForPlayer" instead of "enable" to somewhat clarify that this is a restriction, and not a plain enable. The "show" effectively enables it user facing in the end, together with the lifted restriction.

{ "CameraAudibleRadius", INI::parseReal, NULL, offsetof( GlobalData, m_cameraAudibleRadius ) },
{ "GroupMoveClickToGatherAreaFactor", INI::parseReal, NULL, offsetof( GlobalData, m_groupMoveClickToGatherFactor ) },

{ "EnablePlayerMoneyPerMinute", INI::parseBool, NULL, offsetof( GlobalData, m_enablePlayerMoneyPerMinute ) },
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if !PRESERVE_RETAIL_BEHAVIOR
{ "EnablePlayerMoneyPerMinute",	INI::parseBool,				NULL,			offsetof( GlobalData, m_enablePlayerMoneyPerMinute ) },
#endif

Otherwise players can enable this in GameData.ini and play against Retail players (remember, ZH Network Lobby does not check INI mismatch).

{
UnicodeString buffer;
UnicodeString moneyStr = formatMoneyValue(currentMoney);
UnicodeString incomeStr = formatIncomeValue(cashPerMin);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you swapped the scope bodies, which makes the diff look unpleasant.

Instead of swapping the bodies, you can also do

Bool doShowIncome = wantShowIncome && canShowIncome;
if (!doShowIncome)
{
  // ... classic code
}
else
{
  // ... new code
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants