@@ -44,9 +44,11 @@ namespace Content.Client.Lobby
|
|||||||
[ViewVariables] private CharacterSetupGui? _characterSetup;
|
[ViewVariables] private CharacterSetupGui? _characterSetup;
|
||||||
[ViewVariables] private LobbyGui? _lobby;
|
[ViewVariables] private LobbyGui? _lobby;
|
||||||
|
|
||||||
|
private ClientGameTicker _gameTicker = default!;
|
||||||
|
|
||||||
public override void Startup()
|
public override void Startup()
|
||||||
{
|
{
|
||||||
var gameTicker = EntitySystem.Get<ClientGameTicker>();
|
_gameTicker = EntitySystem.Get<ClientGameTicker>();
|
||||||
_characterSetup = new CharacterSetupGui(_entityManager, _resourceCache, _preferencesManager,
|
_characterSetup = new CharacterSetupGui(_entityManager, _resourceCache, _preferencesManager,
|
||||||
_prototypeManager);
|
_prototypeManager);
|
||||||
LayoutContainer.SetAnchorPreset(_characterSetup, LayoutContainer.LayoutPreset.Wide);
|
LayoutContainer.SetAnchorPreset(_characterSetup, LayoutContainer.LayoutPreset.Wide);
|
||||||
@@ -86,7 +88,7 @@ namespace Content.Client.Lobby
|
|||||||
|
|
||||||
_lobby.ReadyButton.OnPressed += _ =>
|
_lobby.ReadyButton.OnPressed += _ =>
|
||||||
{
|
{
|
||||||
if (!gameTicker.IsGameStarted)
|
if (!_gameTicker.IsGameStarted)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -105,20 +107,19 @@ namespace Content.Client.Lobby
|
|||||||
UpdatePlayerList();
|
UpdatePlayerList();
|
||||||
|
|
||||||
_playerManager.PlayerListUpdated += PlayerManagerOnPlayerListUpdated;
|
_playerManager.PlayerListUpdated += PlayerManagerOnPlayerListUpdated;
|
||||||
gameTicker.InfoBlobUpdated += UpdateLobbyUi;
|
_gameTicker.InfoBlobUpdated += UpdateLobbyUi;
|
||||||
gameTicker.LobbyStatusUpdated += LobbyStatusUpdated;
|
_gameTicker.LobbyStatusUpdated += LobbyStatusUpdated;
|
||||||
gameTicker.LobbyReadyUpdated += LobbyReadyUpdated;
|
_gameTicker.LobbyReadyUpdated += LobbyReadyUpdated;
|
||||||
gameTicker.LobbyLateJoinStatusUpdated += LobbyLateJoinStatusUpdated;
|
_gameTicker.LobbyLateJoinStatusUpdated += LobbyLateJoinStatusUpdated;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Shutdown()
|
public override void Shutdown()
|
||||||
{
|
{
|
||||||
_playerManager.PlayerListUpdated -= PlayerManagerOnPlayerListUpdated;
|
_playerManager.PlayerListUpdated -= PlayerManagerOnPlayerListUpdated;
|
||||||
var gameTicker = EntitySystem.Get<ClientGameTicker>();
|
_gameTicker.InfoBlobUpdated -= UpdateLobbyUi;
|
||||||
gameTicker.InfoBlobUpdated -= UpdateLobbyUi;
|
_gameTicker.LobbyStatusUpdated -= LobbyStatusUpdated;
|
||||||
gameTicker.LobbyStatusUpdated -= LobbyStatusUpdated;
|
_gameTicker.LobbyReadyUpdated -= LobbyReadyUpdated;
|
||||||
gameTicker.LobbyReadyUpdated -= LobbyReadyUpdated;
|
_gameTicker.LobbyLateJoinStatusUpdated -= LobbyLateJoinStatusUpdated;
|
||||||
gameTicker.LobbyLateJoinStatusUpdated -= LobbyLateJoinStatusUpdated;
|
|
||||||
|
|
||||||
_lobby?.Dispose();
|
_lobby?.Dispose();
|
||||||
_characterSetup?.Dispose();
|
_characterSetup?.Dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user