mirror of
https://github.com/quotefox/Hyper-Station-13.git
synced 2026-07-13 08:42:25 +01:00
66962a8816
trying to update from TGUI Next to TGUI 3, so we can later upgrade from TGUI 3 to TGUI 4.
26 lines
676 B
Plaintext
26 lines
676 B
Plaintext
/**
|
|
* tgui state: hands_state
|
|
*
|
|
* Checks that the src_object is in the user's hands.
|
|
**/
|
|
|
|
GLOBAL_DATUM_INIT(tgui_hands_state, /datum/tgui_state/hands_state, new)
|
|
|
|
/datum/tgui_state/hands_state/can_use_topic(src_object, mob/user)
|
|
. = user.shared_tgui_interaction(src_object)
|
|
if(. > UI_CLOSE)
|
|
return min(., user.hands_can_use_tgui_topic(src_object))
|
|
|
|
/mob/proc/hands_can_use_tgui_topic(src_object)
|
|
return UI_CLOSE
|
|
|
|
/mob/living/hands_can_use_tgui_topic(src_object)
|
|
if(is_holding(src_object))
|
|
return UI_INTERACTIVE
|
|
return UI_CLOSE
|
|
|
|
/mob/living/silicon/robot/hands_can_use_tgui_topic(src_object)
|
|
if(activated(src_object))
|
|
return UI_INTERACTIVE
|
|
return UI_CLOSE
|