New Investigator QoL/Features (#13422)

This commit is contained in:
mikomyazaki
2022-04-10 11:57:05 +01:00
committed by GitHub
parent 3d937e6ff9
commit a0992e257e
6 changed files with 248 additions and 189 deletions

View File

@@ -19,7 +19,9 @@
req_access = list(access_tcomsat)
attack_hand(mob/user as mob)
var/last_print_time
/obj/machinery/computer/telecomms/server/attack_hand(mob/user)
if(stat & (BROKEN|NOPOWER))
return
user.set_machine(src)
@@ -48,7 +50,7 @@
if(1)
dat += "<br>[temp]<br>"
dat += "<center><a href='?src=\ref[src];operation=mainmenu'>\[Main Menu\]</a> <a href='?src=\ref[src];operation=refresh'>\[Refresh\]</a></center>"
dat += "<center><a href='?src=\ref[src];operation=mainmenu'>\[Main Menu\]</a> <a href='?src=\ref[src];operation=refresh'>\[Refresh\]</a> <a href='?src=\ref[src];operation=printlog'>\[Print Logs\]</a></center>"
dat += "<br>Current Network: [network]"
dat += "<br>Selected Server: [SelectedServer.id]"
@@ -57,53 +59,7 @@
else
dat += "<br>Total recorded traffic: [SelectedServer.totaltraffic] Gigabytes<br><br>"
dat += "Stored Logs: <ol>"
var/i = 0
for(var/datum/comm_log_entry/C in SelectedServer.log_entries)
i++
// If the log is a speech file
if(C.input_type == "Speech File")
dat += "<li><font color = #008F00>[C.name]</font> <font color = #FF0000><a href='?src=\ref[src];delete=[i]'>\[X\]</a></font><br>"
// -- Determine race of orator --
var/race = C.parameters["race"] // The actual race of the mob
var/language = C.parameters["language"] // The language spoken, or null/""
// -- If the orator is a human, or universal translate is active, OR mob has universal speech on --
if(universal_translate || C.parameters["uspeech"] || C.parameters["intelligible"])
dat += "<u><font color = #18743E>Data type</font></u>: [C.input_type]<br>"
dat += "<u><font color = #18743E>Source</font></u>: [C.parameters["name"]] (Job: [C.parameters["job"]])<br>"
dat += "<u><font color = #18743E>Class</font></u>: [race]<br>"
dat += "<u><font color = #18743E>Contents</font></u>: \"[C.parameters["message"]]\"<br>"
if(language)
dat += "<u><font color = #18743E>Language</font></u>: [language]<br/>"
// -- Orator is not human and universal translate not active --
else
dat += "<u><font color = #18743E>Data type</font></u>: Audio File<br>"
dat += "<u><font color = #18743E>Source</font></u>: <i>Unidentifiable</i><br>"
dat += "<u><font color = #18743E>Class</font></u>: [race]<br>"
dat += "<u><font color = #18743E>Contents</font></u>: <i>Unintelligble</i><br>"
dat += "</li><br>"
else if(C.input_type == "Execution Error")
dat += "<li><font color = #990000>[C.name]</font> <font color = #FF0000><a href='?src=\ref[src];delete=[i]'>\[X\]</a></font><br>"
dat += "<u><font color = #787700>Output</font></u>: \"[C.parameters["message"]]\"<br>"
dat += "</li><br>"
dat += "</ol>"
dat += log_entries_to_text(SelectedServer)
user << browse(dat, "window=comm_monitor;size=575x400")
onclose(user, "server_control")
@@ -111,8 +67,7 @@
temp = ""
return
Topic(href, href_list)
/obj/machinery/computer/telecomms/server/Topic(href, href_list)
if(..())
return
@@ -153,6 +108,34 @@
screen = 0
if("printlog")
var/start_point = 1
var/end_point = SelectedServer.log_entries.len
if(SelectedServer)
if(SelectedServer.log_entries.len)
start_point = input(usr, "Type the start address to print from, cancel to print full log.", "Start Address") as null|num
if(!isnum(start_point))
start_point = 1
else
end_point = input(usr, "Type the end address to print to, cancel to print full log.", "End Address") as null|num
if(!isnum(end_point))
end_point = 0
else
to_chat(usr, SPAN_WARNING("Cannot print from server that has no logs."))
return
else
to_chat(usr, SPAN_WARNING("Select a server before trying to print logs."))
return
if(!last_print_time || (last_print_time + 2 SECONDS < world.time))
last_print_time = world.time
var/obj/item/paper/P = new /obj/item/paper(get_turf(src), log_entries_to_text(SelectedServer, start_point, end_point), "[SelectedServer.id] Logs ([start_point] - [end_point])")
var/mob/M = usr
if(M)
M.put_in_hands(P)
else
to_chat(usr, SPAN_WARNING("Please wait before trying to print more logs."))
if(href_list["delete"])
if(!src.allowed(usr) && !emagged)
@@ -189,7 +172,7 @@
updateUsrDialog()
return
attackby(var/obj/item/D as obj, var/mob/user as mob)
/obj/machinery/computer/telecomms/server/attackby(var/obj/item/D, var/mob/user)
if(D.isscrewdriver())
playsound(src.loc, D.usesound, 50, 1)
if(do_after(user, 20/D.toolspeed))
@@ -226,3 +209,55 @@
to_chat(user, "<span class='notice'>You you disable the security protocols</span>")
src.updateUsrDialog()
return 1
/obj/machinery/computer/telecomms/server/proc/log_entries_to_text(var/obj/machinery/telecomms/server/SelectedServer, start = 1, end = SelectedServer.log_entries.len)
if(!end)
end = SelectedServer.log_entries.len
start = between(1, start, SelectedServer.log_entries.len)
end = between(0, end, SelectedServer.log_entries.len)
var/list/log_entries = SelectedServer.log_entries.Copy(start, end + 1)
. += "Stored Logs: <ol>"
var/i = start - 1
for(var/datum/comm_log_entry/C as anything in log_entries)
i++
// If the log is a speech file
if(C.input_type == "Speech File")
. += "<li><font color = #008F00>[C.name]</font> <font color = #FF0000><a href='?src=\ref[src];delete=[i]'>\[X\]</a></font><br>"
// -- Determine race of orator --
var/race = C.parameters["race"] // The actual race of the mob
var/language = C.parameters["language"] // The language spoken, or null/""
// -- If the orator is a human, or universal translate is active, OR mob has universal speech on --
if(universal_translate || C.parameters["uspeech"] || C.parameters["intelligible"])
. += "<u><font color = #18743E>Data type</font></u>: [C.input_type]<br>"
. += "<u><font color = #18743E>Source</font></u>: [C.parameters["name"]] (Job: [C.parameters["job"]])<br>"
. += "<u><font color = #18743E>Class</font></u>: [race]<br>"
. += "<u><font color = #18743E>Contents</font></u>: \"[C.parameters["message"]]\"<br>"
if(language)
. += "<u><font color = #18743E>Language</font></u>: [language]<br/>"
// -- Orator is not human and universal translate not active --
else
. += "<u><font color = #18743E>Data type</font></u>: Audio File<br>"
. += "<u><font color = #18743E>Source</font></u>: <i>Unidentifiable</i><br>"
. += "<u><font color = #18743E>Class</font></u>: [race]<br>"
. += "<u><font color = #18743E>Contents</font></u>: <i>Unintelligble</i><br>"
. += "</li><br>"
else if(C.input_type == "Execution Error")
. += "<li><font color = #990000>[C.name]</font> <font color = #FF0000><a href='?src=\ref[src];delete=[i]'>\[X\]</a></font><br>"
. += "<u><font color = #787700>Output</font></u>: \"[C.parameters["message"]]\"<br>"
. += "</li><br>"
. += "</ol>"

View File

@@ -367,6 +367,7 @@
new /obj/item/device/laser_pointer/blue(src)
new /obj/item/device/camera/detective(src)
new /obj/item/device/camera_film(src)
new /obj/item/stamp/investigations(src)
//Belts
new /obj/item/clothing/accessory/holster/waist(src)
new /obj/item/clothing/accessory/storage/pouches/black(src)

View File

@@ -51,11 +51,16 @@
active_warrant = null
if(href_list["editwarrant"])
. = TRUE
for(var/datum/record/warrant/W in SSrecords.warrants)
if(W.id == text2num(href_list["editwarrant"]))
active_warrant = W
break
return TRUE
if(href_list["back"])
. = TRUE
active_warrant = null
return TRUE
// The following actions will only be possible if the user has an ID with security access equipped. This is in line with modular computer framework's authentication methods,
// which also use RFID scanning to allow or disallow access to some functions. Anyone can view warrants, editing requires ID.
@@ -64,10 +69,15 @@
if(!istype(user))
return
var/obj/item/card/id/I = user.GetIdCard()
if(!istype(I) || !I.registered_name || !(access_armory in I.access) || issilicon(user))
if(!istype(I) || !I.registered_name || !(access_security in I.access) || issilicon(user))
to_chat(user, SPAN_WARNING("Authentication error: Unable to locate ID with appropriate access to allow this operation."))
return
// Require higher access to edit warrants that have already been authorized
if(active_warrant && active_warrant.authorization != "Unauthorized" && !(access_armory in I.access))
to_chat(user, SPAN_WARNING("Authentication error: Unable to locate ID with appropriate access to adjust an authorized warrant."))
return
if(href_list["addwarrant"])
. = TRUE
var/datum/record/warrant/W = new()
@@ -83,6 +93,8 @@
W.notes = "No reason given"
W.authorization = "Unauthorized"
W.wtype = "search"
if(isnull(temp))
return
active_warrant = W
if(href_list["savewarrant"])
@@ -123,10 +135,9 @@
active_warrant.notes = new_charges
if(href_list["editwarrantauth"])
if(!(access_armory in I.access))
to_chat(user, SPAN_WARNING("Authentication error: Unable to locate ID with appropriate access to allow this operation."))
return
. = TRUE
active_warrant.authorization = "[I.registered_name] - [I.assignment ? I.assignment : "(Unknown)"]"
if(href_list["back"])
. = TRUE
active_warrant = null

View File

@@ -35,6 +35,10 @@
name = "chief medical officer's rubber stamp"
icon_state = "stamp-cmo"
/obj/item/stamp/investigations
name = "case closed stamp"
icon_state = "stamp-investigator"
/obj/item/stamp/denied
name = "\improper DENIED rubber stamp"
icon_state = "stamp-deny"

View File

@@ -0,0 +1,8 @@
author: mikomyazaki
delete-after: True
changes:
- tweak: "Security Officers, Investigators and Security Cadets can now submit warrants for approval using the warrant program. They cannot authorize warrants or edit authorized warrants."
- rscadd: "Investigators now have a 'Case Closed' stamp in their lockers."
- rscadd: "The Telecomms Server Monitor can now print channel logs."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 29 KiB