mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
tgui 4 (#30535)
Co-authored-by: ShiftyRail <31417754+ShiftyRail@users.noreply.github.com>
This commit is contained in:
30
code/modules/tgui/states/hands.dm
Normal file
30
code/modules/tgui/states/hands.dm
Normal file
@@ -0,0 +1,30 @@
|
||||
/*!
|
||||
* Copyright (c) 2020 Aleksej Komarov
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/**
|
||||
* tgui state: hands_state
|
||||
*
|
||||
* Checks that the src_object is in the user's hands.
|
||||
*/
|
||||
|
||||
var/datum/ui_state/hands_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(is_holding_item(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
|
||||
Reference in New Issue
Block a user