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.
This commit is contained in:
@@ -9,6 +9,7 @@ using Content.Shared.Preferences;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Localization.Macros;
|
||||
|
||||
namespace Content.Server.Database
|
||||
{
|
||||
@@ -130,10 +131,24 @@ namespace Content.Server.Database
|
||||
{
|
||||
var jobs = profile.Jobs.ToDictionary(j => j.JobName, j => (JobPriority) j.Priority);
|
||||
var antags = profile.Antags.Select(a => a.AntagName);
|
||||
|
||||
var sex = Sex.Male;
|
||||
if (Enum.TryParse<Sex>(profile.Sex, true, out var sexVal))
|
||||
sex = sexVal;
|
||||
|
||||
var clothing = ClothingPreference.Jumpsuit;
|
||||
if (Enum.TryParse<ClothingPreference>(profile.Clothing, true, out var clothingVal))
|
||||
clothing = clothingVal;
|
||||
|
||||
var gender = sex == Sex.Male ? Gender.Male : Gender.Female;
|
||||
if (Enum.TryParse<Gender>(profile.Gender, true, out var genderVal))
|
||||
gender = genderVal;
|
||||
|
||||
return new HumanoidCharacterProfile(
|
||||
profile.CharacterName,
|
||||
profile.Age,
|
||||
profile.Sex == "Male" ? Sex.Male : Sex.Female,
|
||||
sex,
|
||||
gender,
|
||||
new HumanoidCharacterAppearance
|
||||
(
|
||||
profile.HairName,
|
||||
@@ -143,6 +158,7 @@ namespace Content.Server.Database
|
||||
Color.FromHex(profile.EyeColor),
|
||||
Color.FromHex(profile.SkinColor)
|
||||
),
|
||||
clothing,
|
||||
jobs,
|
||||
(PreferenceUnavailableMode) profile.PreferenceUnavailable,
|
||||
antags.ToList()
|
||||
@@ -158,12 +174,14 @@ namespace Content.Server.Database
|
||||
CharacterName = humanoid.Name,
|
||||
Age = humanoid.Age,
|
||||
Sex = humanoid.Sex.ToString(),
|
||||
Gender = humanoid.Gender.ToString(),
|
||||
HairName = appearance.HairStyleName,
|
||||
HairColor = appearance.HairColor.ToHex(),
|
||||
FacialHairName = appearance.FacialHairStyleName,
|
||||
FacialHairColor = appearance.FacialHairColor.ToHex(),
|
||||
EyeColor = appearance.EyeColor.ToHex(),
|
||||
SkinColor = appearance.SkinColor.ToHex(),
|
||||
Clothing = humanoid.Clothing.ToString(),
|
||||
Slot = slot,
|
||||
PreferenceUnavailable = (DbPreferenceUnavailableMode) humanoid.PreferenceUnavailable
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user