mirror of
https://github.com/quotefox/Hyper-Station-13.git
synced 2026-07-14 09:12:32 +01:00
66962a8816
trying to update from TGUI Next to TGUI 3, so we can later upgrade from TGUI 3 to TGUI 4.
18 lines
517 B
Plaintext
18 lines
517 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(., UI_UPDATE)
|