feat(gui): Add replay dates to replay list in Replay Menu#2255
feat(gui): Add replay dates to replay list in Replay Menu#2255xezon merged 9 commits intoTheSuperHackers:mainfrom
Conversation
Greptile Overview
|
| 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
|
How does it look? Would it have enough room for date and time? |
|
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. |
|
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? |
|
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. |
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Show resolved
Hide resolved
xezon
left a comment
There was a problem hiding this comment.
Code looks good. Needs to be replicated to Generals.
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ReplayMenu.cpp
Show resolved
Hide resolved
|
Added comment and replicated in Generals. |
|
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 |
Basically if columnCount == 4 then do the current stuff, if columnCount == 5, split time and date column into 2 separate columns. |




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: