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

@@ -2,7 +2,9 @@ using System.Diagnostics.CodeAnalysis;
using Content.Server.Administration;
using Content.Shared.Access.Components;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
namespace Content.Server.Mind.Commands;
@@ -10,6 +12,7 @@ namespace Content.Server.Mind.Commands;
[AdminCommand(AdminFlags.VarEdit)]
public sealed class RenameCommand : LocalizedEntityCommands
{
[Dependency] private readonly IConfigurationManager _cfgManager = default!;
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
@@ -25,7 +28,7 @@ public sealed class RenameCommand : LocalizedEntityCommands
}
var name = args[1];
if (name.Length > IdCardConsoleComponent.MaxFullNameLength)
if (name.Length > _cfgManager.GetCVar(CCVars.MaxNameLength))
{
shell.WriteLine(Loc.GetString("cmd-rename-too-long"));
return;