diff --git a/Content.Client/Lobby/LobbyState.cs b/Content.Client/Lobby/LobbyState.cs index a77136ae41..457163a5b5 100644 --- a/Content.Client/Lobby/LobbyState.cs +++ b/Content.Client/Lobby/LobbyState.cs @@ -80,6 +80,10 @@ namespace Content.Client.Lobby _gameTicker.InfoBlobUpdated += UpdateLobbyUi; _gameTicker.LobbyStatusUpdated += LobbyStatusUpdated; _gameTicker.LobbyLateJoinStatusUpdated += LobbyLateJoinStatusUpdated; + + _preferencesManager.OnServerDataLoaded += PreferencesDataLoaded; + + _lobby.CharacterPreview.UpdateUI(); } protected override void Shutdown() @@ -100,6 +104,13 @@ namespace Content.Client.Lobby _characterSetup?.Dispose(); _characterSetup = null; + + _preferencesManager.OnServerDataLoaded -= PreferencesDataLoaded; + } + + private void PreferencesDataLoaded() + { + _lobby?.CharacterPreview.UpdateUI(); } private void OnSetupPressed(BaseButton.ButtonEventArgs args) diff --git a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs index a319c1a4f1..c63aee7edf 100644 --- a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs +++ b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs @@ -76,8 +76,6 @@ namespace Content.Client.Lobby.UI AddChild(vBox); UpdateUI(); - - _preferencesManager.OnServerDataLoaded += UpdateUI; } public Button CharacterSetupButton { get; } @@ -85,7 +83,6 @@ namespace Content.Client.Lobby.UI protected override void Dispose(bool disposing) { base.Dispose(disposing); - _preferencesManager.OnServerDataLoaded -= UpdateUI; if (!disposing) return; if (_previewDummy != null) _entityManager.DeleteEntity(_previewDummy.Value);