mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Allow ghosts to use any NanoUI interface.
This commit is contained in:
@@ -67,6 +67,13 @@
|
||||
return NANO_DISABLED
|
||||
return ..()
|
||||
|
||||
/mob/dead/observer/shared_nano_interaction(atom/movable/src_object)
|
||||
if (check_rights(R_ADMIN, 0, src))
|
||||
return NANO_INTERACTIVE // Admins can interact anyway.
|
||||
if(!client || get_dist(src_object, src) > client.view)
|
||||
return NANO_CLOSE // Keep ghosts from opening too many NanoUIs.
|
||||
return NANO_UPDATE // Ghosts can only view.
|
||||
|
||||
|
||||
/**
|
||||
* public
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* NanoUI State: contained_state
|
||||
*
|
||||
* Checks that the user is an admin, end-of-story.
|
||||
* Checks that the user is inside the src_object.
|
||||
**/
|
||||
|
||||
/var/global/datum/topic_state/contained_state/contained_state = new()
|
||||
|
||||
@@ -13,9 +13,7 @@
|
||||
return NANO_CLOSE // Don't allow interaction by default.
|
||||
|
||||
/mob/dead/observer/default_can_use_topic(atom/movable/src_object)
|
||||
if (check_rights(R_ADMIN, 0, src))
|
||||
return NANO_INTERACTIVE // Admins can interact anyway.
|
||||
return NANO_UPDATE // Ghosts can only view.
|
||||
return shared_nano_interaction(src_object)
|
||||
|
||||
/mob/living/default_can_use_topic(atom/movable/src_object)
|
||||
. = shared_nano_interaction(src_object)
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
/mob/proc/notcontained_can_use_topic(atom/movable/src_object)
|
||||
return NANO_CLOSE
|
||||
|
||||
/mob/dead/observer/notcontained_can_use_topic(atom/movable/src_object)
|
||||
return default_can_use_topic(src_object)
|
||||
|
||||
/mob/living/notcontained_can_use_topic(atom/movable/src_object)
|
||||
if (src_object.contains(src))
|
||||
return NANO_CLOSE // Close if we're inside it.
|
||||
|
||||
Reference in New Issue
Block a user