mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-22 05:17:38 +01:00
e063223199
* autolathe1 * cl * Oops * pay the price --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
31 lines
765 B
Plaintext
31 lines
765 B
Plaintext
/*!
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/**
|
|
* tgui state: hands_state
|
|
*
|
|
* Checks that the src_object is in the user's hands.
|
|
*/
|
|
|
|
GLOBAL_DATUM_INIT(hands_state, /datum/ui_state/hands_state, new)
|
|
|
|
/datum/ui_state/hands_state/can_use_topic(src_object, mob/user)
|
|
. = user.shared_ui_interaction(src_object)
|
|
if(. > UI_CLOSE)
|
|
return min(., user.hands_can_use_topic(src_object))
|
|
|
|
/mob/proc/hands_can_use_topic(src_object)
|
|
return UI_CLOSE
|
|
|
|
/mob/living/hands_can_use_topic(src_object)
|
|
if(get_active_hand() == src_object || get_inactive_hand() == src_object)
|
|
return UI_INTERACTIVE
|
|
return UI_CLOSE
|
|
|
|
/mob/living/silicon/robot/hands_can_use_topic(src_object)
|
|
if(activated(src_object))
|
|
return UI_INTERACTIVE
|
|
return UI_CLOSE
|