Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomize all maps when there is only one player #583

Merged
merged 2 commits into from
Dec 6, 2024
Merged
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
6 changes: 6 additions & 0 deletions DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,12 @@

private List<Map> GetMapList(int playerCount)
{
if (playerCount == 1)
{
List<Map> allMaps = GameMode?.Maps.ToList() ?? new List<Map>();
return allMaps;
}
SadPencil marked this conversation as resolved.
Show resolved Hide resolved

List<Map> mapList = (GameMode?.Maps.Where(x => x.MaxPlayers == playerCount) ?? Array.Empty<Map>()).ToList();
if (mapList.Count < 1 && playerCount <= MAX_PLAYER_COUNT)
return GetMapList(playerCount + 1);
Expand Down Expand Up @@ -771,7 +777,7 @@

protected void AddSideToDropDown(XNADropDown dd, string name, string? uiName = null, Texture2D? texture = null)
{
XNADropDownItem item = new()

Check warning on line 780 in DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs

View workflow job for this annotation

GitHub Actions / build-clients (Ares)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 780 in DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs

View workflow job for this annotation

GitHub Actions / build-clients (Ares)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 780 in DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs

View workflow job for this annotation

GitHub Actions / build-clients (TS)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 780 in DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs

View workflow job for this annotation

GitHub Actions / build-clients (TS)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 780 in DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs

View workflow job for this annotation

GitHub Actions / build-clients (YR)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.

Check warning on line 780 in DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs

View workflow job for this annotation

GitHub Actions / build-clients (YR)

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
Text = uiName ?? name.L10N($"INI:Sides:{name}"),
Tag = name,
Expand Down
Loading