mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 07:57:50 +00:00
* The TGS thing * Revert the 516 revert * Further segment the world/New() proc * Fixes an issue here
33 lines
995 B
Plaintext
33 lines
995 B
Plaintext
/*!
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/**
|
|
* tgui state: notcontained_state
|
|
*
|
|
* Checks that the user is not inside src_object, and then makes the
|
|
* default checks.
|
|
*/
|
|
|
|
var/datum/ui_state/notcontained_state/notcontained_state = new
|
|
|
|
/datum/ui_state/notcontained_state/can_use_topic(atom/src_object, mob/user)
|
|
. = user.shared_ui_interaction(src_object)
|
|
if(. > UI_CLOSE)
|
|
return min(., user.notcontained_can_use_topic(src_object))
|
|
|
|
/mob/proc/notcontained_can_use_topic(src_object)
|
|
return UI_CLOSE
|
|
|
|
/mob/living/notcontained_can_use_topic(atom/src_object)
|
|
if(src_object.contains(src))
|
|
return UI_CLOSE // Close if we're inside it.
|
|
return default_can_use_topic(src_object)
|
|
|
|
/mob/living/silicon/notcontained_can_use_topic(src_object)
|
|
return default_can_use_topic(src_object) // Silicons use default bevhavior.
|
|
|
|
/mob/living/basic/drone/notcontained_can_use_topic(src_object)
|
|
return default_can_use_topic(src_object) // Drones use default bevhavior.
|