diff --git a/code/modules/client/preferences/clothing.dm b/code/modules/client/preferences/clothing.dm index 27e712da844..a03e236d9c0 100644 --- a/code/modules/client/preferences/clothing.dm +++ b/code/modules/client/preferences/clothing.dm @@ -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 - diff --git a/modular_skyrat/master_files/code/modules/client/preferences/clothing.dm b/modular_skyrat/master_files/code/modules/client/preferences/clothing.dm new file mode 100644 index 00000000000..9939a1b135c --- /dev/null +++ b/modular_skyrat/master_files/code/modules/client/preferences/clothing.dm @@ -0,0 +1,46 @@ +/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) + +/datum/preference/choiced/socks/compile_constant_data() + var/list/data = ..() + + data[SUPPLEMENTAL_FEATURE_KEY] = "socks_color" + + return data + +/datum/preference/choiced/socks/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + var/species_type = preferences.read_preference(/datum/preference/choiced/species) + var/datum/species/species = new species_type + return !(NO_UNDERWEAR in species.species_traits) + +/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) + +/datum/preference/choiced/undershirt/compile_constant_data() + var/list/data = ..() + + data[SUPPLEMENTAL_FEATURE_KEY] = "undershirt_color" + + return data + +/datum/preference/choiced/undershirt/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + var/species_type = preferences.read_preference(/datum/preference/choiced/species) + var/datum/species/species = new species_type + return !(NO_UNDERWEAR in species.species_traits) + +/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) + +/datum/preference/choiced/underwear/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + var/species_type = preferences.read_preference(/datum/preference/choiced/species) + var/datum/species/species = new species_type + return !(NO_UNDERWEAR in species.species_traits) diff --git a/tgstation.dme b/tgstation.dme index 5def7211731..829c034ceaa 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -4367,6 +4367,7 @@ #include "modular_skyrat\master_files\code\modules\client\preferences\auto_dementor.dm" #include "modular_skyrat\master_files\code\modules\client\preferences\be_antag.dm" #include "modular_skyrat\master_files\code\modules\client\preferences\body_type.dm" +#include "modular_skyrat\master_files\code\modules\client\preferences\clothing.dm" #include "modular_skyrat\master_files\code\modules\client\preferences\cursed_shit.dm" #include "modular_skyrat\master_files\code\modules\client\preferences\delete_sparks.dm" #include "modular_skyrat\master_files\code\modules\client\preferences\emote_overlay.dm"