Skip to content

Commit

Permalink
skin, hair, facial hair
Browse files Browse the repository at this point in the history
  • Loading branch information
modern-nm committed May 15, 2024
1 parent cf07e22 commit f50b36a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
5 changes: 3 additions & 2 deletions Content.Client/ADT/Changeling/ChangelingPanelSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Content.Client.UserInterface.Systems.Radial.Controls;
using Content.Shared.Changeling;
using Content.Shared.Humanoid.Prototypes;
using FastAccessors;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Client.UserInterface;
Expand Down Expand Up @@ -36,6 +35,8 @@ public sealed class ChangelingPanelSystem : EntitySystem

private const string DefaultIcon = "/Textures/Interface/AdminActions/play.png";

private const string EmptyIcon = "/Textures/Interface/AdminActions/emptyIcon.png";

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -70,7 +71,7 @@ private void HandleChangelingFormsMenuEvent(RequestChangelingFormsMenuEvent args
face.SetEntity(dummy);

var actionName = humanoid.Name;
var texturePath = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath(DefaultIcon)));
var texturePath = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath(EmptyIcon)));

var emoteButton = _openedMenu.AddButton(actionName, texturePath, face);
emoteButton.Opacity = 210;
Expand Down
33 changes: 25 additions & 8 deletions Content.Server/ADT/Changeling/EntitySystems/ChangelingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
using Content.Shared.Preferences;
using Content.Server.Database;
using Content.Server.Humanoid;
using FastAccessors;
using Content.Shared.Humanoid.Prototypes;
using Robust.Shared.Utility;
using Content.Shared.Humanoid.Markings;


namespace Content.Server.Changeling.EntitySystems;
Expand Down Expand Up @@ -338,15 +342,28 @@ public void OnCycleDNA(EntityUid uid, ChangelingComponent component, ChangelingC
HumanoidCharacterAppearance hca = new();
if (item.HumanoidAppearanceComponent == null)
continue;
hca.WithEyeColor(item.HumanoidAppearanceComponent.EyeColor)
.WithSkinColor(item.HumanoidAppearanceComponent.SkinColor)
.WithHairColor(item.HumanoidAppearanceComponent.CachedHairColor != null ? item.HumanoidAppearanceComponent.CachedHairColor.Value : Color.Black);
foreach (var layer in item.HumanoidAppearanceComponent.BaseLayers)
{
// if (item.HumanoidAppearanceComponent.CustomBaseLayers.TryGetValue(HumanoidVisualLayers.FacialHair, out var facialHair))
// if (facialHair.Id != null)
// hca = hca.WithFacialHairStyleName(facialHair.Id.Value.Id);

// if (item.HumanoidAppearanceComponent.BaseLayers.TryGetValue(HumanoidVisualLayers.FacialHair, out var facialHair))
// hca = hca.WithFacialHairStyleName(facialHair.ID);

if (item.HumanoidAppearanceComponent.MarkingSet.Markings.TryGetValue(Shared.Humanoid.Markings.MarkingCategories.FacialHair, out var facialHair))
if (facialHair.TryGetValue(0, out var marking))
{
hca = hca.WithFacialHairStyleName(marking.MarkingId);
hca = hca.WithFacialHairColor(marking.MarkingColors.First());
}
if (item.HumanoidAppearanceComponent.MarkingSet.Markings.TryGetValue(Shared.Humanoid.Markings.MarkingCategories.Hair, out var hair))
if (hair.TryGetValue(0, out var marking))
{
hca = hca.WithHairStyleName(marking.MarkingId);
hca = hca.WithHairColor(marking.MarkingColors.First());
}

hca = hca.WithSkinColor(item.HumanoidAppearanceComponent.SkinColor);

}
// WithHairColor(item.HumanoidAppearanceComponent.BaseLayers.)
// WithFacialHairColor(item.HumanoidAppearanceComponent.CachedFacialHairColor)
ev.HumanoidData.Add(new()
{
NetEntity = netEntity.Value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ public sealed partial class ChangelingComponent : Component

[DataField]
public int BiodegradeDuration = 3;
[DataField]

[DataField]
public string HiveMind = "ChangelingCollectiveMind";

[DataField]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f50b36a

Please sign in to comment.