Files
space-station-14/Content.Client/Humanoid/HumanoidMarkingModifierBoundUserInterface.cs
pathetic meowmeow 8cf744ec55 Visual nubody (humanoid appearance refactor) (#42476)
* initial visual nubody

* oops overlay

* im so pheeming rn

* conversion...

* tests

* comeback of the underwear

* oops eyes

* blabbl

* zeds

* yaml linted

* search and visible count constraints

* reordering

* preserve previously selected markings colors

* fix test

* some ui niceties

* ordering

* make DB changes backwards-compatible/downgrade-friendly

* fix things again

* fix migration

* vulpkanin markings limit increase

* wrapping

* code cleanup and more code cleanup and more code cleanup and more code cleanup and

* fix slop ports

* better sampling API

* make filter work + use the method i made for its intended purpose

* fix test fails real quick

* magic mirror cleanup, remove TODO

* don't 0-init the organ profile data

* remove deltastates

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2026-01-20 07:07:53 +00:00

52 lines
1.6 KiB
C#

using Content.Shared.Humanoid;
using Robust.Client.UserInterface;
namespace Content.Client.Humanoid;
// Marking BUI.
// Do not use this in any non-privileged instance. This just replaces an entire marking set
// with the set sent over.
public sealed class HumanoidMarkingModifierBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private HumanoidMarkingModifierWindow? _window;
private readonly MarkingsViewModel _markingsModel = new();
public HumanoidMarkingModifierBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = this.CreateWindowCenteredLeft<HumanoidMarkingModifierWindow>();
_window.MarkingPickerWidget.SetModel(_markingsModel);
_window.RespectLimits.OnPressed += args => _markingsModel.EnforceLimits = args.Button.Pressed;
_window.RespectGroupSex.OnPressed += args => _markingsModel.EnforceGroupAndSexRestrictions = args.Button.Pressed;
_markingsModel.MarkingsChanged += (_, _) => SendMarkingSet();
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (_window == null || state is not HumanoidMarkingModifierState cast)
return;
_markingsModel.OrganData = cast.OrganData;
_markingsModel.OrganProfileData = cast.OrganProfileData;
_markingsModel.Markings = cast.Markings;
}
private void SendMarkingSet()
{
SendMessage(new HumanoidMarkingModifierMarkingSetMessage(_markingsModel.Markings));
}
}