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>

# 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
This commit is contained in:
pathetic meowmeow
2026-06-29 12:43:35 +02:00
committed by Coryler
parent 4f85f1b483
commit c57721eca5
196 changed files with 9583 additions and 8052 deletions
+48
View File
@@ -0,0 +1,48 @@
using System.Numerics;
using Robust.Shared.Containers;
using Robust.Shared.Map;
namespace Content.Shared.Body;
public sealed class InitialBodySystem : EntitySystem
{
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<InitialBodyComponent, MapInitEvent>(OnMapInit);
}
private void OnMapInit(Entity<InitialBodyComponent> ent, ref MapInitEvent args)
{
if (!TryComp<ContainerManagerComponent>(ent, out var containerComp))
return;
if (TerminatingOrDeleted(ent) || !Exists(ent))
return;
if (!_container.TryGetContainer(ent, BodyComponent.ContainerID, out var container, containerComp))
{
Log.Error($"Entity {ToPrettyString(ent)} with a {nameof(InitialBodyComponent)} is missing a container ({BodyComponent.ContainerID}).");
return;
}
var xform = Transform(ent);
var coords = new EntityCoordinates(ent, Vector2.Zero);
foreach (var proto in ent.Comp.Organs.Values)
{
// TODO: When e#6192 is merged replace this all with TrySpawnInContainer...
var spawn = Spawn(proto, coords);
if (!_container.Insert(spawn, container, containerXform: xform))
{
Log.Error($"Entity {ToPrettyString(ent)} with a {nameof(InitialBodyComponent)} failed to insert an entity: {ToPrettyString(spawn)}.\n");
Del(spawn);
}
}
}
}