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
35 lines
847 B
Plaintext
35 lines
847 B
Plaintext
/*!
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/**
|
|
* tgui state: not_incapacitated_state
|
|
*
|
|
* Checks that the user isn't incapacitated
|
|
*/
|
|
|
|
var/datum/ui_state/not_incapacitated_state/not_incapacitated_state = new
|
|
|
|
/**
|
|
* tgui state: not_incapacitated_turf_state
|
|
*
|
|
* Checks that the user isn't incapacitated and that their loc is a turf
|
|
*/
|
|
|
|
var/datum/ui_state/not_incapacitated_state/not_incapacitated_turf_state = new
|
|
|
|
/datum/ui_state/not_incapacitated_state
|
|
var/turf_check = FALSE
|
|
|
|
/datum/ui_state/not_incapacitated_state/New(loc, no_turfs = FALSE)
|
|
..()
|
|
turf_check = no_turfs
|
|
|
|
/datum/ui_state/not_incapacitated_state/can_use_topic(src_object, mob/user)
|
|
if(user.stat != CONSCIOUS)
|
|
return UI_CLOSE
|
|
if(user.incapacitated() || (turf_check && !isturf(user.loc)))
|
|
return UI_DISABLED
|
|
return UI_INTERACTIVE
|