Unset ready status when opening character setup (#522)
* Close character setup when joining the game * Unready when opening character setup instead
This commit is contained in:
committed by
Pieter-Jan Briers
parent
812654fe32
commit
f08455073a
@@ -220,6 +220,7 @@ namespace Content.Client.GameTicking
|
|||||||
|
|
||||||
_lobby.CharacterPreview.CharacterSetupButton.OnPressed += args =>
|
_lobby.CharacterPreview.CharacterSetupButton.OnPressed += args =>
|
||||||
{
|
{
|
||||||
|
SetReady(false);
|
||||||
_userInterfaceManager.StateRoot.RemoveChild(_lobby);
|
_userInterfaceManager.StateRoot.RemoveChild(_lobby);
|
||||||
_userInterfaceManager.StateRoot.AddChild(_characterSetup);
|
_userInterfaceManager.StateRoot.AddChild(_characterSetup);
|
||||||
};
|
};
|
||||||
@@ -237,12 +238,7 @@ namespace Content.Client.GameTicking
|
|||||||
|
|
||||||
_lobby.ReadyButton.OnToggled += args =>
|
_lobby.ReadyButton.OnToggled += args =>
|
||||||
{
|
{
|
||||||
if (_gameStarted)
|
SetReady(args.Pressed);
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_console.ProcessCommand($"toggleready {args.Pressed}");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_lobby.LeaveButton.OnPressed += args => _console.ProcessCommand("disconnect");
|
_lobby.LeaveButton.OnPressed += args => _console.ProcessCommand("disconnect");
|
||||||
@@ -250,6 +246,16 @@ namespace Content.Client.GameTicking
|
|||||||
_updatePlayerList();
|
_updatePlayerList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetReady(bool newReady)
|
||||||
|
{
|
||||||
|
if (_gameStarted)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_console.ProcessCommand($"toggleready {newReady}");
|
||||||
|
}
|
||||||
|
|
||||||
private void _joinGame(MsgTickerJoinGame message)
|
private void _joinGame(MsgTickerJoinGame message)
|
||||||
{
|
{
|
||||||
if (_tickerState == TickerState.InGame)
|
if (_tickerState == TickerState.InGame)
|
||||||
|
|||||||
Reference in New Issue
Block a user