Skip to content

feat(gui): Add replay dates to replay list in Replay Menu#2255

Merged
xezon merged 9 commits intoTheSuperHackers:mainfrom
Caball009:feat_date_listed_replays
Feb 8, 2026
Merged

feat(gui): Add replay dates to replay list in Replay Menu#2255
xezon merged 9 commits intoTheSuperHackers:mainfrom
Caball009:feat_date_listed_replays

Conversation

@Caball009
Copy link

@Caball009 Caball009 commented Feb 4, 2026

This PR switches the column widths of the time and version columns for listed replays, because the latter is wider. This provides enough space to display both time and date in the second column.

We should sort the replays by date instead of name, but that's outside the scope of this PR.

TODO:

  • Replicate in Generals.

@Caball009 Caball009 added Enhancement Is new feature or request GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker labels Feb 4, 2026
@greptile-apps
Copy link

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

Updates the replay menu to display both time and date for replay files instead of only the time. The version column and time/date column widths are swapped because the version string is wider, providing enough space to display the full date-time information without line breaks. Changes are identical in both Generals and GeneralsMD codebases as expected.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Changes are straightforward UI improvements that display additional information (date alongside time) and adjust column widths accordingly. The implementation correctly uses existing helper functions (getUnicodeTimeBuffer and getUnicodeDateBuffer) and includes proper null-safety checks before manipulating column widths. Code is identical between Generals and GeneralsMD as required by contribution guidelines.
  • No files require special attention

Important Files Changed

Filename Overview
Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp Displays date and time in replay list, swaps column widths to accommodate longer date-time strings
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp Displays date and time in replay list, swaps column widths to accommodate longer date-time strings

Sequence Diagram

sequenceDiagram
    participant User
    participant ReplayMenuInit
    participant ListboxData
    participant PopulateReplayFileListbox
    participant getUnicodeTimeBuffer
    participant getUnicodeDateBuffer
    participant GadgetListBoxAddEntryText

    User->>ReplayMenuInit: Initialize replay menu
    ReplayMenuInit->>ListboxData: Get listbox user data
    Note over ReplayMenuInit,ListboxData: Check if columns == 4 and<br/>columnWidth[1] < columnWidth[2]
    ReplayMenuInit->>ListboxData: Swap columnWidth[1] and columnWidth[2]
    ReplayMenuInit->>PopulateReplayFileListbox: Populate replay files
    loop For each replay file
        PopulateReplayFileListbox->>getUnicodeTimeBuffer: Get time string from header.timeVal
        getUnicodeTimeBuffer-->>PopulateReplayFileListbox: Return time string
        PopulateReplayFileListbox->>getUnicodeDateBuffer: Get date string from header.timeVal
        getUnicodeDateBuffer-->>PopulateReplayFileListbox: Return date string
        Note over PopulateReplayFileListbox: Format: "%s %s"<br/>(time + space + date)
        PopulateReplayFileListbox->>GadgetListBoxAddEntryText: Add replay name to column 0
        PopulateReplayFileListbox->>GadgetListBoxAddEntryText: Add date-time to column 1
        PopulateReplayFileListbox->>GadgetListBoxAddEntryText: Add version to column 2
        PopulateReplayFileListbox->>GadgetListBoxAddEntryText: Add map info to column 3
    end
    ReplayMenuInit-->>User: Display replay list with date and time
Loading

@xezon
Copy link

xezon commented Feb 4, 2026

How does it look? Would it have enough room for date and time?

@Caball009
Copy link
Author

Caball009 commented Feb 4, 2026

image

Maybe there would be enough space for both in a single column for this resolution (1920 * 1080), but I'm not sure if that's true for all resolutions. The save games have a separate column for date and time. I'm guessing we can't just add another column without modifying the window files.

Edit: I can do some tests at different resolutions putting date and time in the same column for now.

@xezon
Copy link

xezon commented Feb 4, 2026

Yes check how it looks. Judging by the Replay Name and Map Name columns, it looks like it is possible to set them to word wrap or not word wrap. I wonder what the time column is set to.

@Caball009
Copy link
Author

Caball009 commented Feb 4, 2026

FWIW, the version column is slightly wider than the time column. If we switch them around, there's enough space for time + date.

The only resolution that uses a line break for time + date is 800 * 600 AFAICS, otherwise it looks like this:
image

@xezon
Copy link

xezon commented Feb 4, 2026

Ok it's not bad. Are we OK with changing the order? It is quite a big change. Also we need to consider, that Community Projects may write longer Version Names in there.

How does it look with time date in original column?

@Caball009
Copy link
Author

With 24 hour format, you need at least 1366 * 768 to avoid a line break. With 12 hour format, there can be a line break even at 1920 * 1080.

1366 * 768:

image

1920 * 1080:

image

@xezon
Copy link

xezon commented Feb 7, 2026

You can hack the Column widths in Code, then we do not need to update the WND right now.

We do have macro ENABLE_GUI_HACKS for this. Try use that to swap the width of the columns if Column 2 is smaller than Column 3.

@Caball009 Caball009 changed the title feat(gui): Show date instead of time for listed replays feat(gui): Show time and date for listed replays Feb 8, 2026
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

Code looks good. Needs to be replicated to Generals.

@Caball009
Copy link
Author

Added comment and replicated in Generals.

@xezon xezon added Gen Relates to Generals ZH Relates to Zero Hour labels Feb 8, 2026
@xezon
Copy link

xezon commented Feb 8, 2026

Can you make a follow up change to this where you make an alternative code path for a 5th column where time and date are separated like in the saveload screen? Then a new ReplayMenu.WND edit can add the fifth column.

@xezon xezon changed the title feat(gui): Show time and date for listed replays feat(gui): Add replay dates to replay list in Replay Menu Feb 8, 2026
@Caball009
Copy link
Author

Can you make a follow up change to this where you make an alternative code path for a 5th column where time and date are separated like in the saveload screen? Then a new ReplayMenu.WND edit can add the fifth column.

Yeah, can do that.

We anticipate 5 columns with column 2 for the time and column 3 for the date? Would it go behind ! ENABLE_GUI_HACKS?

@xezon
Copy link

xezon commented Feb 8, 2026

Yeah, can do that.

We anticipate 5 columns with column 2 for the time and column 3 for the date? Would it go behind ! ENABLE_GUI_HACKS?

Basically if columnCount == 4 then do the current stuff, if columnCount == 5, split time and date column into 2 separate columns.

@xezon xezon merged commit fa9345a into TheSuperHackers:main Feb 8, 2026
25 checks passed
@Caball009 Caball009 deleted the feat_date_listed_replays branch February 8, 2026 22:22
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