From c70e423ff6b437d44ac8514fa54146341430eb02 Mon Sep 17 00:00:00 2001 From: Rane <60792108+Elijahrane@users.noreply.github.com> Date: Sat, 15 Oct 2022 17:45:47 -0400 Subject: [PATCH] Let species prototypes define valid sexes (Sex Refactor) (#11520) --- .../UI/HumanoidProfileEditor.Random.cs | 2 +- .../Preferences/UI/HumanoidProfileEditor.xaml | 3 +- .../UI/HumanoidProfileEditor.xaml.cs | 74 ++++++++++++------- .../GameTicking/Rules/PiratesRuleSystem.cs | 7 +- .../IdentityManagement/IdentitySystem.cs | 2 +- .../Speech/Components/VocalComponent.cs | 3 + Content.Server/Speech/VocalSystem.cs | 7 +- Content.Shared/Humanoid/NamingSystem.cs | 58 +++++++++++++++ .../Humanoid/Prototypes/SpeciesPrototype.cs | 3 + Content.Shared/Humanoid/Sex.cs | 53 +------------ .../Preferences/HumanoidCharacterProfile.cs | 37 ++++++++-- .../StationRecords/GeneralStationRecord.cs | 2 +- .../ui/humanoid-profile-editor.ftl | 5 +- Resources/Prototypes/Species/slime.yml | 2 + 14 files changed, 161 insertions(+), 97 deletions(-) create mode 100644 Content.Shared/Humanoid/NamingSystem.cs diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.Random.cs b/Content.Client/Preferences/UI/HumanoidProfileEditor.Random.cs index a01a51ab90..732f674ec6 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.Random.cs +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.Random.cs @@ -22,7 +22,7 @@ namespace Content.Client.Preferences.UI private void RandomizeName() { if (Profile == null) return; - var name = Profile.Sex.GetName(Profile.Species, _prototypeManager, _random); + var name = HumanoidCharacterProfile.GetName(Profile.Species, Profile.Gender); SetName(name); UpdateNameEdit(); } diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml index a654ae5359..ec26a26436 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml @@ -58,8 +58,7 @@