HumanoidCharacterProfile and IdCardConsoleComponent constants moved to cvar. Sync id card length with character name length (#35407)
* commit * mark TODOs * compiles * cleanup * cleanup * oops * changed my mind * requested changes * genpop fix
This commit is contained in:
@@ -53,6 +53,10 @@ namespace Content.Client.Lobby.UI
|
||||
|
||||
private readonly SpriteSystem _sprite;
|
||||
|
||||
// CCvar.
|
||||
private int _maxNameLength;
|
||||
private bool _allowFlavorText;
|
||||
|
||||
private FlavorText.FlavorText? _flavorText;
|
||||
private TextEdit? _flavorTextEdit;
|
||||
|
||||
@@ -131,6 +135,10 @@ namespace Content.Client.Lobby.UI
|
||||
_requirements = requirements;
|
||||
_controller = UserInterfaceManager.GetUIController<LobbyUIController>();
|
||||
_sprite = _entManager.System<SpriteSystem>();
|
||||
|
||||
_maxNameLength = _cfgManager.GetCVar(CCVars.MaxNameLength);
|
||||
_allowFlavorText = _cfgManager.GetCVar(CCVars.FlavorText);
|
||||
|
||||
ImportButton.OnPressed += args =>
|
||||
{
|
||||
ImportProfile();
|
||||
@@ -166,6 +174,7 @@ namespace Content.Client.Lobby.UI
|
||||
#region Name
|
||||
|
||||
NameEdit.OnTextChanged += args => { SetName(args.Text); };
|
||||
NameEdit.IsValid = args => args.Length <= _maxNameLength;
|
||||
NameRandomize.OnPressed += args => RandomizeName();
|
||||
RandomizeEverythingButton.OnPressed += args => { RandomizeEverything(); };
|
||||
WarningLabel.SetMarkup($"[color=red]{Loc.GetString("humanoid-profile-editor-naming-rules-warning")}[/color]");
|
||||
@@ -451,7 +460,7 @@ namespace Content.Client.Lobby.UI
|
||||
/// </summary>
|
||||
public void RefreshFlavorText()
|
||||
{
|
||||
if (_cfgManager.GetCVar(CCVars.FlavorText))
|
||||
if (_allowFlavorText)
|
||||
{
|
||||
if (_flavorText != null)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user