Skip to content

tweak(gui): Show Money Per Minute in Player Info List#2738

Open
L3-M wants to merge 1 commit into
TheSuperHackers:mainfrom
L3-M:L3-M/money-obs
Open

tweak(gui): Show Money Per Minute in Player Info List#2738
L3-M wants to merge 1 commit into
TheSuperHackers:mainfrom
L3-M:L3-M/money-obs

Conversation

@L3-M
Copy link
Copy Markdown

@L3-M L3-M commented May 20, 2026

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

shot_full

@L3-M L3-M self-assigned this May 20, 2026
@L3-M L3-M added Enhancement Is new feature or request GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels May 20, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 20, 2026

Greptile Summary

This PR adds a Money Per Minute column to the Player Info List HUD overlay visible to match observers in both Generals and Zero Hour. The new column is gated behind the existing ShowMoneyPerMinute setting to preserve the original Gentool layout for users who prefer it.

  • Adds LabelType_MoneyPerMinute / ValueType_MoneyPerMinute enum entries in both Generals and GeneralsMD header files, updating array sizes and label initialization accordingly.
  • Extends drawPlayerInfoList() in both game variants to read getCashPerMinute() from the player's Money object and format it via the existing formatIncomeValue() helper, while guarding layout and draw loops with showMoneyPerMinute checks so hidden columns don't consume screen space.

Confidence Score: 5/5

Safe to merge — the change is additive, gated by an existing feature flag, and re-uses the already-tested getCashPerMinute / formatIncomeValue path.

The new enum values correctly extend array sizes derived from LabelType_Count / ValueType_Count, so no out-of-bounds accesses are introduced. The skip guards in the layout and draw loops are symmetric, preventing hidden columns from affecting spacing. The Money Per Minute value is fetched and formatted through the same helpers already used elsewhere in the file. Changes are faithfully mirrored between Generals and GeneralsMD.

No files require special attention.

Important Files Changed

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
Loading

Reviews (2): Last reviewed commit: "tweak(gui): Show Money Per Minute in Pla..." | Re-trigger Greptile

@xezon
Copy link
Copy Markdown

xezon commented May 20, 2026

It would be nice if the $/min was more concise, but it is tricky. Chat Gippy brainstorms:

Some compact alternatives to $/min depending on the style you want:

  • $9999 +5555/m
  • $9999 (+5555)
  • $9999 ↑5555
  • $9999 · 5555/m
  • $9999 @5555/m
  • $9999 | +5555
  • $9999 ⟲5555
  • $9999 ⧖5555
  • $9999 ⌁5555/m

If this is for a game UI, these are common readable patterns:

  • $9999 (+5555) — very common in strategy/idler games
  • $9999 +5555/m — concise but explicit
  • $9999 ↑5555 — minimal and visually clean
  • $9999 5555/min — if the currency symbol already implies money

You could also abbreviate the unit:

  • /m = per minute
  • pm = per minute
  • m⁻¹ = more technical/scientific
  • ⟂m / icons = stylized UI approach

For very compact HUDs:

  • $9.9k +5.5k
  • $9.9k ⬆5.5k
  • $9.9k (5.5k/m)

If you want, I can also suggest:

  • RTS-style UI variants
  • mobile-friendly variants
  • sci-fi/fantasy themed notation
  • ultra-minimal icon-based versions
  • typography/layout ideas for aligning the numbers cleanly

@L3-M
Copy link
Copy Markdown
Author

L3-M commented May 20, 2026

Yeah. $/min is very long compared to other labels ( 5 characters vs 2 or 1 ) but on the other hand perhaps it is the clearest on what this value is.

I think +5500 is good.

@githubawn
Copy link
Copy Markdown

image

What about adding a header row? That would slightly save some screen space (or at least less repeating of information), which gives us one less reason to hide it behind a toggle option.

Something like:
Team | Float | $/min | Rank | XP | Name

@xezon
Copy link
Copy Markdown

xezon commented May 23, 2026

Header row would save horizontal space, but then the values would look pretty dense, and it may be more difficult to read.

Perhaps rename $/min to +, and use the same value formatting as on the Control Bar (+18k). That way the user can imply the meaning (+cash/min) more easily.

@L3-M L3-M force-pushed the L3-M/money-obs branch from 93169dd to 41474dd Compare May 27, 2026 11:23
playerInfoListValue.format(L"%u", currentValues[column]);
if (column == PlayerInfoList::ValueType_MoneyPerMinute)
{
playerInfoListValue = formatIncomeValue(currentValues[column]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

if (!showMoneyPerMinute)
  continue

?

Int labelX = baseX;
for (column = 0; column < PlayerInfoList::LabelType_Count; ++column)
{
if (!showMoneyPerMinute && column == PlayerInfoList::LabelType_MoneyPerMinute)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I suggest test the column first, because !showMoneyPerMinute can always be true and then it takes 2 tests often.

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

Labels

Enhancement Is new feature or request Gen Relates to Generals GUI For graphical user interface 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