mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-17 10:05:27 +01:00
tgui usr to ui.user
This commit is contained in:
@@ -72,19 +72,19 @@ var/warrant_uid = 0
|
||||
// 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. This also prevents situations where you show a tablet
|
||||
// to someone who is to be arrested, which allows them to change the stuff there.
|
||||
var/obj/item/card/id/I = usr.GetIdCard()
|
||||
var/obj/item/card/id/I = ui.user.GetIdCard()
|
||||
if(!istype(I) || !I.registered_name || !(access_security in I.GetAccess()))
|
||||
to_chat(usr, "Authentication error: Unable to locate ID with appropriate access to allow this operation.")
|
||||
to_chat(ui.user, "Authentication error: Unable to locate ID with appropriate access to allow this operation.")
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("addwarrant")
|
||||
. = TRUE
|
||||
var/datum/data/record/warrant/W = new()
|
||||
var/temp = tgui_alert(usr, "Do you want to create a search-, or an arrest warrant?", "Warrant Type", list("Search","Arrest","Cancel"))
|
||||
var/temp = tgui_alert(ui.user, "Do you want to create a search-, or an arrest warrant?", "Warrant Type", list("Search","Arrest","Cancel"))
|
||||
if(!temp)
|
||||
return
|
||||
if(tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
if(tgui_status(ui.user, state) == STATUS_INTERACTIVE)
|
||||
if(temp == "Arrest")
|
||||
W.fields["namewarrant"] = "Unknown"
|
||||
W.fields["charges"] = "No charges present"
|
||||
@@ -112,24 +112,24 @@ var/warrant_uid = 0
|
||||
var/namelist = list()
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
namelist += t.fields["name"]
|
||||
var/new_name = sanitize(tgui_input_list(usr, "Please input name:", "Name Choice", namelist))
|
||||
if(tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
var/new_name = sanitize(tgui_input_list(ui.user, "Please input name:", "Name Choice", namelist))
|
||||
if(tgui_status(ui.user, state) == STATUS_INTERACTIVE)
|
||||
if (!new_name)
|
||||
return
|
||||
activewarrant.fields["namewarrant"] = new_name
|
||||
|
||||
if("editwarrantnamecustom")
|
||||
. = TRUE
|
||||
var/new_name = sanitize(tgui_input_text(usr, "Please input name"))
|
||||
if(tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
var/new_name = sanitize(tgui_input_text(ui.user, "Please input name"))
|
||||
if(tgui_status(ui.user, state) == STATUS_INTERACTIVE)
|
||||
if (!new_name)
|
||||
return
|
||||
activewarrant.fields["namewarrant"] = new_name
|
||||
|
||||
if("editwarrantcharges")
|
||||
. = TRUE
|
||||
var/new_charges = sanitize(tgui_input_text(usr, "Please input charges", "Charges", activewarrant.fields["charges"]))
|
||||
if(tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
var/new_charges = sanitize(tgui_input_text(ui.user, "Please input charges", "Charges", activewarrant.fields["charges"]))
|
||||
if(tgui_status(ui.user, state) == STATUS_INTERACTIVE)
|
||||
if (!new_charges)
|
||||
return
|
||||
activewarrant.fields["charges"] = new_charges
|
||||
@@ -137,6 +137,6 @@ var/warrant_uid = 0
|
||||
if("editwarrantauth")
|
||||
. = TRUE
|
||||
if(!(access_hos in I.GetAccess())) // VOREStation edit begin
|
||||
to_chat(usr, span_warning("You don't have the access to do this!"))
|
||||
to_chat(ui.user, span_warning("You don't have the access to do this!"))
|
||||
return // VOREStation edit end
|
||||
activewarrant.fields["auth"] = "[I.registered_name] - [I.assignment ? I.assignment : "(Unknown)"]"
|
||||
|
||||
Reference in New Issue
Block a user