From d6b3b3a8bd13c881930a9433d63faaa565fc5414 Mon Sep 17 00:00:00 2001 From: YotaXP Date: Mon, 25 Nov 2013 20:33:27 -0500 Subject: [PATCH] Removes the redundant server side validation that restricted cyborg access to APCs. Fixes the graphical bug that occurs when an AI mouses over the interface lock buttons. Removes some remnants of the previous UI implementation. --- code/modules/power/apc.dm | 96 ++++++++++++--------------------------- nano/css/shared.css | 3 +- 2 files changed, 30 insertions(+), 69 deletions(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 9f14a83ae24..0ab445f8ebc 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -454,7 +454,6 @@ if(stat & (BROKEN|MAINT)) return // do APC interaction - user.set_machine(src) src.interact(user) /obj/machinery/power/apc/attack_alien(mob/living/carbon/alien/humanoid/user) @@ -490,28 +489,24 @@ /obj/machinery/power/apc/proc/get_malf_status(mob/user) - var/malfStatus if (ticker && ticker.mode && (user.mind in ticker.mode.malf_ai) && istype(user, /mob/living/silicon/ai)) if (src.malfai == (user:parent ? user:parent : user)) if (src.occupant == user) - malfStatus = 3 // 3 = User is shunted in this APC + return 3 // 3 = User is shunted in this APC else if (istype(user.loc, /obj/machinery/power/apc)) - malfStatus = 4 // 4 = User is shunted in another APC + return 4 // 4 = User is shunted in another APC else - malfStatus = 2 // 2 = APC hacked by user, and user is in its core. + return 2 // 2 = APC hacked by user, and user is in its core. else - malfStatus = 1 // 1 = APC not hacked. + return 1 // 1 = APC not hacked. else - malfStatus = 0 // 0 = User is not a Malf AI - return malfStatus + return 0 // 0 = User is not a Malf AI /obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main") if(!user) return - var/malfStatus = get_malf_status(user) - var/list/data = list( "locked" = locked, "isOperating" = operating, @@ -522,7 +517,7 @@ "totalLoad" = lastused_equip + lastused_light + lastused_environ, "coverLocked" = coverlocked, "siliconUser" = istype(user, /mob/living/silicon), - "malfStatus" = malfStatus, + "malfStatus" = get_malf_status(user), "powerChannels" = list( list( @@ -571,7 +566,6 @@ // The UI is already open so push the new data to it ui.push_data(data) return - //user.set_machine(src) /obj/machinery/power/apc/proc/report() return "[area.name] : [equipment]/[lighting]/[environ] ([lastused_equip+lastused_light+lastused_environ]) : [cell? cell.percent() : "N/C"] ([charging])" @@ -606,8 +600,6 @@ istype(user, /mob/living/silicon) || \ istype(user, /mob/living/carbon/monkey) /*&& ticker && ticker.mode.name == "monkey"*/) ) user << "\red You don't have the dexterity to use this [src]!" - user << browse(null, "window=apc") - user.unset_machine() return 0 if(user.restrained()) user << "\red You must have free hands to use this [src]" @@ -628,13 +620,9 @@ ) if(!loud) user << "\red \The [src] have AI control disabled!" - user << browse(null, "window=apc") - user.unset_machine() return 0 else if ((!in_range(src, user) || !istype(src.loc, /turf))) - user << browse(null, "window=apc") - user.unset_machine() return 0 var/mob/living/carbon/human/H = user @@ -648,71 +636,50 @@ return 0 return 1 -/obj/machinery/power/apc/proc/validation() - return (!locked && !istype(usr, /mob/living/silicon/ai)) || (istype(usr, /mob/living/silicon/ai) && !src.aidisabled) - /obj/machinery/power/apc/Topic(href, href_list) if(..()) return 0 - if(!isrobot(usr)) - if(!can_use(usr, 1)) - return 0 - - usr.set_machine(src) + if(!can_use(usr, 1)) + return 0 if (href_list["lock"]) - if(validation()) - coverlocked = !coverlocked + coverlocked = !coverlocked else if (href_list["breaker"]) - if(validation()) - toggle_breaker() + toggle_breaker() else if (href_list["cmode"]) - if(validation()) - chargemode = !chargemode - if(!chargemode) - charging = 0 - update_icon() + chargemode = !chargemode + if(!chargemode) + charging = 0 + update_icon() else if (href_list["eqp"]) - if(validation()) - var/val = text2num(href_list["eqp"]) - equipment = setsubsystem(val) - update_icon() - update() + var/val = text2num(href_list["eqp"]) + equipment = setsubsystem(val) + update_icon() + update() else if (href_list["lgt"]) - if(validation()) - var/val = text2num(href_list["lgt"]) - lighting = setsubsystem(val) - update_icon() - update() + var/val = text2num(href_list["lgt"]) + lighting = setsubsystem(val) + update_icon() + update() else if (href_list["env"]) - if(validation()) - var/val = text2num(href_list["env"]) - environ = setsubsystem(val) - update_icon() - update() - - else if( href_list["close"] ) - usr << browse(null, "window=apc") - usr.unset_machine() - return 0 - else if (href_list["close2"]) - usr << browse(null, "window=apcwires") - usr.unset_machine() - return 0 + var/val = text2num(href_list["env"]) + environ = setsubsystem(val) + update_icon() + update() else if (href_list["overload"]) - if( istype(usr, /mob/living/silicon) && !src.aidisabled ) + if(istype(usr, /mob/living/silicon)) src.overload_lighting() else if (href_list["malfhack"]) var/mob/living/silicon/ai/malfai = usr - if(get_malf_status(malfai)) + if(get_malf_status(malfai)==1) if (malfai.malfhacking) malfai << "You are already hacking an APC." return 1 @@ -744,15 +711,13 @@ malfvacate() else if (href_list["toggleaccess"]) - if (istype(usr, /mob/living/silicon/ai) && !src.aidisabled) + if(istype(usr, /mob/living/silicon)) if(emagged || (stat & (BROKEN|MAINT))) usr << "The APC does not respond to the command." else locked = !locked update_icon() - src.updateDialog() - return 1 /obj/machinery/power/apc/proc/toggle_breaker() @@ -1018,9 +983,6 @@ else if (last_ch != charging) queue_icon_update() - //src.updateDialog() - src.updateDialog() - // val 0=off, 1=off(auto) 2=on 3=on(auto) // on 0=off, 1=on, 2=autooff diff --git a/nano/css/shared.css b/nano/css/shared.css index 6761674cd44..958e7d1c9bd 100644 --- a/nano/css/shared.css +++ b/nano/css/shared.css @@ -220,8 +220,7 @@ h4 .notice { - position: relative; - background: url(uiNoticeBackground.jpg) 50% 50% repeat; + background: url(uiNoticeBackground.jpg) 0 0 repeat; color: #15345A; font-size: 12px; font-style: italic;