Fix underwear showing up on NO_UNDERWEAR species (#11336)

This commit is contained in:
Tastyfish
2022-02-08 02:17:25 +00:00
committed by GitHub
parent ece4a9bb7d
commit ac75b1e399
3 changed files with 73 additions and 26 deletions
+26 -26
View File
@@ -1,5 +1,3 @@
//THIS FILE HAS BEEN EDITED BY SKYRAT EDIT
/proc/generate_values_for_underwear(list/accessory_list, list/icons, color, icon_offset) //SKYRAT EDIT CHANGE - Colorable Undershirt/Socks
var/icon/lower_half = icon('icons/blanks/32x32.dmi', "nothing")
@@ -83,20 +81,11 @@
should_generate_icons = TRUE
/datum/preference/choiced/socks/init_possible_values()
return generate_values_for_underwear(GLOB.socks_list, list("human_r_leg", "human_l_leg"), COLOR_ALMOST_BLACK, 0) //SKYRAT EDIT CHANGE - Colorable Undershirt/Socks
return generate_values_for_underwear(GLOB.socks_list, list("human_r_leg", "human_l_leg"))
/datum/preference/choiced/socks/apply_to_human(mob/living/carbon/human/target, value)
target.socks = value
//SKYRAT EDIT CHANGE BEGIN - Colorable Undershirt/Socks
/datum/preference/choiced/socks/compile_constant_data()
var/list/data = ..()
data[SUPPLEMENTAL_FEATURE_KEY] = "socks_color"
return data
//SKYRAT EDIT CHANGE END - Colorable Undershirt/Socks
/// Undershirt preference
/datum/preference/choiced/undershirt
savefile_key = "undershirt"
@@ -105,21 +94,33 @@
category = PREFERENCE_CATEGORY_CLOTHING
should_generate_icons = TRUE
//SKYRAT EDIT CHANGE BEGIN - Colorable Undershirt/Socks
/datum/preference/choiced/undershirt/init_possible_values()
return generate_values_for_underwear(GLOB.undershirt_list, list("human_chest_m", "human_r_arm", "human_l_arm", "human_r_leg", "human_l_leg", "human_r_hand", "human_l_hand"), COLOR_ALMOST_BLACK,10)
var/icon/body = icon('icons/mob/human_parts_greyscale.dmi', "human_r_leg")
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_l_leg"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_r_arm"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_l_arm"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_r_hand"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_l_hand"), ICON_OVERLAY)
body.Blend(icon('icons/mob/human_parts_greyscale.dmi', "human_chest_m"), ICON_OVERLAY)
var/list/values = list()
for (var/accessory_name in GLOB.undershirt_list)
var/icon/icon_with_undershirt = icon(body)
if (accessory_name != "Nude")
var/datum/sprite_accessory/accessory = GLOB.undershirt_list[accessory_name]
icon_with_undershirt.Blend(icon('icons/mob/clothing/underwear.dmi', accessory.icon_state), ICON_OVERLAY)
icon_with_undershirt.Crop(9, 9, 23, 23)
icon_with_undershirt.Scale(32, 32)
values[accessory_name] = icon_with_undershirt
return values
/datum/preference/choiced/undershirt/apply_to_human(mob/living/carbon/human/target, value)
target.undershirt = value
/datum/preference/choiced/undershirt/compile_constant_data()
var/list/data = ..()
data[SUPPLEMENTAL_FEATURE_KEY] = "undershirt_color"
return data
//SKYRAT EDIT CHANGE END - Colorable Undershirt/Socks
/// Underwear preference
/datum/preference/choiced/underwear
savefile_key = "underwear"
@@ -129,7 +130,7 @@
should_generate_icons = TRUE
/datum/preference/choiced/underwear/init_possible_values()
return generate_values_for_underwear(GLOB.underwear_list, list("human_chest_m", "human_r_leg", "human_l_leg"), COLOR_ALMOST_BLACK, 5) //SKYRAT EDIT CHANGE - Colorable Undershirt/Socks
return generate_values_for_underwear(GLOB.underwear_list, list("human_chest_m", "human_r_leg", "human_l_leg"), COLOR_ALMOST_BLACK)
/datum/preference/choiced/underwear/apply_to_human(mob/living/carbon/human/target, value)
target.underwear = value
@@ -139,8 +140,8 @@
return FALSE
var/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = species_type
return !(NO_UNDERWEAR in initial(species.species_traits))
var/datum/species/species = new species_type
return !(NO_UNDERWEAR in species.species_traits)
/datum/preference/choiced/underwear/compile_constant_data()
var/list/data = ..()
@@ -148,4 +149,3 @@
data[SUPPLEMENTAL_FEATURE_KEY] = "underwear_color"
return data