From 9a17931d860ae85edcfc1e22cac2df19cfe8a6c9 Mon Sep 17 00:00:00 2001 From: Killian Date: Tue, 14 Jan 2025 18:57:51 +0000 Subject: [PATCH 1/2] default jacket toggle --- code/datums/outfits/outfit.dm | 3 ++- code/game/jobs/job_controller.dm | 4 ++++ .../client/preference_setup/general/04_equipment.dm | 8 ++++++++ code/modules/client/preferences.dm | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/code/datums/outfits/outfit.dm b/code/datums/outfits/outfit.dm index 43fe69f0f22..efeec7d02e7 100644 --- a/code/datums/outfits/outfit.dm +++ b/code/datums/outfits/outfit.dm @@ -127,7 +127,8 @@ var/list/outfits_decls_by_type_ if(uniform) H.equip_to_slot_or_del(new uniform(H),slot_w_uniform) if(suit) - H.equip_to_slot_or_del(new suit(H),slot_wear_suit) + if(!(H.client?.prefs?.no_jacket)) + H.equip_to_slot_or_del(new suit(H),slot_wear_suit) if(back) H.equip_to_slot_or_del(new back(H),slot_back) if(belt) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index acb568c6d81..4d05ff2a8d4 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -426,6 +426,8 @@ var/global/datum/controller/occupations/job_master //if(G.slot == slot_wear_mask || G.slot == slot_wear_suit || G.slot == slot_head) // custom_equip_leftovers += thing //else + if(G.slot == slot_wear_suit && H.client?.prefs?.no_jacket) //RS ADD + continue if(G.slot == slot_shoes && H.client?.prefs?.shoe_hater) //RS ADD continue if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot)) @@ -453,6 +455,8 @@ var/global/datum/controller/occupations/job_master // If some custom items could not be equipped before, try again now. for(var/thing in custom_equip_leftovers) var/datum/gear/G = gear_datums[thing] + if(G.slot == slot_wear_suit && H.client?.prefs?.no_jacket) //RS ADD + continue if(G.slot == slot_shoes && H.client?.prefs?.shoe_hater) //RS ADD continue if(G.slot in custom_equip_slots) diff --git a/code/modules/client/preference_setup/general/04_equipment.dm b/code/modules/client/preference_setup/general/04_equipment.dm index 27dc98a4dce..2744698467d 100644 --- a/code/modules/client/preference_setup/general/04_equipment.dm +++ b/code/modules/client/preference_setup/general/04_equipment.dm @@ -17,6 +17,7 @@ pref.communicator_visibility = save_data["communicator_visibility"] pref.ringtone = save_data["ringtone"] pref.shoe_hater = save_data["shoe_hater"] + pref.no_jacket = save_data["no_jacket"] /datum/category_item/player_setup_item/general/equipment/save_character(list/save_data) save_data["all_underwear"] = pref.all_underwear @@ -30,6 +31,7 @@ save_data["communicator_visibility"] = pref.communicator_visibility save_data["ringtone"] = pref.ringtone save_data["shoe_hater"] = pref.shoe_hater + save_data["no_jacket"] = pref.no_jacket var/global/list/valid_ringtones = list( "beep", @@ -136,6 +138,7 @@ var/global/list/valid_ringtones = list( . += "Communicator Visibility: [(pref.communicator_visibility) ? "Yes" : "No"]
" . += "Ringtone (leave blank for job default): [pref.ringtone]
" . += "Spawn With Shoes:[(pref.shoe_hater) ? "No" : "Yes"]
" //RS Addition + . += "Spawn With Jacket:[(pref.no_jacket) ? "No" : "Yes"]
" return jointext(.,null) @@ -215,5 +218,10 @@ var/global/list/valid_ringtones = list( pref.shoe_hater = !pref.shoe_hater return TOPIC_REFRESH //RS ADD END + else if(href_list["toggle_jacket"]) //RS ADD START + if(CanUseTopic(user)) + pref.no_jacket = !pref.no_jacket + return TOPIC_REFRESH + //RS ADD END return ..() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 30b1ffad3ec..d628cd26f26 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -26,6 +26,7 @@ var/list/preferences_datums = list() var/backbag = 2 //backpack type var/pdachoice = 1 //PDA type var/shoe_hater = FALSE //RS ADD - if true, will spawn with no shoes + var/no_jacket = FALSE //if true, will not spawn with outfit's jacket/outer layer var/h_style = "Bald" //Hair type var/grad_style = "none" //Gradient style var/f_style = "Shaved" //Face hair type From 3d25ff0b4a0107e010b0acaed8ce89909c459739 Mon Sep 17 00:00:00 2001 From: "C.L." Date: Tue, 14 Jan 2025 15:21:24 -0500 Subject: [PATCH 2/2] Removes the RS add comments --- code/game/jobs/job_controller.dm | 8 ++++---- .../client/preference_setup/general/04_equipment.dm | 8 +++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 4d05ff2a8d4..76320e76b5d 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -426,9 +426,9 @@ var/global/datum/controller/occupations/job_master //if(G.slot == slot_wear_mask || G.slot == slot_wear_suit || G.slot == slot_head) // custom_equip_leftovers += thing //else - if(G.slot == slot_wear_suit && H.client?.prefs?.no_jacket) //RS ADD + if(G.slot == slot_wear_suit && H.client?.prefs?.no_jacket) continue - if(G.slot == slot_shoes && H.client?.prefs?.shoe_hater) //RS ADD + if(G.slot == slot_shoes && H.client?.prefs?.shoe_hater) continue if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot)) to_chat(H, span_notice("Equipping you with \the [thing]!")) @@ -455,9 +455,9 @@ var/global/datum/controller/occupations/job_master // If some custom items could not be equipped before, try again now. for(var/thing in custom_equip_leftovers) var/datum/gear/G = gear_datums[thing] - if(G.slot == slot_wear_suit && H.client?.prefs?.no_jacket) //RS ADD + if(G.slot == slot_wear_suit && H.client?.prefs?.no_jacket) continue - if(G.slot == slot_shoes && H.client?.prefs?.shoe_hater) //RS ADD + if(G.slot == slot_shoes && H.client?.prefs?.shoe_hater) continue if(G.slot in custom_equip_slots) spawn_in_storage += thing diff --git a/code/modules/client/preference_setup/general/04_equipment.dm b/code/modules/client/preference_setup/general/04_equipment.dm index 2744698467d..65ddbce69a4 100644 --- a/code/modules/client/preference_setup/general/04_equipment.dm +++ b/code/modules/client/preference_setup/general/04_equipment.dm @@ -137,7 +137,7 @@ var/global/list/valid_ringtones = list( . += "PDA Type: [pdachoicelist[pref.pdachoice]]
" . += "Communicator Visibility: [(pref.communicator_visibility) ? "Yes" : "No"]
" . += "Ringtone (leave blank for job default): [pref.ringtone]
" - . += "Spawn With Shoes:[(pref.shoe_hater) ? "No" : "Yes"]
" //RS Addition + . += "Spawn With Shoes:[(pref.shoe_hater) ? "No" : "Yes"]
" . += "Spawn With Jacket:[(pref.no_jacket) ? "No" : "Yes"]
" return jointext(.,null) @@ -213,15 +213,13 @@ var/global/list/valid_ringtones = list( else pref.ringtone = choice return TOPIC_REFRESH - else if(href_list["toggle_shoes"]) //RS ADD START + else if(href_list["toggle_shoes"]) if(CanUseTopic(user)) pref.shoe_hater = !pref.shoe_hater return TOPIC_REFRESH - //RS ADD END - else if(href_list["toggle_jacket"]) //RS ADD START + else if(href_list["toggle_jacket"]) if(CanUseTopic(user)) pref.no_jacket = !pref.no_jacket return TOPIC_REFRESH - //RS ADD END return ..()