mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-15 09:56:47 +01:00
e063223199
* autolathe1 * cl * Oops * pay the price --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
25 lines
587 B
Plaintext
25 lines
587 B
Plaintext
/*!
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/**
|
|
* tgui state: contained_state
|
|
*
|
|
* Checks that the user is inside the src_object.
|
|
*/
|
|
|
|
GLOBAL_DATUM_INIT(contained_state, /datum/ui_state/contained_state, new)
|
|
|
|
/datum/ui_state/contained_state/can_use_topic(atom/src_object, mob/user)
|
|
if(!src_object.contains(user))
|
|
return UI_CLOSE
|
|
return user.shared_ui_interaction(src_object)
|
|
|
|
/atom/proc/contains(atom/target)
|
|
if(!target)
|
|
return FALSE
|
|
for(var/atom/location = target.loc, location, location = location.loc)
|
|
if(location == src)
|
|
return TRUE
|