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:
@@ -11,6 +11,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
{
|
||||
private HumanoidCharacterAppearance _appearance;
|
||||
private Sex _sex;
|
||||
private Gender _gender;
|
||||
|
||||
public sealed override string Name => "HumanoidAppearance";
|
||||
public sealed override uint? NetID => ContentNetIDs.HUMANOID_APPEARANCE;
|
||||
@@ -37,17 +38,20 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
}
|
||||
}
|
||||
|
||||
public Gender Gender => Sex switch
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public virtual Gender Gender
|
||||
{
|
||||
Sex.Female => Gender.Female,
|
||||
Sex.Male => Gender.Male,
|
||||
Sex.Classified => Gender.Neuter,
|
||||
_ => Gender.Epicene,
|
||||
};
|
||||
get => _gender;
|
||||
set
|
||||
{
|
||||
_gender = value;
|
||||
Dirty();
|
||||
}
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
{
|
||||
return new HumanoidAppearanceComponentState(Appearance, Sex);
|
||||
return new HumanoidAppearanceComponentState(Appearance, Sex, Gender);
|
||||
}
|
||||
|
||||
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
|
||||
@@ -59,6 +63,7 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
|
||||
Appearance = cast.Appearance;
|
||||
Sex = cast.Sex;
|
||||
Gender = cast.Gender;
|
||||
}
|
||||
|
||||
public void UpdateFromProfile(ICharacterProfile profile)
|
||||
@@ -66,20 +71,23 @@ namespace Content.Shared.GameObjects.Components.Mobs
|
||||
var humanoid = (HumanoidCharacterProfile) profile;
|
||||
Appearance = (HumanoidCharacterAppearance) humanoid.CharacterAppearance;
|
||||
Sex = humanoid.Sex;
|
||||
Gender = humanoid.Gender;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
[NetSerializable]
|
||||
private sealed class HumanoidAppearanceComponentState : ComponentState
|
||||
{
|
||||
public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex) : base(ContentNetIDs.HUMANOID_APPEARANCE)
|
||||
public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex, Gender gender) : base(ContentNetIDs.HUMANOID_APPEARANCE)
|
||||
{
|
||||
Appearance = appearance;
|
||||
Sex = sex;
|
||||
Gender = gender;
|
||||
}
|
||||
|
||||
public HumanoidCharacterAppearance Appearance { get; }
|
||||
public Sex Sex { get; }
|
||||
public Gender Gender { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user