Files
tbd-station-14/Content.Client/UserInterface/HumanoidProfileEditor.Random.cs
20kdc 6b5cded8c2 Clothing and pronoun fields (#2689)
* Clothing & Gender fields: Add to database [MODIFIED TO NOT DEPEND ON SAPHIRE-DB-REFACTOR]

Sorry about this, Saphire.

* Clothing & Gender fields: Add UI [FALLBACK II]

* Clothing & Gender fields: Actually apply gender

* Clothing & Gender fields: Import innerclothingskirt field from my previous attempt

Couldn't import actual prototypes because of a change to IDs

* Clothing & Gender fields: Add innerclothingskirt field to everything

* Clothing & Gender fields: Jumpskirts now work

* Clothing & Gender fields: Gender field will follow sex field if it's not different (UX improvement) [FALLBACK II]

* Clothing & Gender fields: Gender -> Pronouns to reduce confusion. Also, fix profile summary. Properly. [FALLBACK II]

* Clothing & Pronoun fields: Refactor so that profile equipment adjustments are performed in StartingGearPrototype.
2020-12-24 14:42:40 +01:00

38 lines
1.0 KiB
C#

using System;
using System.Linq;
using Content.Shared.Preferences;
using Content.Shared.Preferences.Appearance;
using Content.Shared.Text;
using Robust.Shared.Interfaces.Random;
using Robust.Shared.Maths;
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();
}
}
}