Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
),
)

Expand Down
8 changes: 7 additions & 1 deletion code/modules/mob/living/carbon/human/species_types/vox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
),
)

Expand Down
1 change: 1 addition & 0 deletions mod_celadon/fixes/_fixes.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
34 changes: 34 additions & 0 deletions mod_celadon/fixes/code/species_sprite_helper.dm
Original file line number Diff line number Diff line change
@@ -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