-
Notifications
You must be signed in to change notification settings - Fork 119
tweak(gui): Configure player money per minute in GameData #1914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| { | ||
| Money *money = moneyPlayer->getMoney(); | ||
| Bool showIncome = TheGlobalData->m_showMoneyPerMinute; | ||
| Bool showIncome = TheGlobalData->m_showMoneyPerMinute && TheGlobalData->m_enablePlayerMoneyPerMinute; |
There was a problem hiding this comment.
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.
6486d37 to
d060937
Compare
|
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; |
There was a problem hiding this comment.
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 ) }, |
There was a problem hiding this comment.
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 ) },
#endifOtherwise 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); |
There was a problem hiding this comment.
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
}
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 inGameData.ini.