Disable slot admin dropdown when empty.
This commit is contained in:
@@ -190,8 +190,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var slotsButton = lobby.GetOrNull<DropDownButtonWidget>("SLOTS_DROPDOWNBUTTON");
|
var slotsButton = lobby.GetOrNull<DropDownButtonWidget>("SLOTS_DROPDOWNBUTTON");
|
||||||
if (slotsButton != null)
|
if (slotsButton != null)
|
||||||
{
|
{
|
||||||
slotsButton.IsDisabled = () => configurationDisabled() || panel != PanelType.Players ||
|
slotsButton.IsDisabled = () => configurationDisabled() || panel != PanelType.Players || Map.RuleStatus != MapRuleStatus.Cached ||
|
||||||
Map.RuleStatus != MapRuleStatus.Cached || !orderManager.LobbyInfo.Slots.Values.Any(s => s.AllowBots || !s.LockTeam);
|
(orderManager.LobbyInfo.Slots.Values.All(s => !s.AllowBots) &&
|
||||||
|
orderManager.LobbyInfo.Slots.Count(s => !s.Value.LockTeam && orderManager.LobbyInfo.ClientInSlot(s.Key) != null) == 0);
|
||||||
|
|
||||||
var botNames = modRules.Actors["player"].TraitInfos<IBotInfo>().Select(t => t.Name);
|
var botNames = modRules.Actors["player"].TraitInfos<IBotInfo>().Select(t => t.Name);
|
||||||
slotsButton.OnMouseDown = _ =>
|
slotsButton.OnMouseDown = _ =>
|
||||||
|
|||||||
Reference in New Issue
Block a user