diff --git a/code/datums/elements/strippable.dm b/code/datums/elements/strippable.dm index 1d31fc4d491e..a8e2f86f67a0 100644 --- a/code/datums/elements/strippable.dm +++ b/code/datums/elements/strippable.dm @@ -502,19 +502,8 @@ /datum/strip_menu/ui_host(mob/user) return owner -/datum/strip_menu/ui_status(mob/user, datum/ui_state/state) - . = ..() - - if (isliving(user)) - var/mob/living/living_user = user - - if ( - . == UI_UPDATE \ - && user.stat == CONSCIOUS \ - && living_user.body_position == LYING_DOWN \ - && user.Adjacent(owner) - ) - return UI_INTERACTIVE +/datum/strip_menu/ui_state(mob/user) + return GLOB.strip_state /// Creates an assoc list of keys to /datum/strippable_item /proc/create_strippable_list(types) diff --git a/code/modules/tgui/states/strip.dm b/code/modules/tgui/states/strip.dm new file mode 100644 index 000000000000..f7e9d07ff564 --- /dev/null +++ b/code/modules/tgui/states/strip.dm @@ -0,0 +1,13 @@ +GLOBAL_DATUM_INIT(strip_state, /datum/ui_state/strip_state, new) + +/// Carbons and cyborgs can strip mobs, other living can view but not strip +/datum/ui_state/strip_state/can_use_topic(src_object, mob/user) + if(iscarbon(user) || iscyborg(user)) + if(!user.Adjacent(src_object)) + return UI_DISABLED + return UI_INTERACTIVE + if(isliving(user)) + if(!user.Adjacent(src_object)) + return UI_DISABLED + return UI_UPDATE + return UI_CLOSE diff --git a/yogstation.dme b/yogstation.dme index 58551705d9d9..b79244663194 100644 --- a/yogstation.dme +++ b/yogstation.dme @@ -3926,6 +3926,7 @@ #include "code\modules\tgui\states\physical.dm" #include "code\modules\tgui\states\pilot.dm" #include "code\modules\tgui\states\self.dm" +#include "code\modules\tgui\states\strip.dm" #include "code\modules\tgui\states\zlevel.dm" #include "code\modules\tgui_input\alert.dm" #include "code\modules\tgui_input\checkboxes.dm"