Skip to content

Commit

Permalink
dehardcodes limb icons (tgstation#61570)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JohnFulpWillard committed Sep 28, 2021
1 parent eec8463 commit c1fd222
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion code/__DEFINES/mobs.dm
Expand Up @@ -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"
Expand Down
11 changes: 7 additions & 4 deletions code/modules/surgery/bodyparts/_bodyparts.dm
@@ -1,4 +1,3 @@

/obj/item/bodypart
name = "limb"
desc = "Why is it detached..."
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c1fd222

Please sign in to comment.