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:
āda
2025-05-17 00:27:39 -05:00
committed by GitHub
parent 0fed68d240
commit de24413bd5
17 changed files with 158 additions and 35 deletions

View File

@@ -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;