From 4ecddd7e8b03b1e43a77288477ad5ced46c742d9 Mon Sep 17 00:00:00 2001 From: Neerti Date: Mon, 7 Dec 2015 02:06:25 -0500 Subject: [PATCH] Adds attack_ghost() to base atmospherics object and APC to allow ghosts to see the nanoUI, and for admins to modify the objects from the interface. --- code/ATMOSPHERICS/atmospherics.dm | 7 ++++++- code/modules/power/apc.dm | 21 ++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 7acf465b3e..a8ccd573a4 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -122,4 +122,9 @@ obj/machinery/atmospherics/proc/check_connect_types(obj/machinery/atmospherics/a /obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference) /obj/machinery/atmospherics/update_icon() - return null \ No newline at end of file + return null + +/obj/machinery/atmospherics/attack_ghost(user as mob) + if(stat & (BROKEN|MAINT)) + return + return ui_interact(user) \ No newline at end of file diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 6d25a0f25e..73cc473396 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -749,7 +749,7 @@ "totalLoad" = round(lastused_total), "totalCharging" = round(lastused_charging), "coverLocked" = coverlocked, - "siliconUser" = istype(user, /mob/living/silicon), + "siliconUser" = issilicon(user) || isobserver(user), //I add observer here so admins can have more control, even if it makes 'siliconUser' seem inaccurate. "powerChannels" = list( list( @@ -822,11 +822,13 @@ /obj/machinery/power/apc/proc/can_use(mob/user as mob, var/loud = 0) //used by attack_hand() and Topic() + if(!user.client) + return 0 + if(isobserver(user) && is_admin(user) ) //This is to allow nanoUI interaction by ghost admins. + return 1 if (user.stat) user << "You must be conscious to use [src]!" return 0 - if(!user.client) - return 0 if(inoperable()) return 0 if(!user.IsAdvancedToolUser()) @@ -872,10 +874,15 @@ if(!can_use(usr, 1)) return 1 - if(!istype(usr, /mob/living/silicon) && locked) - // Shouldn't happen, this is here to prevent href exploits - usr << "You must unlock the panel to use this!" - return 1 + if(locked && !issilicon(usr) ) + if(isobserver(usr) ) + var/mob/dead/observer/O = usr //Added to allow admin nanoUI interactions. + if(!O.can_admin_interact() ) //NanoUI /should/ make this not needed, but better safe than sorry. + usr << "Try as you might, your ghostly fingers can't press the buttons." + return 1 + else + usr << "You must unlock the panel to use this!" + return 1 if (href_list["lock"]) coverlocked = !coverlocked