From: pathetic meowmeow Date: Tue, 20 Jan 2026 20:58:44 +0000 (-0500) Subject: Fix sexed organs (#42554) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=4216e29fdb2097d8a5459d2445d8639172da62c9;p=space-station-14.git Fix sexed organs (#42554) --- diff --git a/Content.Shared/Body/SharedVisualBodySystem.cs b/Content.Shared/Body/SharedVisualBodySystem.cs index 52f5bbfd5d..677d4f46dd 100644 --- a/Content.Shared/Body/SharedVisualBodySystem.cs +++ b/Content.Shared/Body/SharedVisualBodySystem.cs @@ -138,6 +138,12 @@ public abstract partial class SharedVisualBodySystem : EntitySystem SetOrganColor(ent, ent.Comp.Profile.EyeColor); else SetOrganColor(ent, ent.Comp.Profile.SkinColor); + + if (ent.Comp.SexStateOverrides is { } overrides && overrides.TryGetValue(data.Sex, out var state)) + { + ent.Comp.Data.State = state; + SetOrganAppearance(ent, ent.Comp.Data); + } } private void OnMarkingsOrganApplyMarkings(Entity ent, ref BodyRelayedEvent args) diff --git a/Content.Shared/Body/VisualOrganComponent.cs b/Content.Shared/Body/VisualOrganComponent.cs index 10214f9f2a..9ca2c36374 100644 --- a/Content.Shared/Body/VisualOrganComponent.cs +++ b/Content.Shared/Body/VisualOrganComponent.cs @@ -20,6 +20,12 @@ public sealed partial class VisualOrganComponent : Component [DataField(required: true), AutoNetworkedField, AlwaysPushInheritance] public PrototypeLayerData Data; + /// + /// When applying a profile, if the sex is present in this dictionary, overrides the state of the data. + /// + [DataField] + public Dictionary? SexStateOverrides; + [DataField, AutoNetworkedField] public OrganProfileData Profile = new(); } diff --git a/Resources/Prototypes/Body/Species/human.yml b/Resources/Prototypes/Body/Species/human.yml index aa67c15ec7..7c0ee31f32 100644 --- a/Resources/Prototypes/Body/Species/human.yml +++ b/Resources/Prototypes/Body/Species/human.yml @@ -124,11 +124,11 @@ group: Human - type: entity - parent: [ OrganBaseTorso, OrganHumanExternal ] + parent: [ OrganBaseTorsoSexed, OrganBaseTorso, OrganHumanExternal ] id: OrganHumanTorso - type: entity - parent: [ OrganBaseHead, OrganHumanExternal ] + parent: [ OrganBaseHeadSexed, OrganBaseHead, OrganHumanExternal ] id: OrganHumanHead - type: entity diff --git a/Resources/Prototypes/Body/Species/moth.yml b/Resources/Prototypes/Body/Species/moth.yml index 22c08d540f..a5a1874169 100644 --- a/Resources/Prototypes/Body/Species/moth.yml +++ b/Resources/Prototypes/Body/Species/moth.yml @@ -233,7 +233,7 @@ sprite: Mobs/Species/Moth/parts.rsi - type: entity - parent: [ OrganBaseTorso, OrganMothExternal ] + parent: [ OrganBaseTorsoSexed, OrganBaseTorso, OrganMothExternal ] id: OrganMothTorso - type: entity diff --git a/Resources/Prototypes/Body/Species/reptilian.yml b/Resources/Prototypes/Body/Species/reptilian.yml index 2c0d18056b..3dd25cf468 100644 --- a/Resources/Prototypes/Body/Species/reptilian.yml +++ b/Resources/Prototypes/Body/Species/reptilian.yml @@ -203,11 +203,11 @@ group: Reptilian - type: entity - parent: [ OrganBaseTorso, OrganReptilianExternal ] + parent: [ OrganBaseTorsoSexed, OrganBaseTorso, OrganReptilianExternal ] id: OrganReptilianTorso - type: entity - parent: [ OrganBaseHead, OrganReptilianExternal ] + parent: [ OrganBaseHeadSexed, OrganBaseHead, OrganReptilianExternal ] id: OrganReptilianHead - type: entity diff --git a/Resources/Prototypes/Body/Species/skeleton.yml b/Resources/Prototypes/Body/Species/skeleton.yml index dd2004aeba..ebe5bb6e28 100644 --- a/Resources/Prototypes/Body/Species/skeleton.yml +++ b/Resources/Prototypes/Body/Species/skeleton.yml @@ -204,7 +204,7 @@ group: Skeleton - type: entity - parent: [ OrganBaseTorso, OrganSkeletonPersonExternal ] + parent: [ OrganBaseTorsoSexed, OrganBaseTorso, OrganSkeletonPersonExternal ] id: OrganSkeletonPersonTorso - type: entity diff --git a/Resources/Prototypes/Body/Species/slime.yml b/Resources/Prototypes/Body/Species/slime.yml index fd238c5525..a72a949b77 100644 --- a/Resources/Prototypes/Body/Species/slime.yml +++ b/Resources/Prototypes/Body/Species/slime.yml @@ -210,7 +210,7 @@ group: Slime - type: entity - parent: [ OrganBaseTorso, OrganSlimePersonExternal ] + parent: [ OrganBaseTorsoSexed, OrganBaseTorso, OrganSlimePersonExternal ] id: OrganSlimePersonTorso - type: entity diff --git a/Resources/Prototypes/Body/Species/vulpkanin.yml b/Resources/Prototypes/Body/Species/vulpkanin.yml index 2e3557c8d7..9209e4c8b7 100644 --- a/Resources/Prototypes/Body/Species/vulpkanin.yml +++ b/Resources/Prototypes/Body/Species/vulpkanin.yml @@ -234,7 +234,7 @@ sprite: Mobs/Species/Vulpkanin/parts.rsi - type: entity - parent: [ OrganBaseTorso, OrganVulpkaninExternal ] + parent: [ OrganBaseTorsoSexed, OrganBaseTorso, OrganVulpkaninExternal ] id: OrganVulpkaninTorso - type: entity diff --git a/Resources/Prototypes/Body/base_organs.yml b/Resources/Prototypes/Body/base_organs.yml index 1dca7f2a0e..0a5607acef 100644 --- a/Resources/Prototypes/Body/base_organs.yml +++ b/Resources/Prototypes/Body/base_organs.yml @@ -31,11 +31,11 @@ - type: Organ category: Torso - type: Sprite - state: torso_m + state: torso - type: VisualOrgan layer: enum.HumanoidVisualLayers.Chest data: - state: torso_m + state: torso - type: VisualOrganMarkings markingData: layers: @@ -54,11 +54,11 @@ - type: Organ category: Head - type: Sprite - state: head_m + state: head - type: VisualOrgan layer: enum.HumanoidVisualLayers.Head data: - state: head_m + state: head - type: VisualOrganMarkings markingData: layers: @@ -435,3 +435,29 @@ components: - type: Sprite sprite: Mobs/Species/Human/organs.rsi + +- type: entity + id: OrganBaseHeadSexed + abstract: true + components: + - type: Sprite + state: head_m + - type: VisualOrgan + data: + state: head_m + sexStateOverrides: + Male: head_m + Female: head_f + +- type: entity + id: OrganBaseTorsoSexed + abstract: true + components: + - type: Sprite + state: torso_m + - type: VisualOrgan + data: + state: torso_m + sexStateOverrides: + Male: torso_m + Female: torso_f diff --git a/Resources/Prototypes/Species/diona.yml b/Resources/Prototypes/Species/diona.yml index 6dfd358720..880cdfdf84 100644 --- a/Resources/Prototypes/Species/diona.yml +++ b/Resources/Prototypes/Species/diona.yml @@ -10,3 +10,5 @@ femaleFirstNames: NamesDionaFirst lastNames: NamesDionaLast naming: TheFirstofLast + sexes: + - Unsexed diff --git a/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/head_f.png b/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/head.png similarity index 100% rename from Resources/Textures/Mobs/Species/Arachnid/parts.rsi/head_f.png rename to Resources/Textures/Mobs/Species/Arachnid/parts.rsi/head.png diff --git a/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/head_m.png b/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/head_m.png deleted file mode 100644 index 505fd68dff..0000000000 Binary files a/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/head_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/meta.json b/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/meta.json index a09c655a2b..12734b6c6a 100644 --- a/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/meta.json +++ b/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/meta.json @@ -11,11 +11,7 @@ "name": "full" }, { - "name": "head_f", - "directions": 4 - }, - { - "name": "head_m", + "name": "head", "directions": 4 }, { @@ -51,11 +47,7 @@ "directions": 4 }, { - "name": "torso_f", - "directions": 4 - }, - { - "name": "torso_m", + "name": "torso", "directions": 4 }, { diff --git a/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/torso_f.png b/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/torso.png similarity index 100% rename from Resources/Textures/Mobs/Species/Arachnid/parts.rsi/torso_f.png rename to Resources/Textures/Mobs/Species/Arachnid/parts.rsi/torso.png diff --git a/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/torso_m.png b/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/torso_m.png deleted file mode 100644 index 10f3a3b0e4..0000000000 Binary files a/Resources/Textures/Mobs/Species/Arachnid/parts.rsi/torso_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Diona/parts.rsi/head_f.png b/Resources/Textures/Mobs/Species/Diona/parts.rsi/head.png similarity index 100% rename from Resources/Textures/Mobs/Species/Diona/parts.rsi/head_f.png rename to Resources/Textures/Mobs/Species/Diona/parts.rsi/head.png diff --git a/Resources/Textures/Mobs/Species/Diona/parts.rsi/head_m.png b/Resources/Textures/Mobs/Species/Diona/parts.rsi/head_m.png deleted file mode 100644 index 21bf1c4757..0000000000 Binary files a/Resources/Textures/Mobs/Species/Diona/parts.rsi/head_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Diona/parts.rsi/meta.json b/Resources/Textures/Mobs/Species/Diona/parts.rsi/meta.json index bc90b509a1..1c6e521c5f 100644 --- a/Resources/Textures/Mobs/Species/Diona/parts.rsi/meta.json +++ b/Resources/Textures/Mobs/Species/Diona/parts.rsi/meta.json @@ -11,11 +11,7 @@ "name": "full" }, { - "name": "head_f", - "directions": 4 - }, - { - "name": "head_m", + "name": "head", "directions": 4 }, { @@ -51,11 +47,7 @@ "directions": 4 }, { - "name": "torso_f", - "directions": 4 - }, - { - "name": "torso_m", + "name": "torso", "directions": 4 } ] diff --git a/Resources/Textures/Mobs/Species/Diona/parts.rsi/torso_f.png b/Resources/Textures/Mobs/Species/Diona/parts.rsi/torso.png similarity index 100% rename from Resources/Textures/Mobs/Species/Diona/parts.rsi/torso_f.png rename to Resources/Textures/Mobs/Species/Diona/parts.rsi/torso.png diff --git a/Resources/Textures/Mobs/Species/Diona/parts.rsi/torso_m.png b/Resources/Textures/Mobs/Species/Diona/parts.rsi/torso_m.png deleted file mode 100644 index 6aaf688a4a..0000000000 Binary files a/Resources/Textures/Mobs/Species/Diona/parts.rsi/torso_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/head_f.png b/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/head.png similarity index 100% rename from Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/head_f.png rename to Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/head.png diff --git a/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/head_m.png b/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/head_m.png deleted file mode 100644 index 5d0a951379..0000000000 Binary files a/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/head_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/meta.json b/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/meta.json index fec31a494d..8ddf28a359 100644 --- a/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/meta.json +++ b/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/meta.json @@ -11,11 +11,7 @@ "name": "full" }, { - "name": "head_f", - "directions": 4 - }, - { - "name": "head_m", + "name": "head", "directions": 4 }, { @@ -51,11 +47,7 @@ "directions": 4 }, { - "name": "torso_f", - "directions": 4 - }, - { - "name": "torso_m", + "name": "torso", "directions": 4 } ] diff --git a/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/torso_f.png b/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/torso.png similarity index 100% rename from Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/torso_f.png rename to Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/torso.png diff --git a/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/torso_m.png b/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/torso_m.png deleted file mode 100644 index bde0508ffd..0000000000 Binary files a/Resources/Textures/Mobs/Species/Gingerbread/parts.rsi/torso_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Moth/parts.rsi/head_f.png b/Resources/Textures/Mobs/Species/Moth/parts.rsi/head.png similarity index 100% rename from Resources/Textures/Mobs/Species/Moth/parts.rsi/head_f.png rename to Resources/Textures/Mobs/Species/Moth/parts.rsi/head.png diff --git a/Resources/Textures/Mobs/Species/Moth/parts.rsi/head_m.png b/Resources/Textures/Mobs/Species/Moth/parts.rsi/head_m.png deleted file mode 100644 index 6788ca0c00..0000000000 Binary files a/Resources/Textures/Mobs/Species/Moth/parts.rsi/head_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Moth/parts.rsi/meta.json b/Resources/Textures/Mobs/Species/Moth/parts.rsi/meta.json index 016f008fc9..4e15818415 100644 --- a/Resources/Textures/Mobs/Species/Moth/parts.rsi/meta.json +++ b/Resources/Textures/Mobs/Species/Moth/parts.rsi/meta.json @@ -11,11 +11,7 @@ "name": "full" }, { - "name": "head_f", - "directions": 4 - }, - { - "name": "head_m", + "name": "head", "directions": 4 }, { diff --git a/Resources/Textures/Mobs/Species/Skeleton/parts.rsi/head_f.png b/Resources/Textures/Mobs/Species/Skeleton/parts.rsi/head.png similarity index 100% rename from Resources/Textures/Mobs/Species/Skeleton/parts.rsi/head_f.png rename to Resources/Textures/Mobs/Species/Skeleton/parts.rsi/head.png diff --git a/Resources/Textures/Mobs/Species/Skeleton/parts.rsi/head_m.png b/Resources/Textures/Mobs/Species/Skeleton/parts.rsi/head_m.png deleted file mode 100644 index af813d888a..0000000000 Binary files a/Resources/Textures/Mobs/Species/Skeleton/parts.rsi/head_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Skeleton/parts.rsi/meta.json b/Resources/Textures/Mobs/Species/Skeleton/parts.rsi/meta.json index 78e0a89e04..f05aabbe0c 100644 --- a/Resources/Textures/Mobs/Species/Skeleton/parts.rsi/meta.json +++ b/Resources/Textures/Mobs/Species/Skeleton/parts.rsi/meta.json @@ -11,11 +11,7 @@ "name": "full" }, { - "name": "head_f", - "directions": 4 - }, - { - "name": "head_m", + "name": "head", "directions": 4 }, { diff --git a/Resources/Textures/Mobs/Species/Slime/parts.rsi/head_f.png b/Resources/Textures/Mobs/Species/Slime/parts.rsi/head.png similarity index 100% rename from Resources/Textures/Mobs/Species/Slime/parts.rsi/head_f.png rename to Resources/Textures/Mobs/Species/Slime/parts.rsi/head.png diff --git a/Resources/Textures/Mobs/Species/Slime/parts.rsi/head_m.png b/Resources/Textures/Mobs/Species/Slime/parts.rsi/head_m.png deleted file mode 100644 index 317d91c520..0000000000 Binary files a/Resources/Textures/Mobs/Species/Slime/parts.rsi/head_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Slime/parts.rsi/meta.json b/Resources/Textures/Mobs/Species/Slime/parts.rsi/meta.json index a7822a9e6c..4304f0afd8 100644 --- a/Resources/Textures/Mobs/Species/Slime/parts.rsi/meta.json +++ b/Resources/Textures/Mobs/Species/Slime/parts.rsi/meta.json @@ -11,11 +11,7 @@ "name": "full" }, { - "name": "head_f", - "directions": 4 - }, - { - "name": "head_m", + "name": "head", "directions": 4 }, { diff --git a/Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/head_f.png b/Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/head.png similarity index 100% rename from Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/head_f.png rename to Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/head.png diff --git a/Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/head_m.png b/Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/head_m.png deleted file mode 100644 index dae646062b..0000000000 Binary files a/Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/head_m.png and /dev/null differ diff --git a/Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/meta.json b/Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/meta.json index fb445e85a1..c2eb0e3b26 100644 --- a/Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/meta.json +++ b/Resources/Textures/Mobs/Species/Vulpkanin/parts.rsi/meta.json @@ -14,11 +14,7 @@ "name": "icon" }, { - "name": "head_f", - "directions": 4 - }, - { - "name": "head_m", + "name": "head", "directions": 4 }, {