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(); }