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

Adds a Money Per Minute column to the observer Player Info List in both Generals and Zero Hour, gated behind the existing ShowMoneyPerMinute global flag. The column is fully skipped during both layout and drawing when the flag is off, so there is no visual or performance regression for players who keep the default setting.

  • New LabelType_MoneyPerMinute / ValueType_MoneyPerMinute enum entries are inserted in the correct position between Money and Rank; LastValues.values[LabelType_Count] automatically grows with the enum and currentValues[] is updated to match, so the change/dirty-tracking logic remains consistent.
  • When showMoneyPerMinute is false the MoneyPerMinute column is skipped in the label-layout loop (so labelX advances correctly) and in the draw loop, with labelWidths/columnLabelX for that slot left unread — no uninitialized-read risk.
  • The implementation is symmetrically applied to both the Generals/ and GeneralsMD/ trees with no divergence.

Confidence Score: 5/5

Safe to merge — the change is additive, fully opt-in behind an existing flag, and the column skip logic is applied consistently in both the layout and draw passes for both game variants.

Both the Generals and Zero Hour implementations are symmetric, the enum and array sizing are internally consistent, the currentValues[] array correctly tracks all five columns, and the conditional skip guards are placed on both the label-position and draw loops. No uninitialized reads, no off-by-one risks, and no pre-existing patterns are broken.

No files require special attention.

Important Files Changed

Filename Overview
Generals/Code/GameEngine/Include/GameClient/InGameUI.h Adds LabelType_MoneyPerMinute and ValueType_MoneyPerMinute enum entries in the correct position between Money and Rank; LastValues array size updates automatically via LabelType_Count.
Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp Adds moneyPerMinuteValue computation and wires it into currentValues[], label init, and conditional column skip during layout and draw; logic is correct and lastValues tracking covers all columns regardless of visibility.
GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h Mirror of Generals header change — adds LabelType_MoneyPerMinute and ValueType_MoneyPerMinute with identical placement and correct enum ordering for Zero Hour.
GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp Mirror of Generals .cpp change — identical logic applied to Zero Hour codebase, no discrepancies with the Generals counterpart.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[drawPlayerInfoList] --> B[Read showMoneyPerMinute flag]
    B --> C[For each active player slot]
    C --> D[Get money pointer]
    D --> E[Compute teamValue, moneyValue, moneyPerMinuteValue, rankValue, xpValue]
    E --> F[Update lastValues and display strings for all 5 columns]
    F --> G[Compute maxValueWidths for all columns]
    G --> H{More slots?}
    H -- yes --> C
    H -- no --> I[Layout label columns]
    I --> J{column == MoneyPerMinute?}
    J -- yes, showMoneyPerMinute=false --> K[skip column]
    J -- no or showMoneyPerMinute=true --> L[Set columnLabelX and advance labelX]
    K --> M{More columns?}
    L --> M
    M -- yes --> J
    M -- no --> N[For each row: draw labels and values]
    N --> O{column == MoneyPerMinute?}
    O -- yes, showMoneyPerMinute=false --> P[skip drawing]
    O -- no or showMoneyPerMinute=true --> Q[Draw label and value]
    P --> R{More columns?}
    Q --> R
    R -- yes --> O
    R -- no --> S[Draw player name]
Loading

Reviews (1): 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.

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.

2 participants