mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 16:47:26 +00: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> # Conflicts: # Content.Server/Humanoid/Components/RandomHumanoidAppearanceComponent.cs # Content.Server/Humanoid/Systems/RandomHumanoidAppearanceSystem.cs # Conflicts: # Resources/Prototypes/Species/diona.yml # Conflicts: # Content.Server/Zombies/ZombieSystem.Transform.cs
69 lines
1.7 KiB
C#
69 lines
1.7 KiB
C#
using System.Linq;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
namespace Content.Client.Humanoid;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class MarkingPicker : Control
|
|
{
|
|
private MarkingsViewModel? _markingsModel;
|
|
|
|
public MarkingPicker()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
IoCManager.InjectDependencies(this);
|
|
|
|
UpdateMarkings();
|
|
}
|
|
|
|
public void SetModel(MarkingsViewModel model)
|
|
{
|
|
_markingsModel = model;
|
|
|
|
_markingsModel.OrganDataChanged += UpdateMarkings;
|
|
_markingsModel.EnforcementsChanged += UpdateMarkings;
|
|
}
|
|
|
|
protected override void EnteredTree()
|
|
{
|
|
base.EnteredTree();
|
|
|
|
_markingsModel?.OrganDataChanged += UpdateMarkings;
|
|
_markingsModel?.EnforcementsChanged += UpdateMarkings;
|
|
}
|
|
|
|
protected override void ExitedTree()
|
|
{
|
|
base.ExitedTree();
|
|
|
|
_markingsModel?.OrganDataChanged -= UpdateMarkings;
|
|
_markingsModel?.EnforcementsChanged -= UpdateMarkings;
|
|
}
|
|
|
|
private void UpdateMarkings()
|
|
{
|
|
if (_markingsModel is null)
|
|
return;
|
|
|
|
OrganTabs.RemoveAllChildren();
|
|
|
|
var i = 0;
|
|
foreach (var (organ, organData) in _markingsModel.OrganData)
|
|
{
|
|
var control = new OrganMarkingPicker(_markingsModel, organ, organData.Layers, organData.Group);
|
|
if (control.Empty)
|
|
continue;
|
|
|
|
OrganTabs.AddChild(control);
|
|
OrganTabs.SetTabTitle(i, Loc.GetString($"markings-organ-{organ.Id}"));
|
|
i++;
|
|
}
|
|
|
|
if (i > 0)
|
|
OrganTabs.CurrentTab = 0;
|
|
OrganTabs.TabsVisible = i > 1;
|
|
}
|
|
}
|