Fixes changes and adds delete option

All cell logs can now be deleted
This commit is contained in:
Fruerlund
2017-05-23 14:55:31 +02:00
parent bde62d63b0
commit d9286dc614
3 changed files with 32 additions and 14 deletions
+28 -11
View File
@@ -141,6 +141,12 @@
qdel(R)
update_all_mob_security_hud()
setTemp("<h3>All records deleted.</h3>")
if("del_alllogs2")
if(cell_logs.len)
setTemp("<h3>All cell logs deleted.</h3>")
cell_logs.Cut()
else
to_chat(usr, "<span class='notice'>Error; No cell logs to delete.</span>")
if("del_r2")
if(active2)
qdel(active2)
@@ -254,6 +260,12 @@
buttons[++buttons.len] = list("name" = "No", "icon" = "times", "href" = null, "status" = null)
setTemp("<h3>Are you sure you wish to delete all records?</h3>", buttons)
else if(href_list["del_alllogs"])
var/list/buttons = list()
buttons[++buttons.len] = list("name" = "Yes", "icon" = "check", "href" = "del_alllogs2=1", "status" = null)
buttons[++buttons.len] = list("name" = "No", "icon" = "times", "href" = null, "status" = null)
setTemp("<h3>Are you sure you wish to delete all cell logs?</h3>", buttons)
else if(href_list["del_rg"])
if(active1)
var/list/buttons = list()
@@ -343,16 +355,22 @@
printing = 0
else if(href_list["printlogs"])
var/obj/item/weapon/paper/P = (input(usr, "Select log to print", "Available Cell Logs") as null|anything in cell_logs)
if(!P)
return 0
playsound(src.loc, "sound/goonstation/machines/printer_dotmatrix.ogg", 50, 1)
to_chat(usr, "<span class='danger'>Printing [P.name].</span>")
sleep(50)
var/obj/item/weapon/paper/LOG = new /obj/item/weapon/paper(src.loc)
LOG.name = P.name
LOG.info = P.info
return 1
if(cell_logs.len && !printing)
var/obj/item/weapon/paper/P = input(usr, "Select log to print", "Available Cell Logs") as null|anything in cell_logs
if(!P)
return 0
printing = 1
playsound(loc, "sound/goonstation/machines/printer_dotmatrix.ogg", 50, 1)
to_chat(usr, "<span class='notice'>Printing file [P.name].</span>")
sleep(50)
var/obj/item/weapon/paper/log = new /obj/item/weapon/paper(loc)
log.name = P.name
log.info = P.info
printing = 0
return 1
else
to_chat(usr, "<span class='notice'>[src] has no logs stored or is already printing.</span>")
else if(href_list["add_c"])
if(istype(active2, /datum/data/record))
@@ -366,7 +384,6 @@
var/index = min(max(text2num(href_list["del_c"]) + 1, 1), length(active2.fields["comments"]))
if(istype(active2, /datum/data/record) && active2.fields["comments"][index])
active2.fields["comments"] -= active2.fields["comments"][index]
return 0
if(href_list["field"])
if(..())
+1 -1
View File
@@ -34,7 +34,7 @@
/obj/machinery/door_timer/proc/print_report()
var/logname = input(usr, "Name of the guilty?","[id] log name")
var/logcharges = input(usr, "What have they been charged with?","[id] log charges")
var/logcharges = stripped_multiline_input(usr, "What have they been charged with?","[id] log charges")
if(!logname || !logcharges)
return 0