mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #11058 from VOREStation/Arokha/entertain
Make tvcamera and entertainment monitor FANCY
This commit is contained in:
committed by
Chompstation Bot
parent
b246cfd374
commit
5c5aaa1887
@@ -296,3 +296,7 @@
|
||||
|
||||
/datum/tgui_module/camera/ntos/hacked/New(host)
|
||||
. = ..(host, using_map.station_networks.Copy())
|
||||
|
||||
/datum/tgui_module/camera/bigscreen/tgui_state(mob/user)
|
||||
return GLOB.tgui_physical_state_bigscreen
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
*
|
||||
* Check the distance for a living mob.
|
||||
* Really only used for checks outside the context of a mob.
|
||||
* Otherwise, use shared_living_ui_distance().
|
||||
* Otherwise, use shared_living_tgui_distance().
|
||||
*
|
||||
* required src_object The object which owns the UI.
|
||||
* required user mob The mob who opened/is using the UI.
|
||||
@@ -119,10 +119,26 @@
|
||||
return STATUS_DISABLED
|
||||
return STATUS_CLOSE // Otherwise, we got nothing.
|
||||
|
||||
/mob/living/carbon/human/shared_living_tgui_distance(atom/movable/src_object, viewcheck = TRUE)
|
||||
if((TK in mutations) && (get_dist(src, src_object) <= 2))
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Distance versus interaction check, with max'd update range.
|
||||
*
|
||||
* required src_object atom/movable The object which owns the UI.
|
||||
*
|
||||
* return UI_state The state of the UI.
|
||||
*/
|
||||
/mob/living/proc/shared_living_tgui_distance_bigscreen(atom/movable/src_object, viewcheck = TRUE)
|
||||
// If the object is obscured, close it.
|
||||
if(viewcheck && !(src_object in view(src)))
|
||||
return STATUS_CLOSE
|
||||
|
||||
var/dist = get_dist(src_object, src)
|
||||
if(dist <= 1) // Open and interact if 1-0 tiles away.
|
||||
return STATUS_INTERACTIVE
|
||||
return ..()
|
||||
else if(dist <= world.view)
|
||||
return STATUS_UPDATE
|
||||
return STATUS_CLOSE // Otherwise, we got nothing.
|
||||
|
||||
// Topic Extensions for old UIs
|
||||
/datum/proc/CanUseTopic(var/mob/user, var/datum/tgui_state/state)
|
||||
|
||||
@@ -47,3 +47,29 @@ GLOBAL_DATUM_INIT(tgui_physical_obscured_state, /datum/tgui_state/physical_obscu
|
||||
|
||||
/mob/living/silicon/ai/physical_obscured_can_use_topic(src_object)
|
||||
return STATUS_UPDATE // AIs are not physical.
|
||||
|
||||
/**
|
||||
* tgui state: physical_state_bigscreen
|
||||
*
|
||||
* Short-circuits the default state to only check physical distance,
|
||||
* but allows updates out to the full size of the screen.
|
||||
**/
|
||||
|
||||
GLOBAL_DATUM_INIT(tgui_physical_state_bigscreen, /datum/tgui_state/physical_bigscreen, new)
|
||||
|
||||
/datum/tgui_state/physical_bigscreen/can_use_topic(src_object, mob/user)
|
||||
. = user.shared_tgui_interaction(src_object)
|
||||
if(. > STATUS_CLOSE)
|
||||
return min(., user.physical_can_use_tgui_topic_bigscreen(src_object))
|
||||
|
||||
/mob/proc/physical_can_use_tgui_topic_bigscreen(src_object)
|
||||
return STATUS_CLOSE
|
||||
|
||||
/mob/living/physical_can_use_tgui_topic_bigscreen(src_object)
|
||||
return shared_living_tgui_distance_bigscreen(src_object)
|
||||
|
||||
/mob/living/silicon/physical_can_use_tgui_topic_bigscreen(src_object)
|
||||
return max(STATUS_UPDATE, shared_living_tgui_distance_bigscreen(src_object)) // Silicons can always see.
|
||||
|
||||
/mob/living/silicon/ai/physical_can_use_tgui_topic(src_object)
|
||||
return STATUS_UPDATE // AIs are not physical.
|
||||
Reference in New Issue
Block a user