From 957371fefd8167960965e59983b38b12bfc61df2 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sat, 17 May 2025 22:00:45 -0400 Subject: [PATCH] Fix prisoner closet UI not working (#37558) Fix prisoner closet UI --- Content.Client/Security/Ui/GenpopLockerMenu.xaml.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Content.Client/Security/Ui/GenpopLockerMenu.xaml.cs b/Content.Client/Security/Ui/GenpopLockerMenu.xaml.cs index 70081211d2..3a214468a3 100644 --- a/Content.Client/Security/Ui/GenpopLockerMenu.xaml.cs +++ b/Content.Client/Security/Ui/GenpopLockerMenu.xaml.cs @@ -16,14 +16,11 @@ public sealed partial class GenpopLockerMenu : FancyWindow public event Action? OnConfigurationComplete; - // CCVar. - private int _maxIdJobLength; - public GenpopLockerMenu(EntityUid owner, IEntityManager entMan) { RobustXamlLoader.Load(this); + IoCManager.InjectDependencies(this); - _maxIdJobLength = _cfgManager.GetCVar(CCVars.MaxIdJobLength); Title = entMan.GetComponent(owner).EntityName; @@ -34,7 +31,8 @@ public sealed partial class GenpopLockerMenu : FancyWindow SentenceEdit.Text = "5"; CrimeEdit.Text = Loc.GetString("genpop-prisoner-id-crime-default"); - NameEdit.IsValid = val => !string.IsNullOrWhiteSpace(val) && val.Length <= _maxIdJobLength; + var maxIdJobLength = _cfgManager.GetCVar(CCVars.MaxIdJobLength); + NameEdit.IsValid = val => !string.IsNullOrWhiteSpace(val) && val.Length <= maxIdJobLength; SentenceEdit.IsValid = val => float.TryParse(val, out var f) && f >= 0; CrimeEdit.IsValid = val => !string.IsNullOrWhiteSpace(val) && val.Length <= GenpopLockerComponent.MaxCrimeLength;