Files
tbd-station-14/Content.Client/UserInterface/HumanoidProfileEditor.Random.cs
Acruid ca4fd649fe Massive Namespace Cleanup (#3120)
* Engine namespace changes.

* Automated remove redundant using statements.

* Simplified Graphics namespace.

* Apparently the container system stores full type names in the map file.😞 This updates those names.

* API Changes to LocalizationManager.LoadCulture.

* Update submodule to v0.3.2
2021-02-11 01:13:03 -08:00

33 lines
904 B
C#

using Content.Shared.Preferences;
using Content.Shared.Text;
using Robust.Shared.Random;
namespace Content.Client.UserInterface
{
public partial class HumanoidProfileEditor
{
private readonly IRobustRandom _random;
private void RandomizeEverything()
{
Profile = HumanoidCharacterProfile.Random();
UpdateSexControls();
UpdateGenderControls();
UpdateClothingControls();
UpdateAgeEdit();
UpdateNameEdit();
UpdateHairPickers();
}
private void RandomizeName()
{
var firstName = _random.Pick(Profile.Sex == Sex.Male
? Names.MaleFirstNames
: Names.FemaleFirstNames);
var lastName = _random.Pick(Names.LastNames);
SetName($"{firstName} {lastName}");
UpdateNameEdit();
}
}
}