Files
tbd-station-14/Content.Client/UserInterface/HumanoidProfileEditor.Random.cs
RemberBL 343f183b32 Character eye customization, scroll bar in appearance tab character setup. Fixes #2946 (#3403)
* A lot of unfinished work, trying to figure stuff out but it ain't really working

* The eye colors finally work on the sprite!

* Big refactor for HumanoidProfileEditor, crashes upon making a lobby

* Fixed Lobby crashing

* Moves the eye selection box to a new tab, which fixes selection the box from going off-screen and not expanding the bars

* uncommented something I shouldn't have commented out

* Moved eye colors back to the appearance tab, still some ui glitches

* Made it possible to scroll in the appearance tab

* Added "Eye color:" label

* Migrating some deprecated functions into their replacements

* Merged two private sealed classes into one public class, removing duplication
2021-03-07 20:48:24 +01:00

35 lines
1.0 KiB
C#

using Content.Shared.Preferences;
using Content.Shared.Prototypes;
using Content.Shared.Utility;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Client.UserInterface
{
public partial class HumanoidProfileEditor
{
private readonly IRobustRandom _random;
private readonly IPrototypeManager _prototypeManager;
private void RandomizeEverything()
{
Profile = HumanoidCharacterProfile.Random();
UpdateSexControls();
UpdateGenderControls();
UpdateClothingControls();
UpdateAgeEdit();
UpdateNameEdit();
UpdateHairPickers();
UpdateEyePickers();
}
private void RandomizeName()
{
var firstName = _random.Pick(Profile.Sex.FirstNames(_prototypeManager).Values);
var lastName = _random.Pick(_prototypeManager.Index<DatasetPrototype>("names_last"));
SetName($"{firstName} {lastName}");
UpdateNameEdit();
}
}
}