Modernized the UI of the operation computer.

This commit is contained in:
Giacomand
2014-07-01 21:20:50 +01:00
parent c65aa2b5a4
commit 3a7c25572e
2 changed files with 37 additions and 28 deletions
+32 -24
View File
@@ -10,6 +10,13 @@
/obj/machinery/computer/operating/New()
..()
if(ticker)
find_table()
/obj/machinery/computer/operating/initialize()
find_table()
/obj/machinery/computer/operating/proc/find_table()
for(var/dir in cardinal)
table = locate(/obj/structure/optable, get_step(src, dir))
if(table)
@@ -23,37 +30,38 @@
interact(user)
/obj/machinery/computer/operating/interact(mob/user)
if(get_dist(src, user) > 1 || stat & (BROKEN|NOPOWER))
if(!istype(user, /mob/living/silicon))
user.unset_machine()
user << browse(null, "window=op")
return
user.set_machine(src)
var/dat = "<HEAD><TITLE>Operating Computer</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>"
var/dat = ""
if(table)
dat += "<B>Patient information:</B><BR>"
if(table.check_patient())
patient = table.patient
dat += {"<B>Patient Status:</B> [patient.stat ? "Non-Responsive" : "Stable"]<BR>
<B>Blood Type:</B> [patient.blood_type]<BR>
<BR>
<B>Health:</B> [round(patient.health)]<BR>
<B>Brute Damage:</B> [round(patient.getBruteLoss())]<BR>
<B>Toxins Damage:</B> [round(patient.getToxLoss())]<BR>
<B>Fire Damage:</B> [round(patient.getFireLoss())]<BR>
<B>Suffocation Damage:</B> [round(patient.getOxyLoss())]<BR>
"}
if(patient.surgeries.len)
dat += "<BR><B>Initiated Procedures:</B><BR>"
for(var/datum/surgery/procedure in patient.surgeries)
dat += "[procedure.name]<BR>"
dat += get_patient_info()
else
patient = null
dat += "<B>No patient detected</B>"
else
dat += "<B>Operating table not found.</B>"
dat += "</BODY>"
user << browse(dat, "window=op")
onclose(user, "op")
var/datum/browser/popup = new(user, "op", "Operating Computer", 400, 500)
popup.set_content(dat)
popup.open()
/obj/machinery/computer/operating/proc/get_patient_info()
var/dat = {"
<div class='statusLabel'>Patient:</div> [patient.stat ? "<span class='bad'>Non-Responsive</span>" : "<span class='good'>Stable</span>"]<BR>
<div class='statusLabel'>Blood Type:</div> [patient.blood_type]
<BR>
<div class='line'><div class='statusLabel'>Health:</div><div class='progressBar'><div style='width: [max(patient.health, 0)]%;' class='progressFill good'></div></div><div class='statusValue'>[patient.health]%</div></div>
<div class='line'><div class='statusLabel'>\> Brute Damage:</div><div class='progressBar'><div style='width: [max(patient.getBruteLoss(), 0)]%;' class='progressFill bad'></div></div><div class='statusValue'>[patient.getBruteLoss()]%</div></div>
<div class='line'><div class='statusLabel'>\> Resp. Damage:</div><div class='progressBar'><div style='width: [max(patient.getOxyLoss(), 0)]%;' class='progressFill bad'></div></div><div class='statusValue'>[patient.getOxyLoss()]%</div></div>
<div class='line'><div class='statusLabel'>\> Toxin Content:</div><div class='progressBar'><div style='width: [max(patient.getToxLoss(), 0)]%;' class='progressFill bad'></div></div><div class='statusValue'>[patient.getToxLoss()]%</div></div>
<div class='line'><div class='statusLabel'>\> Burn Severity:</div><div class='progressBar'><div style='width: [max(patient.getFireLoss(), 0)]%;' class='progressFill bad'></div></div><div class='statusValue'>[patient.getFireLoss()]%</div></div>
"}
if(patient.surgeries.len)
dat += "<BR><B>Initiated Procedures</B><div class='statusDisplay'>"
for(var/datum/surgery/procedure in patient.surgeries)
dat += "[capitalize(procedure.name)]<BR>"
dat += "</div>"
return dat
+5 -4
View File
@@ -11,18 +11,19 @@
var/has_multi_loc = 0 //Multiple locations - RR
/datum/surgery/proc/next_step(mob/user, mob/living/carbon/target)
if(step_in_progress) return
var/procedure = steps[status]
var/datum/surgery_step/S = new procedure
var/datum/surgery_step/S = get_surgery_step()
if(S)
if(S.try_op(user, target, user.zone_sel.selecting, user.get_active_hand(), src))
return 1
return 0
/datum/surgery/proc/get_surgery_step()
var/step_type = steps[status]
return new step_type
/datum/surgery/proc/complete(mob/living/carbon/human/target)
target.surgeries -= src