Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Generals/Code/GameEngine/Include/GameClient/GadgetListBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ extern void GadgetListboxCreateScrollbar( GameWindow *listbox );
extern void GadgetListBoxAddMultiSelect( GameWindow *listbox );
extern void GadgetListBoxRemoveMultiSelect( GameWindow *listbox );
extern void GadgetListBoxSetListLength( GameWindow *listbox, Int newLength );
extern Int GadgetListBoxGetListLength( GameWindow *listbox );
extern Int GadgetListBoxGetListLength( GameWindow *listbox ); ///< Returns the maximum possible number of list entries. Length is synonymous to rows
extern Int GadgetListBoxGetMaxSelectedLength( GameWindow *listbox ); ///< Returns the maximum possible number of list entries that can be selected
extern Int GadgetListBoxGetNumEntries( GameWindow *listbox );
extern Int GadgetListBoxGetNumColumns( GameWindow *listbox );
extern Int GadgetListBoxGetColumnWidth( GameWindow *listbox, Int column );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ void PopulateReplayFileListbox(GameWindow *listbox)
return;

GadgetListBoxReset(listbox);
const Int listboxLength = GadgetListBoxGetListLength(listbox);

// TheSuperHackers @tweak xezon 08/06/2025 Now shows missing maps in red color.
enum {
Expand Down Expand Up @@ -273,7 +274,6 @@ void PopulateReplayFileListbox(GameWindow *listbox)

TheMapCache->updateCache();


for (it = replayFilenames.begin(); it != replayFilenames.end(); ++it)
{
// just want the filename
Expand Down Expand Up @@ -355,10 +355,15 @@ void PopulateReplayFileListbox(GameWindow *listbox)
mapColor = colors[COLOR_MISSING_MAP_CRC_MISMATCH];
}

Int insertionIndex = GadgetListBoxAddEntryText(listbox, replayNameToShow, color, -1, 0);
const Int insertionIndex = GadgetListBoxAddEntryText(listbox, replayNameToShow, color, -1, 0);
DEBUG_ASSERTCRASH(insertionIndex >= 0, ("Expects valid index"));
GadgetListBoxAddEntryText(listbox, displayTimeBuffer, color, insertionIndex, 1);
GadgetListBoxAddEntryText(listbox, header.versionString, color, insertionIndex, 2);
GadgetListBoxAddEntryText(listbox, mapStr, mapColor, insertionIndex, 3);

// TheSuperHackers @performance Now stops processing when the list is full.
if (insertionIndex == listboxLength - 1)
break;
}
}
GadgetListBoxSetSelected(listbox, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2576,21 +2576,24 @@ void GadgetListBoxSetListLength( GameWindow *listbox, Int newLength )

}

// GadgetListBoxGetListLength =================================================
/** Get the list length data contained in the listboxData
* parameter. */
//=============================================================================
Int GadgetListBoxGetListLength( GameWindow *listbox )
{
ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
if (listboxData->multiSelect)
{
if (listboxData)
return listboxData->listLength;
}
else
{
return 1;
}

return 0;
}

//=============================================================================
Int GadgetListBoxGetMaxSelectedLength( GameWindow *listbox )
{
ListboxData *listboxData = (ListboxData *)listbox->winGetUserData();
if (listboxData)
return listboxData->multiSelect ? listboxData->listLength : 1;

return 0;
}

// GadgetListBoxGetNumEntries =================================================
Expand Down
Loading
Loading