diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index f4fad058068..e453d748428 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -12,6 +12,8 @@ var/global/list/airlocks = list() //list of all airlocks var/global/list/singularities = list() //list of all singularities var/global/list/janitorial_equipment = list() //list of janitorial equipment var/global/list/crafting_recipes = list() //list of all crafting recipes +var/global/list/prisoncomputer_list = list() +var/global/list/cell_logs = list() var/global/list/all_areas = list() var/global/list/machines = list() diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 7c647b61e90..fed409d9507 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -20,6 +20,14 @@ /obj/machinery/computer/prisoner/attack_ai(var/mob/user as mob) return src.attack_hand(user) +/obj/machinery/computer/prisoner/New() + prisoncomputer_list += src + return ..() + +/obj/machinery/computer/prisoner/Destroy() + prisoncomputer_list -= src + return ..() + /obj/machinery/computer/prisoner/attack_hand(var/mob/user as mob) if(..()) return 1 diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 6fdb90575ea..16efcb7de76 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -120,7 +120,7 @@ else security["empty"] = 1 return data - + /obj/machinery/computer/secure_data/Topic(href, href_list) if(..()) return 1 @@ -141,6 +141,12 @@ qdel(R) update_all_mob_security_hud() setTemp("

All records deleted.

") + if("del_alllogs2") + if(cell_logs.len) + setTemp("

All cell logs deleted.

") + cell_logs.Cut() + else + to_chat(usr, "Error; No cell logs to delete.") if("del_r2") if(active2) qdel(active2) @@ -254,6 +260,12 @@ buttons[++buttons.len] = list("name" = "No", "icon" = "times", "href" = null, "status" = null) setTemp("

Are you sure you wish to delete all records?

", 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("

Are you sure you wish to delete all cell logs?

", buttons) + else if(href_list["del_rg"]) if(active1) var/list/buttons = list() @@ -342,6 +354,24 @@ create_record_photo(active1) printing = 0 + else if(href_list["printlogs"]) + 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, "Printing file [P.name].") + 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, "[src] has no logs stored or is already printing.") + + else if(href_list["add_c"]) if(istype(active2, /datum/data/record)) var/a2 = active2 @@ -454,10 +484,10 @@ /obj/machinery/computer/secure_data/proc/setTemp(text, list/buttons = list()) temp = list("text" = text, "buttons" = buttons, "has_buttons" = buttons.len > 0) - -/obj/machinery/computer/secure_data/proc/update_all_mob_security_hud() + +/obj/machinery/computer/secure_data/proc/update_all_mob_security_hud() for(var/mob/living/carbon/human/H in mob_list) - H.sec_hud_set_security_status() + H.sec_hud_set_security_status() /obj/machinery/computer/secure_data/proc/create_record_photo(datum/data/record/R) // basically copy-pasted from the camera code but different enough that it has to be redone diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 7ec9630a54c..a24af37dc72 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -28,9 +28,34 @@ var/list/obj/machinery/targets = list() var/timetoset = 0 // Used to set releasetime upon starting the timer var/obj/item/device/radio/Radio + var/printed = 0 maptext_height = 26 maptext_width = 32 +/obj/machinery/door_timer/proc/print_report() + var/logname = input(usr, "Name of the guilty?","[id] log name") + var/logcharges = stripped_multiline_input(usr, "What have they been charged with?","[id] log charges") + + if(!logname || !logcharges) + return 0 + + for(var/obj/machinery/computer/prisoner/C in prisoncomputer_list) + var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(C.loc) + P.name = "[id] log - [logname] [worldtime2text()]" + P.info = "
[id] - Brig record



" + P.info += {"
[station_name()] - Security Department

+
Admission data:

+ Log generated at: [worldtime2text()]
+ Detainee: [logname]
+ Duration: [timetoset/10] seconds
+ Charge(s): [logcharges]
+ Arresting Officer: [usr.name]


+ This log file was generated automatically upon activation of a cell timer."} + + playsound(C.loc, "sound/goonstation/machines/printer_dotmatrix.ogg", 50, 1) + cell_logs += P + return 1 + /obj/machinery/door_timer/initialize() ..() @@ -98,9 +123,15 @@ // Closes and locks doors, power check /obj/machinery/door_timer/proc/timer_start() + if(stat & (NOPOWER|BROKEN)) return 0 + if(!printed) + if(!print_report()) + timing = 0 + return 0 + // Set releasetime releasetime = world.timeofday + timetoset if(!(src in machine_processing)) @@ -134,6 +165,7 @@ // Reset releasetime releasetime = 0 + printed = 0 for(var/obj/machinery/door/window/brigdoor/door in targets) if(!door.density) @@ -277,6 +309,7 @@ F.flash() if(href_list["change"]) + printed = 1 timer_start() add_fingerprint(usr) diff --git a/nano/templates/secure_data.tmpl b/nano/templates/secure_data.tmpl index 00f89e17059..d4d129e808b 100644 --- a/nano/templates/secure_data.tmpl +++ b/nano/templates/secure_data.tmpl @@ -112,12 +112,14 @@ Used In File(s): \code\game\machinery\computer\security.dm

Menu

{{:helper.link('Record Maintenance', 'wrench', {'screen' : 2})}}
+
{{:helper.link('Print Cell Log', 'print', {'printlogs' : 1})}}
{{:helper.link('Logout', 'lock', {'logout' : 1})}}
{{else data.screen == 2}}

Records Maintenance

{{:helper.link('Backup To Disk', 'download', {'back' : 1}, 'disabled')}}
-
{{:helper.link('Upload From disk', 'upload', {'u_load' : 1}, 'disabled')}}
+
{{:helper.link('Upload From Disk', 'upload', {'u_load' : 1}, 'disabled')}}
{{:helper.link('Delete All Records', 'trash', {'del_all' : 1})}}
+
{{:helper.link('Delete All Cell Logs', 'trash', {'del_alllogs' : 1})}}
{{:helper.link('Back', 'arrow-left', {'screen' : 1})}}
{{else data.screen == 3}}

Security Record