mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-21 23:52:12 +00:00
New Investigator QoL/Features (#13422)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user