Skip to content

Commit

Permalink
splints can be removed without armor
Browse files Browse the repository at this point in the history
  • Loading branch information
ihatethisengine committed Mar 28, 2024
1 parent 4bdaa26 commit d1e2cf5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/datums/elements/strippable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@
/// The ITEM_SLOT_* to equip to.
var/item_slot

/datum/strippable_item/proc/has_no_item_alt_action()
return FALSE

/datum/strippable_item/mob_item_slot/get_item(atom/source)
if (!ismob(source))
return null
Expand Down Expand Up @@ -357,6 +360,9 @@

var/obj/item/item = item_data.get_item(owner)
if (isnull(item))
if (item_data.has_no_item_alt_action())
LAZYINITLIST(result)
result["no_item_action"] = item_data.get_alternate_action(owner, user)
items[strippable_key] = result
continue

Expand Down Expand Up @@ -489,7 +495,7 @@
return

var/item = strippable_item.get_item(owner)
if (isnull(item))
if (isnull(item) && !strippable_item.has_no_item_alt_action())
return

if (isnull(strippable_item.get_alternate_action(owner, user)))
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/human/human_stripping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
key = STRIPPABLE_ITEM_SUIT
item_slot = SLOT_OCLOTHING

/datum/strippable_item/mob_item_slot/suit/has_no_item_alt_action()
return TRUE

/datum/strippable_item/mob_item_slot/suit/get_alternate_action(atom/source, mob/user)
if(!ishuman(source))
return
Expand Down
6 changes: 6 additions & 0 deletions tgui/packages/tgui/interfaces/StripMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ type StripMenuItem =
| {
obscured: ObscuringLevel;
}
| {
no_item_action: string;
}
) &
Partial<Interactable>);

Expand Down Expand Up @@ -307,6 +310,9 @@ export const StripMenu = (props, context) => {
);

tooltip = `obscured ${slot.displayName}`;
} else if ('no_item_action' in item) {
tooltip = slot.displayName;
alternateAction = ALTERNATE_ACTIONS[item.no_item_action];
}

return (
Expand Down

0 comments on commit d1e2cf5

Please sign in to comment.