mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-17 19:14:15 +01:00
Fix NanoUI for admin ghosts.
Also, rename the base state file.
This commit is contained in:
@@ -421,4 +421,5 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/canUseTopic()
|
||||
if(check_rights(R_ADMIN, 0))
|
||||
return
|
||||
return 1
|
||||
return
|
||||
@@ -475,9 +475,11 @@
|
||||
* If the src_object's Topic() returns 1, update all UIs attacked to it.
|
||||
**/
|
||||
/datum/nanoui/Topic(href, href_list)
|
||||
update_status(0) // update the status
|
||||
if (status != NANO_INTERACTIVE || user != usr) // If UI is not interactive or usr calling Topic is not the UI user
|
||||
return
|
||||
update_status(push_update = 0) // Update the window state.
|
||||
if (status != NANO_INTERACTIVE || user != usr)
|
||||
return // If UI is not interactive or usr calling Topic is not the UI user.
|
||||
|
||||
var/update = src_object.Topic(href, href_list, 0, state) // Call Topic() on the src_object.
|
||||
|
||||
// Code to toggle/update the Map UI.
|
||||
var/map_update = 0
|
||||
@@ -488,9 +490,8 @@
|
||||
set_map_z_level(text2num(href_list["mapZLevel"]))
|
||||
map_update = 1
|
||||
|
||||
// If we have a src_object and its Topic() returns 1, update.
|
||||
if ((src_object && src_object.Topic(href, href_list, 0, state)) || map_update)
|
||||
SSnano.update_uis(src_object)
|
||||
if ((src_object && update) || map_update)
|
||||
SSnano.update_uis(src_object) // If we have a src_object and its Topic() told us to update.
|
||||
|
||||
/**
|
||||
* private
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
/var/global/datum/topic_state/admin_state/admin_state = new()
|
||||
|
||||
/datum/topic_state/admin_state/can_use_topic(atom/movable/src_object, mob/user)
|
||||
if (check_rights(R_ADMIN, 0, user))
|
||||
if (check_rights_for(user.client, R_ADMIN))
|
||||
return NANO_INTERACTIVE
|
||||
return NANO_CLOSE
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* NanoUI State
|
||||
* NanoUI States
|
||||
*
|
||||
* Base state and helpers for states. Just does some sanity checks, implement a state for in-depth checks.
|
||||
**/
|
||||
@@ -68,7 +68,7 @@
|
||||
return ..()
|
||||
|
||||
/mob/dead/observer/shared_nano_interaction(atom/movable/src_object)
|
||||
if (check_rights(R_ADMIN, 0, src))
|
||||
if (check_rights_for(client, R_ADMIN))
|
||||
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.
|
||||
Reference in New Issue
Block a user