Skip to content

Commit

Permalink
Merge branch 'develop' into yr/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBartlett committed Feb 19, 2025
2 parents 4163026 + 4498520 commit b81084f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ protected void ListMaps()
var isFavoriteMapsSelected = IsFavoriteMapsSelected();
var maps = GetSortedGameModeMaps();

bool gameModeMapChanged = false;

for (int i = 0; i < maps.Count; i++)
{
var gameModeMap = maps[i];
Expand Down Expand Up @@ -587,11 +589,17 @@ protected void ListMaps()

// Preserve the selected map
if (gameModeMap == GameModeMap)
{
mapIndex = i - skippedMapsCount;
gameModeMapChanged = false;
}

// Preserve the selected map, even if the game mode has changed
if (mapIndex == -1 && (gameModeMap?.Map?.Equals(GameModeMap?.Map) ?? false))
{
mapIndex = i - skippedMapsCount;
gameModeMapChanged = true;
}
}

if (mapIndex > -1)
Expand All @@ -602,8 +610,10 @@ protected void ListMaps()
}

lbGameModeMapList.SelectedIndexChanged += LbGameModeMapList_SelectedIndexChanged;

// Trigger the event manually to update GameModeMap
LbGameModeMapList_SelectedIndexChanged();
if (gameModeMapChanged)
LbGameModeMapList_SelectedIndexChanged();
}

protected abstract int GetDefaultMapRankIndex(GameModeMap gameModeMap);
Expand Down

0 comments on commit b81084f

Please sign in to comment.