Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Content.Client/Humanoid/HumanoidAppearanceSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public void UpdateSprite(Entity<HumanoidAppearanceComponent, SpriteComponent> en
// end Goobstation: port EE height/width sliders

sprite[_sprite.LayerMapReserve((entity.Owner, sprite), HumanoidVisualLayers.Eyes)].Color = humanoidAppearance.EyeColor;

RaiseLocalEvent(entity.Owner, new HumanoidAppearanceUpdatedEvent()); // Arcane
}

private static bool IsHidden(HumanoidAppearanceComponent humanoid, HumanoidVisualLayers layer)
Expand Down Expand Up @@ -265,6 +267,7 @@ public override void LoadProfile(EntityUid uid, HumanoidCharacterProfile? profil
humanoid.Height = profile.Height; // Goobstation: port EE height/width sliders
humanoid.Width = profile.Width; // Goobstation: port EE height/width sliders
humanoid.CustomSpeciesName = profile.CustomSpeciesName; // Arcane
humanoid.EarsAboveHair = profile.Appearance.EarsAboveHair; // Arcane

UpdateSprite((uid, humanoid, Comp<SpriteComponent>(uid)));
}
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/Humanoid/MarkingPicker.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ SPDX-License-Identifier: MIT
</BoxContainer>
</BoxContainer>

<!-- Ears above hair option -->
<CheckBox Name="CEarsAboveHair" Text="{Loc 'markings-ears-above-hair'}" Margin="0 5 0 0" />

<!-- Colors -->
<BoxContainer Name="CMarkingColors" Orientation="Vertical" Visible="False" />
</BoxContainer>
Expand Down
37 changes: 36 additions & 1 deletion Content.Client/Humanoid/MarkingPicker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public sealed partial class MarkingPicker : Control
public Action<MarkingSet>? OnMarkingRemoved;
public Action<MarkingSet>? OnMarkingColorChange;
public Action<MarkingSet>? OnMarkingRankChange;
public Action<bool>? OnEarsAboveHairChange; // Arcane

private List<Color> _currentMarkingColors = new();

Expand Down Expand Up @@ -71,6 +72,26 @@ public string IgnoreCategories

public bool Forced { get; set; }

// Arcane-Start
private bool _showEarsAboveHairOption;

public bool ShowEarsAboveHairOption
{
get => _showEarsAboveHairOption;
set
{
_showEarsAboveHairOption = value;
UpdateEarsAboveHairVisibility();
}
}

public bool EarsAboveHair
{
get => CEarsAboveHair.Pressed;
set => CEarsAboveHair.Pressed = value;
}
// Arcane-End

private bool _ignoreSpecies;

public bool IgnoreSpecies
Expand Down Expand Up @@ -147,6 +168,18 @@ public MarkingPicker()
CMarkingRankDown.OnPressed += _ => SwapMarkingDown();

CMarkingSearch.OnTextChanged += args => Populate(args.Text);

// Arcane-Start
CEarsAboveHair.OnToggled += args => OnEarsAboveHairChange?.Invoke(args.Pressed);
UpdateEarsAboveHairVisibility();
}

private void UpdateEarsAboveHairVisibility()
{
CEarsAboveHair.Visible = _showEarsAboveHairOption &&
(_selectedMarkingCategory == MarkingCategories.HeadTop ||
_selectedMarkingCategory == MarkingCategories.HeadSide);
// Arcane-End
}

private void SetupCategoryButtons()
Expand Down Expand Up @@ -180,6 +213,7 @@ private void SetupCategoryButtons()
{
_selectedMarkingCategory = MarkingCategories.Chest;
}
UpdateEarsAboveHairVisibility(); // Arcane
}

private string GetMarkingName(MarkingPrototype marking) => Loc.GetString($"marking-{marking.ID}");
Expand Down Expand Up @@ -388,6 +422,7 @@ private void OnCategoryChange(OptionButton.ItemSelectedEventArgs category)
Populate(CMarkingSearch.Text);
PopulateUsed();
UpdatePoints();
UpdateEarsAboveHairVisibility(); // Arcane
}

// TODO: This should be using ColorSelectorSliders once that's merged, so
Expand Down Expand Up @@ -576,4 +611,4 @@ private void MarkingRemove()
CMarkingColors.Visible = false;
OnMarkingRemoved?.Invoke(_currentMarkings);
}
}
}
16 changes: 16 additions & 0 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,10 @@ public HumanoidProfileEditor(
Markings.OnMarkingRemoved += OnMarkingChange;
Markings.OnMarkingColorChange += OnMarkingChange;
Markings.OnMarkingRankChange += OnMarkingChange;
// Arcane-Start
Markings.OnEarsAboveHairChange += OnEarsAboveHairChange;
Markings.ShowEarsAboveHairOption = true;
// Arcane-End

#endregion Markings

Expand Down Expand Up @@ -1931,6 +1935,17 @@ private void OnMarkingChange(MarkingSet markings)
ReloadProfilePreview();
}

// Arcane-Start
private void OnEarsAboveHairChange(bool newValue)
{
if (Profile is null)
return;

Profile = Profile.WithCharacterAppearance(Profile.Appearance.WithEarsAboveHair(newValue));
ReloadProfilePreview();
}
// Arcane-End

private void OnSkinColorOnValueChanged()
{
if (Profile is null) return;
Expand Down Expand Up @@ -2329,6 +2344,7 @@ private void UpdateMarkings()
Markings.SetData(Profile.Appearance.Markings, Profile.Species,
Profile.Sex, Profile.Appearance.SkinColor, Profile.Appearance.EyeColor
);
Markings.EarsAboveHair = Profile.Appearance.EarsAboveHair; // Arcane
}

private void UpdateGenderControls()
Expand Down
Loading
Loading