@@ -16,14 +16,11 @@ public sealed partial class GenpopLockerMenu : FancyWindow
|
|||||||
|
|
||||||
public event Action<string, float, string>? OnConfigurationComplete;
|
public event Action<string, float, string>? OnConfigurationComplete;
|
||||||
|
|
||||||
// CCVar.
|
|
||||||
private int _maxIdJobLength;
|
|
||||||
|
|
||||||
public GenpopLockerMenu(EntityUid owner, IEntityManager entMan)
|
public GenpopLockerMenu(EntityUid owner, IEntityManager entMan)
|
||||||
{
|
{
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
|
IoCManager.InjectDependencies(this);
|
||||||
|
|
||||||
_maxIdJobLength = _cfgManager.GetCVar(CCVars.MaxIdJobLength);
|
|
||||||
|
|
||||||
Title = entMan.GetComponent<MetaDataComponent>(owner).EntityName;
|
Title = entMan.GetComponent<MetaDataComponent>(owner).EntityName;
|
||||||
|
|
||||||
@@ -34,7 +31,8 @@ public sealed partial class GenpopLockerMenu : FancyWindow
|
|||||||
SentenceEdit.Text = "5";
|
SentenceEdit.Text = "5";
|
||||||
CrimeEdit.Text = Loc.GetString("genpop-prisoner-id-crime-default");
|
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;
|
SentenceEdit.IsValid = val => float.TryParse(val, out var f) && f >= 0;
|
||||||
CrimeEdit.IsValid = val => !string.IsNullOrWhiteSpace(val) && val.Length <= GenpopLockerComponent.MaxCrimeLength;
|
CrimeEdit.IsValid = val => !string.IsNullOrWhiteSpace(val) && val.Length <= GenpopLockerComponent.MaxCrimeLength;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user