diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index 13eaffc2c3e..24bb023090f 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -186,4 +186,4 @@ /mob/living/carbon/human/proc/force_update_limbs() for(var/obj/item/organ/external/O in organs) O.sync_colour_to_human(src) - update_body(0) + update_body(2)//Forces new icon generation diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index d5b3c6b57d2..f70a329f14e 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -225,8 +225,10 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() //BASE MOB SPRITE -/mob/living/carbon/human/proc/update_body(var/update_icons=1) +//Extension by Nanako +//Passing in a value of 2 for update_icons will ignore any cached icon, and force a new one to be generated +/mob/living/carbon/human/proc/update_body(var/update_icons=1) var/husk_color_mod = rgb(96,88,80) var/hulk_color_mod = rgb(48,224,40) @@ -234,7 +236,6 @@ var/global/list/damage_icon_parts = list() var/fat = (FAT in src.mutations) var/hulk = (HULK in src.mutations) var/skeleton = (SKELETON in src.mutations) - var/g = (gender == FEMALE ? "f" : "m") //CACHING: Generate an index key from visible bodyparts. @@ -268,9 +269,8 @@ var/global/list/damage_icon_parts = list() icon_key += "1" icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0]" - var/icon/base_icon - if(human_icon_cache[icon_key]) + if(update_icons != 2 && human_icon_cache[icon_key])//If update_icons is 2, then we forcibly generate a new icon base_icon = human_icon_cache[icon_key] else //BEGIN CACHED ICON GENERATION. @@ -278,7 +278,7 @@ var/global/list/damage_icon_parts = list() base_icon = chest.get_icon() for(var/obj/item/organ/external/part in organs) - var/icon/temp = part.get_icon(skeleton) + var/icon/temp = part.get_icon(skeleton)//The color comes from this function //That part makes left and right legs drawn topmost and lowermost when human looks WEST or EAST //And no change in rendering for other parts (they icon_position is 0, so goes to 'else' part) if(part.icon_position&(LEFT|RIGHT)) diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 7385962dcd0..4f0f6d627b8 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -198,14 +198,12 @@ datum/preferences preview_icon.Blend(new /icon(icobase, "groin_[g]"), ICON_OVERLAY) preview_icon.Blend(new /icon(icobase, "head_[g]"), ICON_OVERLAY) + + //Non-robotic limbs for(var/name in list("r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","l_arm","l_hand")) if(organ_data[name] == "amputated") continue if(organ_data[name] == "cyborg") - var/datum/robolimb/R - if(rlimb_data[name]) R = all_robolimbs[rlimb_data[name]] - if(!R) R = basic_robolimb - preview_icon.Blend(icon(R.icon, "[name]"), ICON_OVERLAY) // This doesn't check gendered_icon. Not an issue while only limbs can be robotic. - continue + continue//We will add the icons for robolimbs after the skin color is applied preview_icon.Blend(new /icon(icobase, "[name]"), ICON_OVERLAY) //Tail @@ -224,6 +222,16 @@ datum/preferences else preview_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT) + + //Robotic limbs, done AFTER skin color/tone blending + for(var/name in list("r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","l_arm","l_hand")) + if(organ_data[name] == "cyborg") + var/datum/robolimb/R + if(rlimb_data[name]) R = all_robolimbs[rlimb_data[name]] + if(!R) R = basic_robolimb + preview_icon.Blend(icon(R.icon, "[name]"), ICON_OVERLAY) // This doesn't check gendered_icon. Not an issue while only limbs can be robotic. + + var/icon/eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = current_species ? current_species.eyes : "eyes_s") if ((current_species && (current_species.flags & HAS_EYE_COLOR))) eyes_s.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD) diff --git a/html/changelogs/Nanako-Robocolor.yml b/html/changelogs/Nanako-Robocolor.yml new file mode 100644 index 00000000000..f7c3289d5ec --- /dev/null +++ b/html/changelogs/Nanako-Robocolor.yml @@ -0,0 +1,39 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Nanako + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixed a major issue where alien species with cybernetic limbs on spawn would always be the species default colour." + - bugfix: "Fixed preview images of nonhumans with cybernetic limbs being tinted the body colour." + + \ No newline at end of file