From c1fd222c5226883882644226570f3e53bab0d35c Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Tue, 28 Sep 2021 17:16:09 -0400 Subject: [PATCH] dehardcodes limb icons (#61570) This is a small change aimed at helping downstream modularity. Currently the file these sprites use are hardcoded with a define, this removes that and instead moves it to a var. I guess the thing is defaults should be overridable, it's just we've never ran into a case where it's needed, so adding that functionality on its own looks really weird annoying. I don't like adding stuff that's only useful to downstreams, for various reasons, but this seems ok after some thought. fulfills the promise of _DEFAULT. -Lemon --- code/__DEFINES/mobs.dm | 1 - code/modules/surgery/bodyparts/_bodyparts.dm | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 85f2706bd58868..c76e8d3f65bdbd 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -59,7 +59,6 @@ #define DEFAULT_BODYPART_ICON_ORGANIC 'icons/mob/human_parts_greyscale.dmi' #define DEFAULT_BODYPART_ICON_ROBOTIC 'icons/mob/augmentation/augments.dmi' - #define MONKEY_BODYPART "monkey" #define ALIEN_BODYPART "alien" #define LARVA_BODYPART "larva" diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 4a41231f33abe8..0f0e9f8ccf646f 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -1,4 +1,3 @@ - /obj/item/bodypart name = "limb" desc = "Why is it detached..." @@ -7,6 +6,10 @@ w_class = WEIGHT_CLASS_SMALL icon = 'icons/mob/human_parts.dmi' icon_state = "" + /// The icon for Organic limbs using greyscale + var/icon_greyscale = DEFAULT_BODYPART_ICON_ORGANIC + /// The icon for Robotic limbs + var/icon_robotic = DEFAULT_BODYPART_ICON_ROBOTIC layer = BELOW_MOB_LAYER //so it isn't hidden behind objects when on the floor grind_results = list(/datum/reagent/bone_dust = 10, /datum/reagent/liquidgibs = 5) // robotic bodyparts and chests/heads cannot be ground var/mob/living/carbon/owner @@ -713,9 +716,9 @@ if(change_icon_to_default) if(status == BODYPART_ORGANIC) - icon = DEFAULT_BODYPART_ICON_ORGANIC + icon = icon_greyscale else if(status == BODYPART_ROBOTIC) - icon = DEFAULT_BODYPART_ICON_ROBOTIC + icon = icon_robotic if(owner) owner.updatehealth() @@ -880,7 +883,7 @@ return if(should_draw_greyscale) - limb.icon = 'icons/mob/human_parts_greyscale.dmi' + limb.icon = icon_greyscale if(should_draw_gender) limb.icon_state = "[species_id]_[body_zone]_[icon_gender]" else if(use_digitigrade)