Id[entity] 2.0 (real) (#9612)
* starter API * network ID cards * Port more stuff from old identity * Re-implement identity representation + name updating * move * proper name returning for `IdentityName` * move everything important to server, give in to temptation * shared / server / client split sadly. move ensure to shared and spawn to server * identity update queueing + identityblocker * fixes * and just like that it's usable for admins * huge identity pass * pass dos * jesus christ * figs :D * fuck u * fix bad merge. Co-authored-by: Moony <moonheart08@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.CharacterAppearance.Systems;
|
||||
using Content.Shared.Preferences;
|
||||
using Content.Shared.Species;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.GameStates;
|
||||
@@ -23,6 +24,9 @@ namespace Content.Shared.CharacterAppearance.Components
|
||||
[ViewVariables]
|
||||
public string Species { get; set; } = SpeciesManager.DefaultSpecies;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public int Age { get; set; } = HumanoidCharacterProfile.MinimumAge;
|
||||
|
||||
[DataField("categoriesHair")]
|
||||
[ViewVariables]
|
||||
public SpriteAccessoryCategories CategoriesHair { get; set; } = SpriteAccessoryCategories.HumanHair;
|
||||
@@ -55,16 +59,19 @@ namespace Content.Shared.CharacterAppearance.Components
|
||||
public Sex Sex { get; }
|
||||
public Gender Gender { get; }
|
||||
public string Species { get; }
|
||||
public int Age { get; }
|
||||
|
||||
public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance,
|
||||
Sex sex,
|
||||
Gender gender,
|
||||
string species)
|
||||
string species,
|
||||
int age)
|
||||
{
|
||||
Appearance = appearance;
|
||||
Sex = sex;
|
||||
Gender = gender;
|
||||
Species = species;
|
||||
Age = age;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Shared.CharacterAppearance.Systems
|
||||
public void UpdateFromProfile(EntityUid uid, ICharacterProfile profile, HumanoidAppearanceComponent? appearance=null)
|
||||
{
|
||||
var humanoid = (HumanoidCharacterProfile) profile;
|
||||
UpdateAppearance(uid, humanoid.Appearance, humanoid.Sex, humanoid.Gender, humanoid.Species, appearance);
|
||||
UpdateAppearance(uid, humanoid.Appearance, humanoid.Sex, humanoid.Gender, humanoid.Species, humanoid.Age, appearance);
|
||||
}
|
||||
|
||||
// The magic mirror otherwise wouldn't work. (it directly modifies the component server-side)
|
||||
@@ -29,7 +29,7 @@ namespace Content.Shared.CharacterAppearance.Systems
|
||||
component.Dirty();
|
||||
}
|
||||
|
||||
private void UpdateAppearance(EntityUid uid, HumanoidCharacterAppearance appearance, Sex sex, Gender gender, string species, HumanoidAppearanceComponent? component = null)
|
||||
private void UpdateAppearance(EntityUid uid, HumanoidCharacterAppearance appearance, Sex sex, Gender gender, string species, int age, HumanoidAppearanceComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component)) return;
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace Content.Shared.CharacterAppearance.Systems
|
||||
component.Sex = sex;
|
||||
component.Gender = gender;
|
||||
component.Species = species;
|
||||
component.Age = age;
|
||||
|
||||
if (EntityManager.TryGetComponent(uid, out GrammarComponent? g))
|
||||
g.Gender = gender;
|
||||
@@ -59,7 +60,7 @@ namespace Content.Shared.CharacterAppearance.Systems
|
||||
|
||||
private void OnAppearanceGetState(EntityUid uid, HumanoidAppearanceComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new HumanoidAppearanceComponentState(component.Appearance, component.Sex, component.Gender, component.Species);
|
||||
args.State = new HumanoidAppearanceComponentState(component.Appearance, component.Sex, component.Gender, component.Species, component.Age);
|
||||
}
|
||||
|
||||
private void OnAppearanceHandleState(EntityUid uid, HumanoidAppearanceComponent component, ref ComponentHandleState args)
|
||||
@@ -67,7 +68,7 @@ namespace Content.Shared.CharacterAppearance.Systems
|
||||
if (args.Current is not HumanoidAppearanceComponentState state)
|
||||
return;
|
||||
|
||||
UpdateAppearance(uid, state.Appearance, state.Sex, state.Gender, state.Species);
|
||||
UpdateAppearance(uid, state.Appearance, state.Sex, state.Gender, state.Species, state.Age);
|
||||
}
|
||||
|
||||
// Scaffolding until Body is moved to ECS.
|
||||
@@ -106,7 +107,6 @@ namespace Content.Shared.CharacterAppearance.Systems
|
||||
Uid = uid;
|
||||
Args = args;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
Reference in New Issue
Block a user