Merge pull request #8731 from deniz1a/simplify-lobby-logic
Simplifies Start button logic in lobby
This commit is contained in:
@@ -297,15 +297,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
orderManager.LobbyInfo.Slots.Any(sl => sl.Value.Required && orderManager.LobbyInfo.ClientInSlot(sl.Key) == null);
|
orderManager.LobbyInfo.Slots.Any(sl => sl.Value.Required && orderManager.LobbyInfo.ClientInSlot(sl.Key) == null);
|
||||||
startGameButton.OnClick = () =>
|
startGameButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
Func<KeyValuePair<string, Session.Slot>, bool> notReady = sl =>
|
|
||||||
{
|
|
||||||
var cl = orderManager.LobbyInfo.ClientInSlot(sl.Key);
|
|
||||||
|
|
||||||
// Bots and admins don't count
|
// Bots and admins don't count
|
||||||
return cl != null && !cl.IsAdmin && cl.Bot == null && !cl.IsReady;
|
if (orderManager.LobbyInfo.Clients.Any(c => c.Slot != null && !c.IsAdmin && c.Bot == null && !c.IsReady))
|
||||||
};
|
|
||||||
|
|
||||||
if (orderManager.LobbyInfo.Slots.Any(notReady))
|
|
||||||
panel = PanelType.ForceStart;
|
panel = PanelType.ForceStart;
|
||||||
else
|
else
|
||||||
startGame();
|
startGame();
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
|
|||||||
MaxLength: 16
|
MaxLength: 16
|
||||||
Label@SPECTATOR:
|
Label@SPECTATOR:
|
||||||
Text: Spectator
|
Text: Spectator
|
||||||
Width: 315-55+55
|
Width: 315
|
||||||
Height: 25
|
Height: 25
|
||||||
X: 210
|
X: 210
|
||||||
Y: 0
|
Y: 0
|
||||||
@@ -309,7 +309,7 @@ ScrollPanel@LOBBY_PLAYER_BIN:
|
|||||||
Font: Bold
|
Font: Bold
|
||||||
Label@SPECTATOR:
|
Label@SPECTATOR:
|
||||||
Text: Spectator
|
Text: Spectator
|
||||||
Width: 315-55+55
|
Width: 315
|
||||||
Height: 25
|
Height: 25
|
||||||
X: 210
|
X: 210
|
||||||
Y: 0
|
Y: 0
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ ScrollPanel@LOBBY_PLAYER_BIN:
|
|||||||
Height: 20
|
Height: 20
|
||||||
Visible: false
|
Visible: false
|
||||||
Image@STATUS_IMAGE:
|
Image@STATUS_IMAGE:
|
||||||
Visible: false
|
|
||||||
X: 537
|
X: 537
|
||||||
Y: 4
|
Y: 4
|
||||||
Width: 20
|
Width: 20
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ ScrollPanel@LOBBY_PLAYER_BIN:
|
|||||||
Height: 20
|
Height: 20
|
||||||
Visible: false
|
Visible: false
|
||||||
Image@STATUS_IMAGE:
|
Image@STATUS_IMAGE:
|
||||||
Visible: false
|
|
||||||
X: 537
|
X: 537
|
||||||
Y: 4
|
Y: 4
|
||||||
Width: 20
|
Width: 20
|
||||||
|
|||||||
Reference in New Issue
Block a user