From 875cf7b8aa31e4f9a940c2b521c25c4e338b1f83 Mon Sep 17 00:00:00 2001 From: FoxxoTrystan Date: Fri, 3 May 2024 16:27:11 +0200 Subject: [PATCH] Update LanguageMenuUIController.cs --- .../Systems/Language/LanguageMenuUIController.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Language/LanguageMenuUIController.cs b/Content.Client/UserInterface/Systems/Language/LanguageMenuUIController.cs index 87a5ed5c74b..9f40114a758 100644 --- a/Content.Client/UserInterface/Systems/Language/LanguageMenuUIController.cs +++ b/Content.Client/UserInterface/Systems/Language/LanguageMenuUIController.cs @@ -19,6 +19,7 @@ namespace Content.Client.UserInterface.Systems.Language; [UsedImplicitly] public sealed class LanguageMenuUIController : UIController, IOnStateEntered, IOnStateExited { + [UISystemDependency] private readonly LanguageSystem _languageSystem = default!; public LanguageMenuWindow? _languageWindow; private MenuButton? LanguageButton => UIManager.GetActiveUIWidgetOrNull()?.LanguageButton; @@ -43,8 +44,7 @@ public void OnStateEntered(GameplayState state) { DebugTools.Assert(_languageWindow == null); - var clientLanguageSystem = IoCManager.Resolve().GetEntitySystem(); - clientLanguageSystem.LanguagesUpdatedHook -= LanguagesUpdatedHook; + _languageSystem.LanguagesUpdatedHook -= LanguagesUpdatedHook; _languageWindow = UIManager.CreateWindow(); LayoutContainer.SetAnchorPreset(_languageWindow, LayoutContainer.LayoutPreset.CenterTop); @@ -60,8 +60,7 @@ public void OnStateExited(GameplayState state) _languageWindow = null; } - var clientLanguageSystem = IoCManager.Resolve().GetEntitySystem(); - clientLanguageSystem.LanguagesUpdatedHook -= LanguagesUpdatedHook; + _languageSystem.LanguagesUpdatedHook -= LanguagesUpdatedHook; CommandBinds.Unregister(); }