]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix prisoner closet UI not working (#37558)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Sun, 18 May 2025 02:00:45 +0000 (22:00 -0400)
committerGitHub <noreply@github.com>
Sun, 18 May 2025 02:00:45 +0000 (12:00 +1000)
Fix prisoner closet UI

Content.Client/Security/Ui/GenpopLockerMenu.xaml.cs

index 70081211d27202bbce0f9397a629f8c5a7424142..3a214468a305528ea2bf2f98b2df0418e5cdc2c9 100644 (file)
@@ -16,14 +16,11 @@ public sealed partial class GenpopLockerMenu : FancyWindow
 
     public event Action<string, float, string>? 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<MetaDataComponent>(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;