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
13 changes: 8 additions & 5 deletions Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,8 +1163,12 @@ void RefreshGameListBox(GameWindow* win, Bool showMap)
pLobbyInterface->SearchForLobbies(
[=]()
{
win->winEnable(false);
GadgetListBoxAddEntryText(win, UnicodeString(L"Searching for public lobbies..."), GameMakeColor(255, 194, 15, 255), -1, -1);
win->winEnable(true);
if (GadgetListBoxGetNumEntries(win) == 0)
{
GadgetListBoxAddEntryText(win, UnicodeString(L"Searching for public lobbies..."), GameMakeColor(255, 194, 15, 255), -1, -1);
GadgetListBoxSetSelected(win, -1);
}
},
[=](std::vector<LobbyEntry> vecLobbies)
{
Expand All @@ -1173,11 +1177,10 @@ void RefreshGameListBox(GameWindow* win, Bool showMap)

size_t numResults = vecLobbies.size();

GadgetListBoxReset(win);
if (numResults == 0)
{
win->winEnable(false);
GadgetListBoxAddEntryText(win, UnicodeString(L"No lobbies were found"), GameMakeColor(255, 194, 15, 255), -1, -1);
GadgetListBoxSetSelected(win, -1);

}
else
Expand All @@ -1196,8 +1199,8 @@ void RefreshGameListBox(GameWindow* win, Bool showMap)
vecLobbies = filtered;
if (vecLobbies.empty())
{
win->winEnable(false);
GadgetListBoxAddEntryText(win, UnicodeString(L"No lobbies currently match this filter"), GameMakeColor(255, 194, 15, 255), -1, -1);
GadgetListBoxSetSelected(win, -1);
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ static void drawListBoxText( GameWindow *window, WinInstanceData *instData,
IRegion2D clipRegion;
ICoord2D start, end;

Color WindowBg = TheWindowManager->winMakeColor(3, 93, 166, 20);
TheWindowManager->winFillRect(WindowBg, WIN_DRAW_LINE_WIDTH, x, y, x + width, y + height);

//
// save the clipping information region cause we're going to use it here
// in drawing the text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2327,7 +2327,8 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg,
if ( controlID == GetGameListBoxID() )
{
int rowSelected = mData2;
if( rowSelected >= 0 )
Int lobbyID = rowSelected >= 0 ? (Int)GadgetListBoxGetItemData(control, rowSelected, 0) : 0;
if( lobbyID > 0 )
{
buttonJoin->winEnable(TRUE);
static UnsignedInt lastFrame = 0;
Expand All @@ -2336,7 +2337,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg,

PeerRequest req;
req.peerRequestType = PeerRequest::PEERREQUEST_GETEXTENDEDSTAGINGROOMINFO;
req.stagingRoom.id = (Int)GadgetListBoxGetItemData(control, rowSelected, 0);
req.stagingRoom.id = lobbyID;

if (lastID != req.stagingRoom.id || now > lastFrame + 60)
{
Expand Down Expand Up @@ -2411,7 +2412,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg,
if (selected >= 0)
{
Int selectedID = (Int)GadgetListBoxGetItemData(GetGameListBox(), selected);
if (selectedID >= 0)
if (selectedID > 0)
{
auto Lobby = pLobbyInterface->GetLobbyFromID(selectedID);

Expand Down
Loading