Add new sprites and coloring methods for basic jumpsuits. (#31568)

* Add new sprites and coloring methods for basic jumpsuits.

* Move palettes to dye_registry.dm. Add palette keys to jumpskirts.

* Add colored inhands, inventory sprites, icon and palette updates.

* Add jumpskirt item sprite.

* Add prisoner jumpsuit, psychedelic jumpsuit, random jumpskirt.
- Add new sprites for prisoner jumpsuits, skirts, and their rolldowns.
- Generate psychedelic jumpsuit icon in code, using colors it was originally composed of overlayed on the white jumpsuit.
- Add psychedelic jumpskirt, rolldowns, and inhands, since they are now easy to generate.
- Add a subtype for random jumpskirts patterned after random jumpsuits.
- Tweak orange color palette.
- Ensure randomized jumpsuits and skirts get the proper names and descriptions.

* Add dummy psychedelic suit sprites to satisfy linters.

* Attempt dyeing. Cleanup icon states. Update references.
- Moves jumpsuit coloring out of human_update_icons.dm to color.dm and updates dyeing.dm to hopefully enable dyeing. In the current state it only colors object sprites properly.
- Deletes icon states that will no longer be used for each solid color jumpsuit.
- Updates references to old icon states in datacore.dm, character.dm, and chameleon.dm to the white icon with a swapped palette where possible.

* Thanks, linters.

* Thanks, linters. part 2

* Fix dyeing. Add misc prison jumpsuit sprites.

* Dye chameleon jumpsuit when it mimics colored jumpsuit.

* Eliminate chameleon lag by caching jumpsuit icons.

* Add missing keyword args. Thanks, linters.

* Replace resistance flags in black jumpsuit.

Signed-off-by: Alan <alfalfascout@users.noreply.github.com>

* Tweak jumpskirt shading on south humans and greys.

---------

Signed-off-by: Alan <alfalfascout@users.noreply.github.com>
This commit is contained in:
Alan
2026-03-22 22:24:02 +00:00
committed by GitHub
parent aaeb5fdf28
commit 392202d691
19 changed files with 309 additions and 71 deletions
@@ -0,0 +1,58 @@
/datum/asset/icon_cache/clothing
var/list/sprite_sheets = list()
/datum/asset/icon_cache/clothing/New()
. = ..()
for(var/each_subtype in subtypesof(/obj/item/clothing/under/color))
var/obj/item/clothing/under/color/jumpsuit_type = each_subtype
// If it doesn't have a palette key, the icon already exists and we don't need to generate it again.
// UNLESS it's the psychedelic jumpsuits.
var/is_psychedelic = jumpsuit_type::icon_state == "psyche" || jumpsuit_type::icon_state == "psycheskirt"
if(!jumpsuit_type::icon_palette_key && !is_psychedelic)
continue
var/palette_keys = is_psychedelic ? list(DYE_DARKBLUE, DYE_RED, DYE_BLACK, DYE_YELLOW, DYE_AQUA, DYE_PURPLE, DYE_LIGHTGREEN, DYE_PINK) : list(jumpsuit_type::icon_palette_key)
var/registry_key = ispath(jumpsuit_type, /obj/item/clothing/under/color/jumpskirt) ? DYE_REGISTRY_JUMPSKIRT : DYE_REGISTRY_UNDER
var/list/all_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/under/color.dmi',
"Skkulakin" = 'icons/mob/clothing/species/skkulakin/under/color.dmi',
"Drask" = 'icons/mob/clothing/species/drask/under/color.dmi',
"Grey" = 'icons/mob/clothing/species/grey/under/color.dmi',
"Kidan" = 'icons/mob/clothing/species/kidan/under/color.dmi',
"Human" = jumpsuit_type::worn_icon,
"Obj" = jumpsuit_type::icon,
"Lefthand" = jumpsuit_type::lefthand_file,
"Righthand" = jumpsuit_type::righthand_file)
var/list/state_names = list(jumpsuit_type::icon_state,
"[jumpsuit_type::worn_icon_state || jumpsuit_type::icon_state]_s",
"[jumpsuit_type::worn_icon_state || jumpsuit_type::icon_state]_d_s",
jumpsuit_type::inhand_icon_state,)
// For every sprite sheet...
for(var/sheet_key in all_sheets)
var/filepath = all_sheets[sheet_key]
var/icon/jumpsuit = new(filepath)
var/icon/new_suit = new()
// If each icon state exists in the file...
for(var/white_state in state_names)
if(!white_state)
continue
if(!(white_state in jumpsuit.IconStates()))
continue
// For every frame of color we need to dye it...
for(var/frame_num in 1 to length(palette_keys))
// Dye it the color we want.
var/icon/colored_icon = new(filepath, white_state)
colored_icon.swap_palette(
GLOB.palette_registry[registry_key][jumpsuit_type::default_palette_key],
GLOB.palette_registry[registry_key][palette_keys[frame_num]]
)
new_suit.Insert(colored_icon, white_state, frame = frame_num, delay = 1)
// Set the new sprite we just made to the one this jumpsuit uses.
all_sheets[sheet_key] = new_suit
var/suit_key = is_psychedelic ? jumpsuit_type::icon_state : jumpsuit_type::icon_palette_key
if(!sprite_sheets[registry_key])
sprite_sheets[registry_key] = list()
sprite_sheets[registry_key][suit_key] = all_sheets
+2 -1
View File
@@ -1062,7 +1062,8 @@
var/has_gloves = FALSE
if(job_support_low & JOB_ASSISTANT) //This gives the preview icon clothes depending on which job(if any) is set to 'high'
clothes_s = new /icon('icons/mob/clothing/under/color.dmi', "grey_s")
clothes_s = new /icon('icons/mob/clothing/under/color.dmi', "color_s")
clothes_s.swap_palette(PALETTE_JS_WHITE, PALETTE_JS_GREY)
clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "black"), ICON_UNDERLAY)
if(backbag == 2)
clothes_s.Blend(new /icon('icons/mob/clothing/back.dmi', "backpack"), ICON_OVERLAY)
+16 -6
View File
@@ -185,6 +185,7 @@
target.name = initial(picked_item.name)
target.desc = initial(picked_item.desc)
target.icon_state = initial(picked_item.icon_state)
target.icon = initial(picked_item.icon)
if(isitem(target))
var/obj/item/I = target
@@ -202,14 +203,20 @@
else
I.sprite_sheets = null
if(isclothing(I) && isclothing(picked_item))
if(isclothing(I) && ispath(picked_item, /obj/item/clothing))
var/obj/item/clothing/CL = I
var/obj/item/clothing/PCL = picked_item
CL.flags_cover = initial(PCL.flags_cover)
if(istype(I, /obj/item/clothing/under) && ispath(picked_item, /obj/item/clothing/under/color))
var/obj/item/clothing/under/color/colored_jumpsuit = picked_item
if(colored_jumpsuit.icon_palette_key)
var/obj/item/clothing/under/target_jumpsuit = I
target_jumpsuit.set_icon_from_cache(palette_key = colored_jumpsuit::icon_palette_key, dye_key = colored_jumpsuit::dyeing_key)
else if(ispath(colored_jumpsuit, /obj/item/clothing/under/color/psyche) || ispath(colored_jumpsuit, /obj/item/clothing/under/color/jumpskirt/psyche))
var/obj/item/clothing/under/target_jumpsuit = I
target_jumpsuit.set_icon_from_cache(palette_key = colored_jumpsuit::icon_state, dye_key = colored_jumpsuit::dyeing_key)
I.update_appearance()
target.icon = initial(picked_item.icon)
/datum/action/item_action/chameleon_change/Trigger(left_click)
if(!IsAvailable())
return
@@ -232,12 +239,12 @@
random_look(owner)
/obj/item/clothing/under/chameleon
name = "black jumpsuit"
name = "white jumpsuit"
desc = "It's a plain jumpsuit. It has a small dial on the wrist."
icon = 'icons/obj/clothing/under/color.dmi'
icon_state = "black"
icon_state = "color"
worn_icon = 'icons/mob/clothing/under/color.dmi'
inhand_icon_state = "bl_suit"
inhand_icon_state = "color_suit"
random_sensor = FALSE
resistance_flags = NONE
armor = list(MELEE = 5, BULLET = 5, LASER = 5, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 50, ACID = 50)
@@ -260,6 +267,9 @@
/obj/item/clothing/under/dress,
/obj/item/clothing/under/pants,
/obj/item/clothing/under/color,
/obj/item/clothing/under/color/random,
/obj/item/clothing/under/color/jumpskirt,
/obj/item/clothing/under/color/jumpskirt/random,
/obj/item/clothing/under/retro,
/obj/item/clothing/under/solgov,
/obj/item/clothing/under/suit,
+113 -58
View File
@@ -2,7 +2,11 @@
desc = "A standard issue colored jumpsuit. Variety is the spice of life!"
icon = 'icons/obj/clothing/under/color.dmi'
worn_icon = 'icons/mob/clothing/under/color.dmi'
icon_state = "color"
inhand_icon_state = "color_suit"
dyeable = TRUE
var/default_palette_key = DYE_WHITE
var/icon_palette_key = null
sprite_sheets = list(
"Vox" = 'icons/mob/clothing/species/vox/under/color.dmi',
"Skkulakin" = 'icons/mob/clothing/species/skkulakin/under/color.dmi',
@@ -14,10 +18,43 @@
/obj/item/clothing/under/color/jumpskirt
desc = "A standard issue colored jumpskirt. Variety is the spice of life!"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
icon_state = "colorskirt"
dyeing_key = DYE_REGISTRY_JUMPSKIRT
/obj/item/clothing/under/color/random/Initialize(mapload)
/obj/item/clothing/under/color/Initialize(mapload)
. = ..()
update_icon()
/obj/item/clothing/under/color/update_icon()
. = ..()
set_icon_from_cache()
/obj/item/clothing/under/proc/set_icon_from_cache(palette_key = null, dye_key = null)
if(!palette_key && ("icon_palette_key" in vars))
var/obj/item/clothing/under/color/colored_jumpsuit = src
palette_key = palette_key || colored_jumpsuit.icon_palette_key
if(!palette_key)
return FALSE
dye_key = dye_key || dyeing_key
if(!GLOB.palette_registry[dye_key])
stack_trace("Item just tried to be colored with an invalid registry key: [dye_key]")
var/datum/asset/icon_cache/clothing/icon_cache = get_asset_datum(/datum/asset/icon_cache/clothing/)
// Set icons
for(var/sheet_key in sprite_sheets)
sprite_sheets[sheet_key] = icon_cache.sprite_sheets[dye_key][palette_key][sheet_key]
icon = icon_cache.sprite_sheets[dye_key][palette_key]["Obj"]
worn_icon = icon_cache.sprite_sheets[dye_key][palette_key]["Human"]
lefthand_file = icon_cache.sprite_sheets[dye_key][palette_key]["Lefthand"]
righthand_file = icon_cache.sprite_sheets[dye_key][palette_key]["Righthand"]
// Set icon states
var/icon_state_prefix = findtext(palette_key, "psyche") ? "psyche" : "color"
var/icon_state_skirt = dye_key == "under" ? "" : "skirt"
icon_state = "[icon_state_prefix][icon_state_skirt]"
inhand_icon_state = "[icon_state_prefix]_suit"
/obj/item/clothing/under/color/random/Initialize(mapload)
var/list/excluded = list(/obj/item/clothing/under/color/random,
/obj/item/clothing/under/color/blue/dodgeball,
/obj/item/clothing/under/color/orange/prison,
@@ -28,48 +65,57 @@
var/obj/item/clothing/under/color/C = pick(subtypesof(/obj/item/clothing/under/color) - typesof(/obj/item/clothing/under/color/jumpskirt) - excluded)
name = initial(C.name)
icon_state = initial(C.icon_state)
icon_palette_key = initial(C.icon_palette_key)
inhand_icon_state = initial(C.inhand_icon_state)
. = ..()
if(C == /obj/item/clothing/under/color/psyche)
set_icon_from_cache(palette_key = "psyche")
/obj/item/clothing/under/color/jumpskirt/random/Initialize(mapload)
var/list/excluded = list(/obj/item/clothing/under/color/jumpskirt/random,
/obj/item/clothing/under/color/jumpskirt/orange/prison,)
var/obj/item/clothing/under/color/C = pick(subtypesof(/obj/item/clothing/under/color/jumpskirt) - excluded)
name = initial(C.name)
icon_state = initial(C.icon_state)
icon_palette_key = initial(C.icon_palette_key)
inhand_icon_state = initial(C.inhand_icon_state)
. = ..()
if(C == /obj/item/clothing/under/color/jumpskirt/psyche)
set_icon_from_cache(palette_key = "psycheskirt")
/obj/item/clothing/under/color/black
name = "black jumpsuit"
icon_state = "black"
inhand_icon_state = "bl_suit"
icon_palette_key = DYE_BLACK
resistance_flags = NONE
/obj/item/clothing/under/color/jumpskirt/black
name = "black jumpskirt"
icon_state = "blackskirt"
inhand_icon_state = "bl_suit"
icon_palette_key = DYE_BLACK
resistance_flags = NONE // I am going to assume this is here for a reason
/obj/item/clothing/under/color/blue
name = "blue jumpsuit"
icon_state = "blue"
inhand_icon_state = "b_suit"
icon_palette_key = DYE_BLUE
/obj/item/clothing/under/color/jumpskirt/blue
name = "blue jumpskirt"
icon_state = "blueskirt"
inhand_icon_state = "b_suit"
icon_palette_key = DYE_BLUE
/obj/item/clothing/under/color/blue/dodgeball
flags = NODROP
/obj/item/clothing/under/color/green
name = "green jumpsuit"
icon_state = "green"
inhand_icon_state = "g_suit"
icon_palette_key = DYE_GREEN
/obj/item/clothing/under/color/jumpskirt/green
name = "green jumpskirt"
icon_state = "greenskirt"
inhand_icon_state = "g_suit"
icon_palette_key = DYE_GREEN
/obj/item/clothing/under/color/grey
name = "grey jumpsuit"
desc = "A tasteful grey jumpsuit that reminds you of the good old days."
icon_state = "grey"
inhand_icon_state = "gy_suit"
icon_palette_key = DYE_GREY
/obj/item/clothing/under/color/grey/greytide
flags = NODROP
@@ -77,29 +123,28 @@
/obj/item/clothing/under/color/jumpskirt/grey
name = "grey jumpskirt"
desc = "A tasteful grey jumpskirt that reminds you of the good old days."
icon_state = "greyskirt"
inhand_icon_state = "gy_suit"
icon_palette_key = DYE_GREY
/obj/item/clothing/under/color/grey/glorf
name = "ancient jumpsuit"
desc = "A terribly ragged and frayed grey jumpsuit. It looks like it hasn't been washed in over a decade."
icon_state = "ancient"
icon_palette_key = null
/obj/item/clothing/under/color/orange
name = "orange jumpsuit"
desc = "Don't wear this near paranoid security officers."
icon_state = "orange"
inhand_icon_state = "o_suit"
icon_palette_key = DYE_ORANGE
/obj/item/clothing/under/color/jumpskirt/orange
name = "orange jumpskirt"
desc = "Don't wear this near paranoid security officers."
icon_state = "orangeskirt"
inhand_icon_state = "o_suit"
icon_palette_key = DYE_ORANGE
/obj/item/clothing/under/color/orange/prison
desc = "It's standardised Nanotrasen prisoner-wear. Its suit sensors are stuck in the \"Fully On\" position."
icon_state = "prisoner"
icon_palette_key = null
inhand_icon_state = "prisoner"
has_sensor = 2
sensor_mode = SENSOR_COORDS
@@ -107,6 +152,7 @@
/obj/item/clothing/under/color/jumpskirt/orange/prison
desc = "It's standardised Nanotrasen prisoner-wear. Its suit sensors are stuck in the \"Fully On\" position."
icon_state = "prisonerskirt"
icon_palette_key = null
inhand_icon_state = "prisoner"
has_sensor = 2
sensor_mode = SENSOR_COORDS
@@ -114,74 +160,81 @@
/obj/item/clothing/under/color/pink
name = "pink jumpsuit"
desc = "Just looking at this makes you feel <i>fabulous</i>."
icon_state = "pink"
inhand_icon_state = "p_suit"
icon_palette_key = DYE_PINK
/obj/item/clothing/under/color/jumpskirt/pink
name = "pink jumpskirt"
desc = "Just looking at this makes you feel <i>fabulous</i>."
icon_state = "pinkskirt"
inhand_icon_state = "p_suit"
icon_palette_key = DYE_PINK
/obj/item/clothing/under/color/red
name = "red jumpsuit"
icon_state = "red"
inhand_icon_state = "r_suit"
icon_palette_key = DYE_RED
/obj/item/clothing/under/color/jumpskirt/red
name = "red jumpskirt"
icon_state = "redskirt"
inhand_icon_state = "r_suit"
icon_palette_key = DYE_RED
/obj/item/clothing/under/color/red/dodgeball
flags = NODROP
/obj/item/clothing/under/color/white
name = "white jumpsuit"
icon_state = "white"
icon_palette_key = DYE_WHITE
/obj/item/clothing/under/color/jumpskirt/white
name = "white jumpskirt"
icon_state = "whiteskirt"
icon_palette_key = DYE_WHITE
/obj/item/clothing/under/color/yellow
name = "yellow jumpsuit"
icon_state = "yellow"
icon_palette_key = DYE_YELLOW
/obj/item/clothing/under/color/jumpskirt/yellow
name = "yellow jumpskirt"
icon_state = "yellowskirt"
icon_palette_key = DYE_YELLOW
/obj/item/clothing/under/color/psyche
name = "psychedelic jumpsuit"
desc = "Groovy!"
icon_state = "psyche"
inhand_icon_state = "psyche_suit"
/obj/item/clothing/under/color/psyche/set_icon_from_cache(palette_key = "psyche", dye_key = null)
return ..()
/obj/item/clothing/under/color/jumpskirt/psyche
name = "psychedelic jumpskirt"
desc = "Far out!"
icon_state = "psycheskirt"
inhand_icon_state = "psyche_suit"
/obj/item/clothing/under/color/jumpskirt/psyche/set_icon_from_cache(palette_key = "psycheskirt", dye_key = null)
return ..()
/obj/item/clothing/under/color/lightblue
name = "light blue jumpsuit"
icon_state = "lightblue"
icon_palette_key = DYE_LIGHTBLUE
/obj/item/clothing/under/color/jumpskirt/lightblue
name = "light blue jumpskirt"
icon_state = "lightblueskirt"
icon_palette_key = DYE_LIGHTBLUE
/obj/item/clothing/under/color/aqua
name = "aqua jumpsuit"
icon_state = "aqua"
icon_palette_key = DYE_AQUA
/obj/item/clothing/under/color/jumpskirt/aqua
name = "aqua jumpskirt"
icon_state = "aquaskirt"
icon_palette_key = DYE_AQUA
/obj/item/clothing/under/color/purple
name = "purple jumpsuit"
icon_state = "purple"
inhand_icon_state = "p_suit"
icon_palette_key = DYE_PURPLE
/obj/item/clothing/under/color/jumpskirt/purple
name = "purple jumpskirt"
icon_state = "purpleskirt"
inhand_icon_state = "p_suit"
icon_palette_key = DYE_PURPLE
/// for jani ert
/obj/item/clothing/under/color/purple/sensor
@@ -190,71 +243,71 @@
/obj/item/clothing/under/color/lightpurple
name = "light purple jumpsuit"
icon_state = "lightpurple"
icon_palette_key = DYE_LIGHTPURPLE
/obj/item/clothing/under/color/jumpskirt/lightpurple
name = "light purple jumpskirt"
icon_state = "lightpurpleskirt"
icon_palette_key = DYE_LIGHTPURPLE
/obj/item/clothing/under/color/lightgreen
name = "light green jumpsuit"
icon_state = "lightgreen"
icon_palette_key = DYE_LIGHTGREEN
/obj/item/clothing/under/color/jumpskirt/lightgreen
name = "light green jumpskirt"
icon_state = "lightgreenskirt"
icon_palette_key = DYE_LIGHTGREEN
/obj/item/clothing/under/color/lightbrown
name = "light brown jumpsuit"
icon_state = "lightbrown"
icon_palette_key = DYE_LIGHTBROWN
/obj/item/clothing/under/color/jumpskirt/lightbrown
name = "light brown jumpskirt"
icon_state = "lightbrownskirt"
icon_palette_key = DYE_LIGHTBROWN
/obj/item/clothing/under/color/brown
name = "brown jumpsuit"
icon_state = "brown"
icon_palette_key = DYE_BROWN
/obj/item/clothing/under/color/jumpskirt/brown
name = "brown jumpskirt"
icon_state = "brownskirt"
icon_palette_key = DYE_BROWN
/obj/item/clothing/under/color/yellowgreen
name = "yellow green jumpsuit"
icon_state = "yellowgreen"
icon_palette_key = DYE_YELLOWGREEN
/obj/item/clothing/under/color/jumpskirt/yellowgreen
name = "yellow green jumpskirt"
icon_state = "yellowgreenskirt"
icon_palette_key = DYE_YELLOWGREEN
/obj/item/clothing/under/color/darkblue
name = "dark blue jumpsuit"
icon_state = "darkblue"
icon_palette_key = DYE_DARKBLUE
/obj/item/clothing/under/color/jumpskirt/darkblue
name = "dark blue jumpskirt"
icon_state = "darkblueskirt"
icon_palette_key = DYE_DARKBLUE
/obj/item/clothing/under/color/lightred
name = "light red jumpsuit"
icon_state = "lightred"
icon_palette_key = DYE_LIGHTRED
/obj/item/clothing/under/color/jumpskirt/lightred
name = "light red jumpskirt"
icon_state = "lightredskirt"
icon_palette_key = DYE_LIGHTRED
/obj/item/clothing/under/color/darkred
name = "dark red jumpsuit"
icon_state = "darkred"
icon_palette_key = DYE_DARKRED
/obj/item/clothing/under/color/jumpskirt/darkred
name = "dark red jumpskirt"
icon_state = "darkredskirt"
icon_palette_key = DYE_DARKRED
/obj/item/clothing/under/color/rainbow
name = "rainbow jumpsuit"
desc = "rainbow."
desc = "Rainbow."
icon_state = "rainbow"
inhand_icon_state = "rainbow"
@@ -268,8 +321,10 @@
name = "red team jersey"
desc = "The jersey of the Nanotrasen Phi-ghters!"
icon_state = "redjersey"
icon_palette_key = null
/obj/item/clothing/under/color/blue/jersey
name = "blue team jersey"
desc = "The jersey of the Nanotrasen Pi-rates!"
icon_state = "bluejersey"
icon_palette_key = null