Change character names to use datasets prototypes (#3259)

* Remove old name lists in .txts

* Fix tests

* LATEST MASTER TECHNOLOGY
This commit is contained in:
DrSmugleaf
2021-02-17 10:46:44 +01:00
committed by GitHub
parent 25c884a84d
commit c435b5150d
9 changed files with 70 additions and 2064 deletions

View File

@@ -1,5 +1,7 @@
using Content.Shared.Preferences;
using Content.Shared.Text;
using Content.Shared.Prototypes;
using Content.Shared.Utility;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Client.UserInterface
@@ -7,6 +9,7 @@ namespace Content.Client.UserInterface
public partial class HumanoidProfileEditor
{
private readonly IRobustRandom _random;
private readonly IPrototypeManager _prototypeManager;
private void RandomizeEverything()
{
@@ -21,10 +24,8 @@ namespace Content.Client.UserInterface
private void RandomizeName()
{
var firstName = _random.Pick(Profile.Sex == Sex.Male
? Names.MaleFirstNames
: Names.FemaleFirstNames);
var lastName = _random.Pick(Names.LastNames);
var firstName = _random.Pick(Profile.Sex.FirstNames(_prototypeManager).Values);
var lastName = _random.Pick(_prototypeManager.Index<DatasetPrototype>("names_last"));
SetName($"{firstName} {lastName}");
UpdateNameEdit();
}