tweak(gui): Show Money Per Minute in Player Info List#2738
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/GameClient/InGameUI.h | Adds LabelType_MoneyPerMinute and ValueType_MoneyPerMinute enum values; LastValues array and display string arrays are correctly sized by LabelType_Count / ValueType_Count. |
| Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp | Extends drawPlayerInfoList() to populate moneyPerMinuteValue via the existing getCashPerMinute() / formatIncomeValue() path; skip guards correctly prevent hidden column from affecting layout or draw. |
| GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h | Mirror of the Generals header change — enum additions and array sizing are consistent. |
| GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp | Mirror of the Generals source change — identical logic for Zero Hour; no divergence from the Generals implementation. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[drawPlayerInfoList called] --> B[Read showMoneyPerMinute flag]
B --> C[Loop over player slots]
C --> D[Get player Money object]
D --> E[countMoney → moneyValue]
D --> F[getCashPerMinute → moneyPerMinuteValue]
E --> G[Build currentValues array team, money, moneyPerMinute, rank, xp]
F --> G
G --> H{column == ValueType_MoneyPerMinute?}
H -- yes --> I[formatIncomeValue → formatted string]
H -- no --> J[format as plain integer]
I --> K[Update DisplayString and lastValues cache]
J --> K
K --> L[Measure maxValueWidths for all columns]
L --> M[Label layout loop]
M --> N{showMoneyPerMinute?}
N -- no --> O[Skip MoneyPerMinute column]
N -- yes --> P[Set columnLabelX, advance labelX]
O --> Q[Draw loop per row]
P --> Q
Q --> R{showMoneyPerMinute?}
R -- no --> S[Skip draw for MoneyPerMinute]
R -- yes --> T[Draw label + value at columnLabelX]
S --> U[Draw name column]
T --> U
Reviews (2): Last reviewed commit: "tweak(gui): Show Money Per Minute in Pla..." | Re-trigger Greptile
|
It would be nice if the $/min was more concise, but it is tricky. Chat Gippy brainstorms: Some compact alternatives to
If this is for a game UI, these are common readable patterns:
You could also abbreviate the unit:
For very compact HUDs:
If you want, I can also suggest:
|
|
Yeah. I think +5500 is good. |
|
Header row would save horizontal space, but then the values would look pretty dense, and it may be more difficult to read. Perhaps rename |
| playerInfoListValue.format(L"%u", currentValues[column]); | ||
| if (column == PlayerInfoList::ValueType_MoneyPerMinute) | ||
| { | ||
| playerInfoListValue = formatIncomeValue(currentValues[column]); |
There was a problem hiding this comment.
Because why set text when it is not shown?
| Int labelX = baseX; | ||
| for (column = 0; column < PlayerInfoList::LabelType_Count; ++column) | ||
| { | ||
| if (!showMoneyPerMinute && column == PlayerInfoList::LabelType_MoneyPerMinute) |
There was a problem hiding this comment.
I suggest test the column first, because !showMoneyPerMinute can always be true and then it takes 2 tests often.
I’d agree, not only to reduce clutter but right now it’s not immediately clear that the first column is team (T0 means team zero which means FFA? Unclear) and it’s also not clear that * refers to generals rank. This stuff will be obvious to veterans of the game but not to new players. |
|
Can you show mockup how it looks? |
|
Perhaps something like this. Edit: The star (unicode) should actually be grey Here's the PSD (I used Photopea) |
|
Aha so you want a header row in addition to the column cell prefixes. |
|
Prefixes are not needed with header row - saves a few characters
The light gray of the header is insufficient readable against the background. |
|
My main ask for when you go with a header row is to make the separation of the columns clear. Originally this was clear with the grey column value prefix characters. I would leave the current iteration as is. |


This change show Money Per Minute in Player Info List for match Observers in Generals and Zero Hour.
It is only shown when
ShowMoneyPerMinute = yesbecause some players may prefer the original Gentool replication or because the extra column takes additional space now.