Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit bc4829d

Browse files
committed
strip state
1 parent bec8467 commit bc4829d

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

code/datums/elements/strippable.dm

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -502,19 +502,8 @@
502502
/datum/strip_menu/ui_host(mob/user)
503503
return owner
504504

505-
/datum/strip_menu/ui_status(mob/user, datum/ui_state/state)
506-
. = ..()
507-
508-
if (isliving(user))
509-
var/mob/living/living_user = user
510-
511-
if (
512-
. == UI_UPDATE \
513-
&& user.stat == CONSCIOUS \
514-
&& living_user.body_position == LYING_DOWN \
515-
&& user.Adjacent(owner)
516-
)
517-
return UI_INTERACTIVE
505+
/datum/strip_menu/ui_state(mob/user)
506+
return GLOB.strip_state
518507

519508
/// Creates an assoc list of keys to /datum/strippable_item
520509
/proc/create_strippable_list(types)

code/modules/tgui/states/strip.dm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
GLOBAL_DATUM_INIT(strip_state, /datum/ui_state/strip_state, new)
2+
3+
/// Carbons and cyborgs can strip mobs, other living can view but not strip
4+
/datum/ui_state/strip_state/can_use_topic(src_object, mob/user)
5+
if(iscarbon(user) || iscyborg(user))
6+
if(!user.Adjacent(src_object))
7+
return UI_DISABLED
8+
return UI_INTERACTIVE
9+
if(isliving(user))
10+
if(!user.Adjacent(src_object))
11+
return UI_DISABLED
12+
return UI_UPDATE
13+
return UI_CLOSE

yogstation.dme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3926,6 +3926,7 @@
39263926
#include "code\modules\tgui\states\physical.dm"
39273927
#include "code\modules\tgui\states\pilot.dm"
39283928
#include "code\modules\tgui\states\self.dm"
3929+
#include "code\modules\tgui\states\strip.dm"
39293930
#include "code\modules\tgui\states\zlevel.dm"
39303931
#include "code\modules\tgui_input\alert.dm"
39313932
#include "code\modules\tgui_input\checkboxes.dm"

0 commit comments

Comments
 (0)