Files
Polaris/code/modules/tgui/states/human_adjacent.dm
ShadowLarkens c06a2d2cef TGUI v3.0
This ports TGUI, and makes the old nano crew monitor and the disposal
bins use it as first examples.
2020-07-09 22:06:23 -07:00

18 lines
521 B
Plaintext

/**
* tgui state: human_adjacent_state
*
* In addition to default checks, only allows interaction for a
* human adjacent user.
**/
GLOBAL_DATUM_INIT(tgui_human_adjacent_state, /datum/tgui_state/human_adjacent_state, new)
/datum/tgui_state/human_adjacent_state/can_use_topic(src_object, mob/user)
. = user.default_can_use_tgui_topic(src_object)
var/dist = get_dist(src_object, user)
if((dist > 1) || (!ishuman(user)))
// Can't be used unless adjacent and human, even with TK
. = min(., STATUS_UPDATE)