mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 23:17:28 +01:00
Fix inventory bugs and add tgui state
This commit is contained in:
@@ -119,7 +119,7 @@
|
||||
return STATUS_DISABLED
|
||||
return STATUS_CLOSE // Otherwise, we got nothing.
|
||||
|
||||
/mob/living/carbon/human/shared_living_tgui_distance(atom/movable/src_object)
|
||||
/mob/living/carbon/human/shared_living_tgui_distance(atom/movable/src_object, viewcheck = TRUE)
|
||||
if((TK in mutations) && (get_dist(src, src_object) <= 2))
|
||||
return STATUS_INTERACTIVE
|
||||
return ..()
|
||||
|
||||
@@ -22,3 +22,28 @@ GLOBAL_DATUM_INIT(tgui_physical_state, /datum/tgui_state/physical, new)
|
||||
|
||||
/mob/living/silicon/ai/physical_can_use_tgui_topic(src_object)
|
||||
return STATUS_UPDATE // AIs are not physical.
|
||||
|
||||
/**
|
||||
* tgui state: physical_obscured_state
|
||||
*
|
||||
* Short-circuits the default state to only check physical distance, being in view doesn't matter
|
||||
*/
|
||||
|
||||
GLOBAL_DATUM_INIT(tgui_physical_obscured_state, /datum/tgui_state/physical_obscured_state, new)
|
||||
|
||||
/datum/tgui_state/physical_obscured_state/can_use_topic(src_object, mob/user)
|
||||
. = user.shared_tgui_interaction(src_object)
|
||||
if(. > STATUS_CLOSE)
|
||||
return min(., user.physical_obscured_can_use_topic(src_object))
|
||||
|
||||
/mob/proc/physical_obscured_can_use_topic(src_object)
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/living/physical_obscured_can_use_topic(src_object)
|
||||
return shared_living_tgui_distance(src_object, viewcheck = FALSE)
|
||||
|
||||
/mob/living/silicon/physical_obscured_can_use_topic(src_object)
|
||||
return max(STATUS_UPDATE, shared_living_tgui_distance(src_object, viewcheck = FALSE)) // Silicons can always see.
|
||||
|
||||
/mob/living/silicon/ai/physical_obscured_can_use_topic(src_object)
|
||||
return STATUS_UPDATE // AIs are not physical.
|
||||
|
||||
Reference in New Issue
Block a user