Adds skin color to preferences (#5280)
* Adds skin color to preferences * Fixes a comment, adds randomness to skin color in randomize everything button
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Client.Cuffs.Components;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.CharacterAppearance;
|
||||
@@ -25,6 +26,19 @@ namespace Content.Client.CharacterAppearance.Systems
|
||||
SubscribeLocalEvent<HumanoidAppearanceBodyPartRemovedEvent>(BodyPartRemoved);
|
||||
}
|
||||
|
||||
private List<HumanoidVisualLayers> _bodyPartLayers = new List<HumanoidVisualLayers>
|
||||
{
|
||||
HumanoidVisualLayers.Chest,
|
||||
HumanoidVisualLayers.Head,
|
||||
HumanoidVisualLayers.Eyes,
|
||||
HumanoidVisualLayers.RArm,
|
||||
HumanoidVisualLayers.LArm,
|
||||
HumanoidVisualLayers.RHand,
|
||||
HumanoidVisualLayers.LHand,
|
||||
HumanoidVisualLayers.RLeg,
|
||||
HumanoidVisualLayers.LLeg,
|
||||
};
|
||||
|
||||
private void UpdateLooks(EntityUid uid, HumanoidAppearanceComponent component, ChangedHumanoidAppearanceEvent args)
|
||||
{
|
||||
if(!EntityManager.TryGetComponent(uid, out SpriteComponent? sprite))
|
||||
@@ -47,6 +61,9 @@ namespace Content.Client.CharacterAppearance.Systems
|
||||
sprite.LayerSetColor(HumanoidVisualLayers.FacialHair,
|
||||
component.CanColorFacialHair ? component.Appearance.FacialHairColor : Color.White);
|
||||
|
||||
foreach (var layer in _bodyPartLayers)
|
||||
sprite.LayerSetColor(layer, component.Appearance.SkinColor);
|
||||
|
||||
sprite.LayerSetColor(HumanoidVisualLayers.Eyes, component.Appearance.EyeColor);
|
||||
|
||||
sprite.LayerSetState(HumanoidVisualLayers.Chest, component.Sex == Sex.Male ? "torso_m" : "torso_f");
|
||||
|
||||
Reference in New Issue
Block a user