diff --git a/code/game/objects/structures/dresser.dm b/code/game/objects/structures/dresser.dm index 0eb835a9534..4e16b05f338 100644 --- a/code/game/objects/structures/dresser.dm +++ b/code/game/objects/structures/dresser.dm @@ -1,3 +1,5 @@ +//THIS FILE HAS BEEN EDITED BY SKYRAT EDIT + /obj/structure/dresser//SKYRAT EDIT - ICON OVERRIDEN BY AESTHETICS - SEE MODULE name = "dresser" desc = "A nicely-crafted wooden dresser. It's filled with lots of undies." @@ -33,7 +35,7 @@ to_chat(user, span_warning("You are not capable of wearing underwear.")) return - var/choice = input(user, "Underwear, Undershirt, or Socks?", "Changing") as null|anything in list("Underwear","Underwear Color","Undershirt","Socks") + var/choice = input(user, "Underwear, Undershirt, or Socks?", "Changing") as null|anything in list("Underwear","Underwear Color","Undershirt","Undershirt Color","Socks","Socks Color") //SKYRAT EDIT ADDITION - Colorable Undershirt/Socks if(!Adjacent(user)) return @@ -42,6 +44,7 @@ var/new_undies = input(user, "Select your underwear", "Changing") as null|anything in GLOB.underwear_list if(new_undies) H.underwear = new_undies + if("Underwear Color") var/new_underwear_color = input(H, "Choose your underwear color", "Underwear Color","#"+H.underwear_color) as color|null if(new_underwear_color) @@ -50,10 +53,19 @@ var/new_undershirt = input(user, "Select your undershirt", "Changing") as null|anything in GLOB.undershirt_list if(new_undershirt) H.undershirt = new_undershirt + //SKYRAT EDIT ADDITION BEGIN - Colorable Undershirt/Socks + if("Undershirt Color") + var/new_undershirt_color = input(H, "Choose your undershirt color", "Undershirt Color","#"+H.undershirt_color) as color|null + if(new_undershirt_color) + H.undershirt_color = sanitize_hexcolor(new_undershirt_color) if("Socks") var/new_socks = input(user, "Select your socks", "Changing") as null|anything in GLOB.socks_list if(new_socks) H.socks= new_socks - + if("Socks Color") + var/new_socks_color = input(H, "Choose your socks color", "Socks Color","#"+H.socks_color) as color|null + if(new_socks_color) + H.socks_color = sanitize_hexcolor(new_socks_color) + //SKYRAT EDIT ADDITION END - Colorable Undershirt/Socks add_fingerprint(H) H.update_body() diff --git a/code/modules/client/preferences/clothing.dm b/code/modules/client/preferences/clothing.dm index 91faeb8becd..27e712da844 100644 --- a/code/modules/client/preferences/clothing.dm +++ b/code/modules/client/preferences/clothing.dm @@ -1,4 +1,6 @@ -/proc/generate_values_for_underwear(list/accessory_list, list/icons, color) +//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") for (var/icon in icons) @@ -16,8 +18,8 @@ if (color && !accessory.use_static) accessory_icon.Blend(color, ICON_MULTIPLY) icon_with_socks.Blend(accessory_icon, ICON_OVERLAY) + icon_with_socks.Crop(10, 1+icon_offset, 22, 13+icon_offset) //SKYRAT EDIT CHANGE - Colorable Undershirt/Socks - icon_with_socks.Crop(10, 1, 22, 13) icon_with_socks.Scale(32, 32) values[accessory_name] = icon_with_socks @@ -81,11 +83,20 @@ 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")) + 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 /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" @@ -94,33 +105,21 @@ category = PREFERENCE_CATEGORY_CLOTHING should_generate_icons = TRUE +//SKYRAT EDIT CHANGE BEGIN - Colorable Undershirt/Socks /datum/preference/choiced/undershirt/init_possible_values() - 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 + 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/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" @@ -130,7 +129,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) + 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 /datum/preference/choiced/underwear/apply_to_human(mob/living/carbon/human/target, value) target.underwear = value diff --git a/modular_skyrat/master_files/code/modules/client/preferences/underwear_color.dm b/modular_skyrat/master_files/code/modules/client/preferences/underwear_color.dm new file mode 100644 index 00000000000..d032397d4be --- /dev/null +++ b/modular_skyrat/master_files/code/modules/client/preferences/underwear_color.dm @@ -0,0 +1,51 @@ +//THIS FILE HAS BEEN EDITED BY SKYRAT EDIT + +/datum/preference/color_legacy/underwear_color + savefile_key = "underwear_color" + savefile_identifier = PREFERENCE_CHARACTER + category = PREFERENCE_CATEGORY_SUPPLEMENTAL_FEATURES + +/datum/preference/color_legacy/underwear_color/apply_to_human(mob/living/carbon/human/target, value) + target.underwear_color = value + +/datum/preference/color_legacy/underwear_color/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) + +//SKYRAT EDIT ADDITION BEGIN - Colorable Undershirt/Socks +/datum/preference/color_legacy/undershirt_color + savefile_key = "undershirt_color" + savefile_identifier = PREFERENCE_CHARACTER + category = PREFERENCE_CATEGORY_SUPPLEMENTAL_FEATURES + +/datum/preference/color_legacy/undershirt_color/apply_to_human(mob/living/carbon/human/target, value) + target.undershirt_color = value + +/datum/preference/color_legacy/undershirt_color/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/color_legacy/socks_color + savefile_key = "socks_color" + savefile_identifier = PREFERENCE_CHARACTER + category = PREFERENCE_CATEGORY_SUPPLEMENTAL_FEATURES + +/datum/preference/color_legacy/socks_color/apply_to_human(mob/living/carbon/human/target, value) + target.socks_color = value + +/datum/preference/color_legacy/socks_color/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) +//SKYRAT EDIT ADDITION END - Colorable Undershirt/Socks diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx index ee5e3678592..e4b41814c33 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/species_features.tsx @@ -450,3 +450,13 @@ export const skin_tone_toggle: FeatureToggle = { name: "Uses skintone", component: CheckboxInput, }; + +export const undershirt_color: Feature = { + name: "Undershirt color", + component: FeatureColorInput, +}; + +export const socks_color: Feature = { + name: "Socks color", + component: FeatureColorInput, +};