diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 12f41166dd61..2c050e24d2a0 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -368,10 +368,10 @@ var/icon/human_clothing_icon = icon(file2use, state2use) - if("[layer]" in mob_species.offset_clothing) + var/list/shifts = get_species_worn_offsets(layer, mob_species) // [CELADON-EDIT] - Get species-specific offsets + if(shifts) // [/CELADON-EDIT] // This code taken from Baystation 12 var/icon/final_I = icon('icons/blanks/64x64.dmi', "nothing") - var/list/shifts = mob_species.offset_clothing["[layer]"] // Apply all pixel shifts for each direction. for(var/shift_facing in shifts) diff --git a/code/modules/mob/living/carbon/human/species_types/kepori.dm b/code/modules/mob/living/carbon/human/species_types/kepori.dm index 6eb9e0dcbaf9..908573b4d8ad 100644 --- a/code/modules/mob/living/carbon/human/species_types/kepori.dm +++ b/code/modules/mob/living/carbon/human/species_types/kepori.dm @@ -114,7 +114,13 @@ "[NORTH]" = list("x" = 8, "y" = -1), "[EAST]" = list("x" = 8, "y" = -1), "[SOUTH]" = list("x" = 8, "y" = -1), - "[WEST]" = list("x" = -8, "y" = -1) + "[WEST]" = list("x" = -8, "y" = -1), + ), + "[BACK_LAYER]" = list( + "[NORTH]" = list("x" = 9, "y" = -3), + "[EAST]" = list("x" = 16, "y" = -3), + "[SOUTH]" = list("x" = 9, "y" = -3), + "[WEST]" = list("x" = 0, "y" = -3) ), ) diff --git a/code/modules/mob/living/carbon/human/species_types/vox.dm b/code/modules/mob/living/carbon/human/species_types/vox.dm index 9db26ebddd9f..afbb3986422f 100644 --- a/code/modules/mob/living/carbon/human/species_types/vox.dm +++ b/code/modules/mob/living/carbon/human/species_types/vox.dm @@ -95,7 +95,13 @@ "[NORTH]" = list("x" = 8, "y" = 0), "[EAST]" = list("x" = 8, "y" = 0), "[SOUTH]" = list("x" = 8, "y" = 0), - "[WEST]" = list("x" = -8, "y" = 0) + "[WEST]" = list("x" = -8, "y" = 0), + ), + "[BACK_LAYER]" = list( + "[NORTH]" = list("x" = 8, "y" = 0), + "[EAST]" = list("x" = 16, "y" = 0), + "[SOUTH]" = list("x" = 8, "y" = 0), + "[WEST]" = list("x" = 0, "y" = 0) ), ) diff --git a/mod_celadon/fixes/_fixes.dme b/mod_celadon/fixes/_fixes.dme index b46aedb297d9..8f67711006e2 100644 --- a/mod_celadon/fixes/_fixes.dme +++ b/mod_celadon/fixes/_fixes.dme @@ -30,6 +30,7 @@ #include "code/shutters.dm" #include "code/simple_mobs.dm" #include "code/species_moth.dm" +#include "code/species_sprite_helper.dm" #include "code/status_effects.dm" #include "code/TEG_pipes.dm" #include "code/tesla.dm" diff --git a/mod_celadon/fixes/code/species_sprite_helper.dm b/mod_celadon/fixes/code/species_sprite_helper.dm new file mode 100644 index 000000000000..4df4ebc25f9a --- /dev/null +++ b/mod_celadon/fixes/code/species_sprite_helper.dm @@ -0,0 +1,34 @@ +/obj/item + /// Per-species sprite offsets. Format: list("species_id" = list("NORTH" = list("x" = 0, "y" = 0), "SOUTH" = ..., etc.)) + var/list/species_offsets + /* EXAMPLE: + species_offsets = list( + SPECIES_KEPORI = list( + "[NORTH]" = list("x" = 10, "y" = -2), + "[EAST]" = list("x" = 12, "y" = -1), + "[SOUTH]" = list("x" = 10, "y" = -2), + "[WEST]" = list("x" = -10, "y" = -1) + ) + ) + */ + +/** + * Helper proc to get species-specific sprite offsets for worn clothing + * Checks item-specific offsets first, then falls back to species layer offsets + * + * Arguments: + * * layer - The layer the item is being worn on + * * mob_species - The species datum of the wearer + * + * Returns: List of directional offsets, or null if none apply + */ +/obj/item/proc/get_species_worn_offsets(layer, datum/species/mob_species) + // Item-specific offsets take priority + if(species_offsets && (mob_species.id in species_offsets)) + return species_offsets[mob_species.id] + + // Fall back to species layer offsets + if("[layer]" in mob_species.offset_clothing) + return mob_species.offset_clothing["[layer]"] + + return null