From 67185ec2ce236b24f1a2d0fdbc54d528b4a08ce6 Mon Sep 17 00:00:00 2001 From: theOOZ Date: Tue, 30 Sep 2025 18:17:25 +0200 Subject: [PATCH] Adds accessory stripping to the strip-menu (#93177) ## About The Pull Request The strip-menu can now support THREE alternate actions instead of two! Adds stripping of accessories with a tgui input list. https://github.com/user-attachments/assets/ab436b5a-751d-42b6-8e2c-1d83c7c7e081 ## Why It's Good For The Game Lets you take off accessories without stripping the person of their uniform first. ## Changelog :cl: add: Adds a button to the strip-menu to remove somebody's uniform accessories /:cl: --- code/datums/elements/strippable.dm | 4 +-- .../living/carbon/human/human_stripping.dm | 36 +++++++++++++++++++ tgui/packages/tgui/interfaces/StripMenu.tsx | 6 ++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/code/datums/elements/strippable.dm b/code/datums/elements/strippable.dm index b041aa47c3d..85f2fe6ca60 100644 --- a/code/datums/elements/strippable.dm +++ b/code/datums/elements/strippable.dm @@ -377,8 +377,8 @@ result["name"] = item.name result["alternate"] = item_data.get_alternate_actions(owner, user) var/static/list/already_cried = list() - if(length(result["alternate"]) > 2 && !(type in already_cried)) - stack_trace("Too many alternate actions for [type]! Only two are supported at the moment! This will look bad!") + if(length(result["alternate"]) > 3 && !(type in already_cried)) + stack_trace("Too many alternate actions for [type]! Only three are supported at the moment! This will look bad!") already_cried += type items[strippable_key] = result diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm index 73e45544e7f..d2c09ec258a 100644 --- a/code/modules/mob/living/carbon/human/human_stripping.dm +++ b/code/modules/mob/living/carbon/human/human_stripping.dm @@ -55,6 +55,8 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( actions += "adjust_sensor" if(jumpsuit.can_adjust) actions += "adjust_jumpsuit" + if(length(jumpsuit.attached_accessories)) + actions += "strip_accessory" return actions @@ -70,6 +72,8 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( do_adjust_jumpsuit(source, user, jumpsuit) if("adjust_sensor") do_adjust_sensor(source, user, jumpsuit) + if("strip_accessory") + do_strip_accessory(source, user, jumpsuit) else stack_trace("Unknown action key: [action_key] for [type]") @@ -124,6 +128,38 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list( var/mob/living/carbon/human/humano = source humano.update_suit_sensors() +/datum/strippable_item/mob_item_slot/jumpsuit/proc/do_strip_accessory(atom/source, mob/user, obj/item/clothing/under/jumpsuit) + var/list/accessory_choices = list() + for(var/obj/item/clothing/accessory/jumpsuit_accessory as anything in jumpsuit.attached_accessories) + if(!istype(jumpsuit_accessory)) + continue + accessory_choices[jumpsuit_accessory.name] += jumpsuit_accessory + + var/chosen_accessory_name = tgui_input_list(user, "Select which accessory to strip", "Select Accessory", accessory_choices) + var/obj/item/clothing/accessory/chosen_accessory = accessory_choices[chosen_accessory_name] + if(isnull(chosen_accessory)) + return + + if(!user.Adjacent(source)) + source.balloon_alert(user, "can't reach!") + return + + to_chat(source, span_notice("[user] is trying to take [chosen_accessory] off of [jumpsuit]!")) + if(!do_after(user, chosen_accessory.strip_delay, source)) + source.balloon_alert(user, "failed!") + return + + to_chat(source, span_notice("[user] has taken [chosen_accessory] off of [jumpsuit].")) + jumpsuit.remove_accessory(chosen_accessory) + jumpsuit.update_appearance() + chosen_accessory.forceMove(jumpsuit.drop_location()) + + if(!ismob(source)) + return + + var/mob/mob_source = source + mob_source.update_worn_undersuit() + /datum/strippable_item/mob_item_slot/suit key = STRIPPABLE_ITEM_SUIT item_slot = ITEM_SLOT_OCLOTHING diff --git a/tgui/packages/tgui/interfaces/StripMenu.tsx b/tgui/packages/tgui/interfaces/StripMenu.tsx index 3f150ed33b7..bf6b255aa32 100644 --- a/tgui/packages/tgui/interfaces/StripMenu.tsx +++ b/tgui/packages/tgui/interfaces/StripMenu.tsx @@ -78,6 +78,11 @@ const ALTERNATE_ACTIONS: Record = { icon: 'microchip', text: 'Adjust sensors', }, + + strip_accessory: { + icon: 'ribbon', + text: 'Strip accessory', + }, }; const SLOTS: Record< @@ -328,6 +333,7 @@ export const StripMenu = (props) => { zIndex: '2', left: `${idx === 0 ? '0' : undefined}`, right: `${idx === 1 ? '0' : undefined}`, + top: `${idx === 2 ? '0' : undefined}`, bottom: '0', padding: '0', textAlign: 'center',