mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-15 03:31:30 +01:00
* 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>
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using Content.Client.Humanoid;
|
|
using Content.Shared.MagicMirror;
|
|
using Robust.Client.UserInterface;
|
|
|
|
namespace Content.Client.MagicMirror;
|
|
|
|
public sealed class MagicMirrorBoundUserInterface : BoundUserInterface
|
|
{
|
|
[ViewVariables]
|
|
private MagicMirrorWindow? _window;
|
|
|
|
private readonly MarkingsViewModel _markingsModel = new();
|
|
|
|
public MagicMirrorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
|
{
|
|
}
|
|
|
|
protected override void Open()
|
|
{
|
|
base.Open();
|
|
|
|
_window = this.CreateWindow<MagicMirrorWindow>();
|
|
_window.MarkingsPicker.SetModel(_markingsModel);
|
|
|
|
_markingsModel.MarkingsChanged += (_, _) =>
|
|
{
|
|
SendMessage(new MagicMirrorSelectMessage(_markingsModel.Markings));
|
|
};
|
|
}
|
|
|
|
protected override void UpdateState(BoundUserInterfaceState state)
|
|
{
|
|
base.UpdateState(state);
|
|
|
|
if (state is not MagicMirrorUiState data)
|
|
return;
|
|
|
|
_markingsModel.OrganData = data.OrganMarkingData;
|
|
_markingsModel.OrganProfileData = data.OrganProfileData;
|
|
_markingsModel.Markings = data.AppliedMarkings;
|
|
}
|
|
}
|
|
|