From 6e8505ab4e657cf78c80df38fb1e53fb258e19a8 Mon Sep 17 00:00:00 2001 From: skull132 Date: Thu, 4 Jun 2015 12:45:10 +0300 Subject: [PATCH] Fixes #586 Adds a "Toggle lid" option to the UI of the DNA scanner. This is mainly an aesthetic enhancement, making the system completely usable from the UI, so you don't need to faff with right clicking/verbing. It also revises the check for the toggle_lid verb: basically, silicons and anyone else living, who can open the UI, can now toggle it. Makse sense if it's mechanized and a button. --- code/modules/detectivework/forensics.dm | 9 +++++---- nano/templates/dnaforensics.tmpl | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/modules/detectivework/forensics.dm b/code/modules/detectivework/forensics.dm index 6b17e6e0..6bd1f103 100644 --- a/code/modules/detectivework/forensics.dm +++ b/code/modules/detectivework/forensics.dm @@ -552,6 +552,7 @@ "scanning" = scanning, "bloodsamp" = (bloodsamp ? bloodsamp.name : ""), "bloodsamp_desc" = (bloodsamp ? (bloodsamp.desc ? bloodsamp.desc : "No information on record.") : ""), + "lidstate" = closed ) ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) @@ -592,6 +593,9 @@ bloodsamp.loc = src.loc bloodsamp = null + if(href_list["toggleLid"]) + toggle_lid() + return 1 /obj/machinery/dnaforensics/process() @@ -650,13 +654,10 @@ set category = "Object" set name = "Toggle Lid" set src in oview(1) - if(usr.stat || !(istype(usr,/mob/living/carbon/human))) + if(usr.stat || !isliving(usr)) usr << "No." return - if(issilicon(usr)) - return - if(scanning) usr << "You can't do that while [src] is scanning!" return diff --git a/nano/templates/dnaforensics.tmpl b/nano/templates/dnaforensics.tmpl index a1e3b25f..efe69e61 100644 --- a/nano/templates/dnaforensics.tmpl +++ b/nano/templates/dnaforensics.tmpl @@ -3,6 +3,9 @@
{{:helper.link(data.scanning ? 'Halt Scan' : 'Begin Scan', 'signal-diag', {'scanItem' : 1}, null)}}
+
+ {{:helper.link((data.lidstate ? 'Open Lid' : 'Close Lid'), (data.lidstate ? 'unlocked' : 'locked'), {'toggleLid' : 1}, null)}} +
{{:helper.link('Eject item', 'eject', {'ejectItem' : 1}, (data.bloodsamp && !data.scanning) ? null : 'disabled')}}