Files
tbd-station-14/Content.Client/Preferences/UI/HumanoidProfileEditor.Random.cs
T-Stalker d750e7b599 Lizard name datasets (#7890)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-05-12 16:43:15 -07:00

38 lines
1.0 KiB
C#

using Content.Shared.CharacterAppearance;
using Content.Shared.Dataset;
using Content.Shared.Preferences;
using Content.Shared.Random.Helpers;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Client.Preferences.UI
{
public sealed partial class HumanoidProfileEditor
{
private readonly IRobustRandom _random;
private readonly IPrototypeManager _prototypeManager;
private void RandomizeEverything()
{
Profile = HumanoidCharacterProfile.Random();
UpdateSexControls();
UpdateGenderControls();
UpdateClothingControls();
UpdateAgeEdit();
UpdateNameEdit();
UpdateHairPickers();
UpdateEyePickers();
_skinColor.Value = _random.Next(0, 100);
}
private void RandomizeName()
{
if (Profile == null) return;
var name = Profile.Sex.GetName(Profile.Species, _prototypeManager, _random);
SetName(name);
UpdateNameEdit();
}
}
}