Fix IsSinglePlayer
This commit is contained in:
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
chatTraits = world.WorldActor.TraitsImplementing<INotifyChat>().ToArray();
|
||||
|
||||
var players = world.Players.Where(p => p != world.LocalPlayer && !p.NonCombatant && !p.IsBot);
|
||||
disableTeamChat = world.IsReplay || world.LobbyInfo.IsSinglePlayer || (world.LocalPlayer != null && !players.Any(p => p.IsAlliedWith(world.LocalPlayer)));
|
||||
disableTeamChat = world.IsReplay || world.LobbyInfo.NonBotClients.Count() == 1 || (world.LocalPlayer != null && !players.Any(p => p.IsAlliedWith(world.LocalPlayer)));
|
||||
teamChat = !disableTeamChat;
|
||||
|
||||
tabCompletion.Commands = chatTraits.OfType<ChatCommands>().SelectMany(x => x.Commands.Keys).ToList();
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var iop = world.WorldActor.TraitsImplementing<IObjectivesPanel>().FirstOrDefault();
|
||||
var exitDelay = iop != null ? iop.ExitDelay : 0;
|
||||
|
||||
if (world.LobbyInfo.IsSinglePlayer)
|
||||
if (world.LobbyInfo.NonBotClients.Count() == 1)
|
||||
{
|
||||
restartAction = () =>
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
worldRoot.IsVisible = () => false;
|
||||
}
|
||||
|
||||
if (button.Pause && world.LobbyInfo.IsSinglePlayer)
|
||||
if (button.Pause && world.LobbyInfo.NonBotClients.Count() == 1)
|
||||
world.SetPauseState(true);
|
||||
|
||||
var cachedDisableWorldSounds = Game.Sound.DisableWorldSounds;
|
||||
@@ -118,7 +118,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (button.DisableWorldSounds)
|
||||
Game.Sound.DisableWorldSounds = cachedDisableWorldSounds;
|
||||
|
||||
if (button.Pause && world.LobbyInfo.IsSinglePlayer)
|
||||
if (button.Pause && world.LobbyInfo.NonBotClients.Count() == 1)
|
||||
world.SetPauseState(cachedPause);
|
||||
|
||||
menuRoot.RemoveChild(currentWidget);
|
||||
|
||||
@@ -322,7 +322,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
startGameButton.IsDisabled = () => configurationDisabled() || map.Status != MapStatus.Available ||
|
||||
orderManager.LobbyInfo.Slots.Any(sl => sl.Value.Required && orderManager.LobbyInfo.ClientInSlot(sl.Key) == null) ||
|
||||
(!orderManager.LobbyInfo.GlobalSettings.EnableSingleplayer && orderManager.LobbyInfo.IsSinglePlayer);
|
||||
(!orderManager.LobbyInfo.GlobalSettings.EnableSingleplayer && orderManager.LobbyInfo.NonBotPlayers.Count() < 2);
|
||||
|
||||
startGameButton.OnClick = () =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user