Allow players locked to unplayable factions in the lobby
This commit is contained in:
@@ -144,8 +144,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
colorPreview = lobby.Get<ColorPreviewManagerWidget>("COLOR_MANAGER");
|
colorPreview = lobby.Get<ColorPreviewManagerWidget>("COLOR_MANAGER");
|
||||||
colorPreview.Color = Game.Settings.Player.Color;
|
colorPreview.Color = Game.Settings.Player.Color;
|
||||||
|
|
||||||
foreach (var c in modRules.Actors["world"].Traits.WithInterface<CountryInfo>().Where(c => c.Selectable))
|
foreach (var c in modRules.Actors["world"].Traits.WithInterface<CountryInfo>())
|
||||||
countries.Add(c.Race, new LobbyCountry { Name = c.Name, Side = c.Side, Description = c.Description });
|
countries.Add(c.Race, new LobbyCountry { Selectable = c.Selectable, Name = c.Name, Side = c.Side, Description = c.Description });
|
||||||
|
|
||||||
var gameStarting = false;
|
var gameStarting = false;
|
||||||
Func<bool> configurationDisabled = () => !Game.IsHost || gameStarting ||
|
Func<bool> configurationDisabled = () => !Game.IsHost || gameStarting ||
|
||||||
@@ -829,6 +829,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
public class LobbyCountry
|
public class LobbyCountry
|
||||||
{
|
{
|
||||||
|
public bool Selectable;
|
||||||
public string Name;
|
public string Name;
|
||||||
public string Description;
|
public string Description;
|
||||||
public string Side;
|
public string Side;
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
return item;
|
return item;
|
||||||
};
|
};
|
||||||
|
|
||||||
var options = countries.GroupBy(c => c.Value.Side).ToDictionary(g => g.Key ?? "", g => g.Select(c => c.Key));
|
var options = countries.Where(c => c.Value.Selectable).GroupBy(c => c.Value.Side)
|
||||||
|
.ToDictionary(g => g.Key ?? "", g => g.Select(c => c.Key));
|
||||||
|
|
||||||
dropdown.ShowDropDown("RACE_DROPDOWN_TEMPLATE", 150, options, setupItem);
|
dropdown.ShowDropDown("RACE_DROPDOWN_TEMPLATE", 150, options, setupItem);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user