Refactors MODsuit module rendering and allows overslotted parts to show items they overslot when unsealed (#90414)

## About The Pull Request

MODsuit modules now render on the part they're attached to, that being
first part if required_slots is set, otherwise defaulting to the control
module. Instead of using icon ops and a cache, module masking (used by
armor boosters and insignias) will instead render the module on all
parts, each overlay alpha filtered using the worn piece as the mask. To
do this we also migrate modules to separate_worn_overlays, which fixes
the issue where they'd always get painted the same color as the back
piece, ignoring use_mod_colors's value (which is FALSE by default). So
now modules that inherit MOD's color like armor booster will be painted
accordingly to their piece.
This also means that modules actually layer properly, and don't go ontop
of items that they should be under.

Additionally, whenever gloves or boots overslot an item, the overslotted
item will still render underneath them if they're unsealed. Because it
looks weird when your gloves disappear when you extend your MODsuit
ones.


![dreamseeker_BaWjJBcMVO](https://github.com/user-attachments/assets/2b374913-7761-4b54-9bbd-cbd57d343fd6)

Look at that hip look, she'd have bare hands and ankles without this PR.

Closes #90370

## Why It's Good For The Game

Fixes a bunch of visual jank that looks weird, and overslotting
displaying overslotted item is just behavior you'd expect normally.

## Changelog
🆑
add: When a MODsuit piece overslots an item, it will now render beneath
that piece as long as its unsealed.
refactor: Refactored how MODsuit modules are rendered, report any bugs
on GitHub!
/🆑
This commit is contained in:
SmArtKar
2025-04-15 10:21:10 +02:00
committed by GitHub
parent f6cf7a03c5
commit b49553bdf4
19 changed files with 234 additions and 147 deletions
+5 -42
View File
@@ -114,49 +114,12 @@
var/obj/item/worn_item = worn_items[slot_flag]
if(!worn_item)
continue
var/default_layer = 0
var/default_icon = null
var/default_icon = get_default_icon_by_slot(text2num(slot_flag))
var/default_layer = get_default_layer_by_slot(text2num(slot_flag))
var/female_icon = NO_FEMALE_UNIFORM
switch(text2num(slot_flag)) //this kinda sucks because build worn icon kinda sucks
if(ITEM_SLOT_HEAD)
default_layer = HEAD_LAYER
default_icon = 'icons/mob/clothing/head/default.dmi'
if(ITEM_SLOT_EYES)
default_layer = GLASSES_LAYER
default_icon = 'icons/mob/clothing/eyes.dmi'
if(ITEM_SLOT_EARS)
default_layer = EARS_LAYER
default_icon = 'icons/mob/clothing/ears.dmi'
if(ITEM_SLOT_MASK)
default_layer = FACEMASK_LAYER
default_icon = 'icons/mob/clothing/mask.dmi'
if(ITEM_SLOT_NECK)
default_layer = NECK_LAYER
default_icon = 'icons/mob/clothing/neck.dmi'
if(ITEM_SLOT_BACK)
default_layer = BACK_LAYER
default_icon = 'icons/mob/clothing/back.dmi'
if(ITEM_SLOT_BELT)
default_layer = BELT_LAYER
default_icon = 'icons/mob/clothing/belt.dmi'
if(ITEM_SLOT_ID)
default_layer = ID_LAYER
default_icon = 'icons/mob/clothing/id.dmi'
if(ITEM_SLOT_ICLOTHING)
default_layer = UNIFORM_LAYER
default_icon = DEFAULT_UNIFORM_FILE
if(body_type == FEMALE && istype(worn_item, /obj/item/clothing/under))
var/obj/item/clothing/under/worn_jumpsuit = worn_item
female_icon = worn_jumpsuit.female_sprite_flags
if(ITEM_SLOT_OCLOTHING)
default_layer = SUIT_LAYER
default_icon = DEFAULT_SUIT_FILE
if(ITEM_SLOT_GLOVES)
default_layer = GLOVES_LAYER
default_icon = 'icons/mob/clothing/hands.dmi'
if(ITEM_SLOT_FEET)
default_layer = SHOES_LAYER
default_icon = DEFAULT_SHOES_FILE
if(body_type == FEMALE && istype(worn_item, /obj/item/clothing/under))
var/obj/item/clothing/under/worn_jumpsuit = worn_item
female_icon = worn_jumpsuit.female_sprite_flags
. += worn_item.build_worn_icon(default_layer, default_icon, female_uniform = female_icon)
/obj/structure/mannequin/attack_hand_secondary(mob/user, list/modifiers)