diff --git a/Content.Client/_White/Wizard/Mirror/WizardMirrorWindow.cs b/Content.Client/_White/Wizard/Mirror/WizardMirrorWindow.cs index 5053205b2b..443698c01a 100644 --- a/Content.Client/_White/Wizard/Mirror/WizardMirrorWindow.cs +++ b/Content.Client/_White/Wizard/Mirror/WizardMirrorWindow.cs @@ -291,6 +291,15 @@ public sealed partial class WizardMirrorWindow : DefaultWindow }; #endregion Eyes + + #region Markings + + CMarkings.OnMarkingAdded += OnMarkingChange; + CMarkings.OnMarkingRemoved += OnMarkingChange; + CMarkings.OnMarkingColorChange += OnMarkingChange; + CMarkings.OnMarkingRankChange += OnMarkingChange; + + #endregion Markings } #region Set @@ -354,6 +363,15 @@ public sealed partial class WizardMirrorWindow : DefaultWindow IsDirty = true; } + private void OnMarkingChange(MarkingSet markings) + { + if (Profile is null) + return; + + Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithMarkings(markings.GetForwardEnumerator().ToList())); + IsDirty = true; + } + #endregion #region Update @@ -602,6 +620,18 @@ public sealed partial class WizardMirrorWindow : DefaultWindow EyesPicker.SetData(Profile.Appearance.EyeColor); } + private void UpdateMarkings() + { + if (Profile == null) + { + return; + } + + CMarkings.SetData(Profile.Appearance.Markings, Profile.Species, + Profile.Sex, Profile.BodyType, Profile.Appearance.SkinColor, Profile.Appearance.EyeColor + ); + } + #endregion private void OnSkinColorOnValueChanged() @@ -688,5 +718,6 @@ public sealed partial class WizardMirrorWindow : DefaultWindow UpdateCMarkingsFacialHair(); UpdateTtsVoicesControls(); UpdateBodyTypes(); + UpdateMarkings(); } } diff --git a/Content.Client/_White/Wizard/Mirror/WizardMirrorWindow.xaml b/Content.Client/_White/Wizard/Mirror/WizardMirrorWindow.xaml index 64258d2f19..a135b17803 100644 --- a/Content.Client/_White/Wizard/Mirror/WizardMirrorWindow.xaml +++ b/Content.Client/_White/Wizard/Mirror/WizardMirrorWindow.xaml @@ -80,6 +80,12 @@ + + + + + + diff --git a/Content.Server/_White/Wizard/Mirror/WizardMirrorSystem.cs b/Content.Server/_White/Wizard/Mirror/WizardMirrorSystem.cs index 64e643dec1..33ff8e10ab 100644 --- a/Content.Server/_White/Wizard/Mirror/WizardMirrorSystem.cs +++ b/Content.Server/_White/Wizard/Mirror/WizardMirrorSystem.cs @@ -1,4 +1,6 @@ -using Content.Server.Humanoid; +using System.Collections.Generic; +using System.Linq; +using Content.Server.Humanoid; using Content.Server.IdentityManagement; using Content.Shared._White.Wizard.Mirror; using Content.Shared.Humanoid; @@ -7,7 +9,9 @@ using Content.Shared.Interaction; using Content.Shared.Physics; using Content.Shared.Preferences; using Content.Shared.UserInterface; +using FastAccessors; using Robust.Server.GameObjects; +using Robust.Shared.GameObjects; using Robust.Shared.Player; namespace Content.Server._White.Wizard.Mirror; @@ -129,6 +133,8 @@ public sealed class WizardMirrorSystem : EntitySystem .Appearance.WithFacialHairColor(facialHair.MarkingColors[0])); } + profile = profile.WithCharacterAppearance(profile.Appearance.WithMarkings(humanoid.MarkingSet.GetForwardEnumerator().ToList())); + var state = new WizardMirrorUiState(profile); component.Target = targetUid;