From 176bcdad933ec8db70447a3d329619c18386d05a Mon Sep 17 00:00:00 2001 From: RandolfTheMeh Date: Sat, 6 Jul 2019 01:38:50 -0500 Subject: [PATCH] Adds Jumpsuit/Jumpskirt Preference (#44883) Adds a preference for jumpsuit/jumpskirt into the game. Currently runs a jumpskirt for all occupations on spawn except for miner, since they have their special lavaland suit, and no skirt variant I could find. Doesn't remove skirts from lockers/machines yet since I am not 100% as to whether that should be done (clothes are available generically for the sake of changing outfits/recovering clothes after a whoops with some pyrotechnics). --- code/_globalvars/lists/flavor_misc.dm | 5 +++++ code/datums/outfit.dm | 2 +- code/modules/client/preferences.dm | 20 +++++++++++++++---- code/modules/client/preferences_savefile.dm | 7 +++++-- code/modules/clothing/under/color.dm | 13 ++++++++++++ code/modules/jobs/job_types/_job.dm | 10 ++++++++++ code/modules/jobs/job_types/assistant.dm | 10 ++++++++-- .../mob/living/carbon/human/human_defines.dm | 1 + 8 files changed, 59 insertions(+), 9 deletions(-) diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index 20554d476f8..52bec8d2da4 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -101,6 +101,11 @@ GLOBAL_LIST_INIT(security_depts_prefs, list(SEC_DEPT_RANDOM, SEC_DEPT_NONE, SEC_ #define DDUFFELBAG "Department Duffel Bag" GLOBAL_LIST_INIT(backbaglist, list(DBACKPACK, DSATCHEL, DDUFFELBAG, GBACKPACK, GSATCHEL, GDUFFELBAG, LSATCHEL)) + //Suit/Skirt +#define PREF_SUIT "Jumpsuit" +#define PREF_SKIRT "Jumpskirt" +GLOBAL_LIST_INIT(jumpsuitlist, list(PREF_SUIT, PREF_SKIRT)) + //Uplink spawn loc #define UPLINK_PDA "PDA" #define UPLINK_RADIO "Radio" diff --git a/code/datums/outfit.dm b/code/datums/outfit.dm index bd84b7efaed..8db756f3cd4 100755 --- a/code/datums/outfit.dm +++ b/code/datums/outfit.dm @@ -197,7 +197,7 @@ var/stored_data = get_json_data() var/json = json_encode(stored_data) //Kinda annoying but as far as i can tell you need to make actual file. - var/f = file("data/TempOutfitUpload") + var/f = file("data/TempOutfitUpload") fdel(f) WRITE_FILE(f,json) admin << ftp(f,"[name].json") diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index f37c72d740d..de27abe18ea 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -57,6 +57,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/undershirt = "Nude" //undershirt type var/socks = "Nude" //socks type var/backbag = DBACKPACK //backpack type + var/jumpsuit_style = PREF_SUIT //suit/skirt var/hair_style = "Bald" //Hair type var/hair_color = "000" //Hair color var/facial_hair_style = "Shaved" //Face hair type @@ -226,6 +227,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Undershirt:
[undershirt]
" dat += "Socks:
[socks]
" dat += "Backpack:
[backbag]
" + dat += "Jumpsuit:
[jumpsuit_style]
" dat += "Uplink Spawn Location:
[uplink_spawn_loc]
" var/use_skintones = pref_species.use_skintones @@ -780,7 +782,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(job_preferences[j] == JP_HIGH) job_preferences[j] = JP_MEDIUM //technically break here - + job_preferences[job.title] = level return TRUE @@ -798,7 +800,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) to_chat(user, "UpdateJobPreference - desired level was not a number. Please notify coders!") ShowChoices(user) return - + var/jpval = null switch(desiredLvl) if(3) @@ -813,7 +815,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) jpval = null else jpval = JP_LOW - + SetJobPreferenceLevel(job, jpval) SetChoices(user) @@ -1010,6 +1012,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) skin_tone = random_skin_tone() if("bag") backbag = pick(GLOB.backbaglist) + if("suit") + jumpsuit_style = pick(GLOB.jumpsuitlist) if("all") random_character() @@ -1277,6 +1281,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(new_backbag) backbag = new_backbag + if("suit") + if(jumpsuit_style == PREF_SUIT) + jumpsuit_style = PREF_SKIRT + else + jumpsuit_style = PREF_SUIT + if("uplink_loc") var/new_loc = input(user, "Choose your character's traitor uplink spawn location:", "Character Preference") as null|anything in GLOB.uplink_spawn_loc_list if(new_loc) @@ -1454,7 +1464,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) auto_fit_viewport = !auto_fit_viewport if(auto_fit_viewport && parent) parent.fit_viewport() - + if("widescreenpref") widescreenpref = !widescreenpref user.client.change_view(CONFIG_GET(string/default_view)) @@ -1520,6 +1530,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) character.backbag = backbag + character.jumpsuit_style = jumpsuit_style + var/datum/species/chosen_species chosen_species = pref_species.type if(!(pref_species.id in GLOB.roundstart_races) && !(pref_species.id in (CONFIG_GET(keyed_list/roundstart_no_hard_check)))) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index b895e423f1d..5f363d9dc2c 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -56,7 +56,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car var/job_civilian_high = 0 var/job_civilian_med = 0 var/job_civilian_low = 0 - + var/job_medsci_high = 0 var/job_medsci_med = 0 var/job_medsci_low = 0 @@ -290,6 +290,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["undershirt"] >> undershirt S["socks"] >> socks S["backbag"] >> backbag + S["jumpsuit_style"] >> jumpsuit_style S["uplink_loc"] >> uplink_spawn_loc S["feature_mcolor"] >> features["mcolor"] S["feature_ethcolor"] >> features["ethcolor"] @@ -374,6 +375,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car eye_color = sanitize_hexcolor(eye_color, 3, 0) skin_tone = sanitize_inlist(skin_tone, GLOB.skin_tones) backbag = sanitize_inlist(backbag, GLOB.backbaglist, initial(backbag)) + jumpsuit_style = sanitize_inlist(jumpsuit_style, GLOB.jumpsuitlist, initial(jumpsuit_style)) uplink_spawn_loc = sanitize_inlist(uplink_spawn_loc, GLOB.uplink_spawn_loc_list, initial(uplink_spawn_loc)) features["mcolor"] = sanitize_hexcolor(features["mcolor"], 3, 0) features["ethcolor"] = copytext(features["ethcolor"],1,7) @@ -423,7 +425,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["underwear"] , underwear) WRITE_FILE(S["undershirt"] , undershirt) WRITE_FILE(S["socks"] , socks) - WRITE_FILE(S["backbag"] , backbag) + WRITE_FILE(S["backbag"] , backbag) + WRITE_FILE(S["jumpsuit_style"] , jumpsuit_style) WRITE_FILE(S["uplink_loc"] , uplink_spawn_loc) WRITE_FILE(S["species"] , pref_species.id) WRITE_FILE(S["feature_mcolor"] , features["mcolor"]) diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm index 939e8837f6f..319c556a3a5 100644 --- a/code/modules/clothing/under/color.dm +++ b/code/modules/clothing/under/color.dm @@ -19,6 +19,19 @@ new C(loc) return INITIALIZE_HINT_QDEL +/obj/item/clothing/under/skirt/color/random + icon_state = "random_jumpsuit" //Skirt variant needed + +/obj/item/clothing/under/skirt/color/random/Initialize() + ..() + var/obj/item/clothing/under/skirt/color/C = pick(subtypesof(/obj/item/clothing/under/skirt/color) - /obj/item/clothing/under/skirt/color/random) + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + H.equip_to_slot_or_del(new C(H), SLOT_W_UNIFORM) + else + new C(loc) + return INITIALIZE_HINT_QDEL + /obj/item/clothing/under/color/black name = "black jumpsuit" icon_state = "black" diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm index d7b87e59209..6d8958c4a93 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -191,6 +191,16 @@ else back = backpack //Department backpack + //converts the uniform string into the path we'll wear, whether it's the skirt or regular variant + var/holder + if(H.jumpsuit_style == PREF_SKIRT) + holder = "[uniform]/skirt" + if(!text2path(holder)) + holder = "[uniform]" + else + holder = "[uniform]" + uniform = text2path(holder) + /datum/outfit/job/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) if(visualsOnly) return diff --git a/code/modules/jobs/job_types/assistant.dm b/code/modules/jobs/job_types/assistant.dm index 145238b0989..d9b24572af3 100644 --- a/code/modules/jobs/job_types/assistant.dm +++ b/code/modules/jobs/job_types/assistant.dm @@ -32,6 +32,12 @@ Assistant /datum/outfit/job/assistant/pre_equip(mob/living/carbon/human/H) ..() if (CONFIG_GET(flag/grey_assistants)) - uniform = /obj/item/clothing/under/color/grey + if(H.jumpsuit_style == PREF_SUIT) + uniform = /obj/item/clothing/under/color/grey + else + uniform = /obj/item/clothing/under/skirt/color/grey else - uniform = /obj/item/clothing/under/color/random + if(H.jumpsuit_style == PREF_SUIT) + uniform = /obj/item/clothing/under/color/random + else + uniform = /obj/item/clothing/under/skirt/color/random diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 0d54d993e99..5848ed09dcb 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -28,6 +28,7 @@ var/undershirt = "Nude" //Which undershirt the player wants var/socks = "Nude" //Which socks the player wants var/backbag = DBACKPACK //Which backpack type the player has chosen. + var/jumpsuit_style = PREF_SUIT //suit/skirt //Equipment slots var/obj/item/clothing/wear_suit = null