TGUI Input Conversions

This commit is contained in:
Casey
2022-06-18 23:58:15 -04:00
committed by CHOMPStation2
parent 1740fb34de
commit 928a321b5f
201 changed files with 2350 additions and 491 deletions

View File

@@ -28,7 +28,7 @@
if("PRG_newtextfile")
if(!HDD)
return
var/newname = sanitize(input(usr, "Enter file name or leave blank to cancel:", "File rename"))
var/newname = sanitize(tgui_input_text(usr, "Enter file name or leave blank to cancel:", "File rename"))
if(!newname)
return
var/datum/computer_file/data/F = new/datum/computer_file/data()

View File

@@ -106,7 +106,7 @@
if(downloading || !loaded_article)
return
var/savename = sanitize(input(usr, "Enter file name or leave blank to cancel:", "Save article", loaded_article.filename))
var/savename = sanitize(tgui_input_text(usr, "Enter file name or leave blank to cancel:", "Save article", loaded_article.filename))
if(!savename)
return TRUE
var/obj/item/weapon/computer_hardware/hard_drive/HDD = computer.hard_drive

View File

@@ -133,7 +133,7 @@ var/global/nttransfer_uid = 0
if(!remote || !remote.provided_file)
return
if(remote.server_password)
var/pass = sanitize(input(usr, "Code 401 Unauthorized. Please enter password:", "Password required"))
var/pass = sanitize(tgui_input_text(usr, "Code 401 Unauthorized. Please enter password:", "Password required"))
if(pass != remote.server_password)
error = "Incorrect Password"
return
@@ -151,7 +151,7 @@ var/global/nttransfer_uid = 0
provided_file = null
return TRUE
if("PRG_setpassword")
var/pass = sanitize(input(usr, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none"))
var/pass = sanitize(tgui_input_text(usr, "Enter new server password. Leave blank to cancel, input 'none' to disable password.", "Server security", "none"))
if(!pass)
return
if(pass == "none")

View File

@@ -130,7 +130,7 @@
if(tgui_alert(usr, "Would you like to save your changes first?","Save Changes",list("Yes","No")) == "Yes")
save_file(open_file)
var/newname = sanitize(input(usr, "Enter file name:", "New File") as text|null)
var/newname = sanitize(tgui_input_text(usr, "Enter file name:", "New File"))
if(!newname)
return TRUE
var/datum/computer_file/data/F = create_file(newname)
@@ -143,7 +143,7 @@
return TRUE
if("PRG_saveasfile")
var/newname = sanitize(input(usr, "Enter file name:", "Save As") as text|null)
var/newname = sanitize(tgui_input_text(usr, "Enter file name:", "Save As"))
if(!newname)
return TRUE
var/datum/computer_file/data/F = create_file(newname, loaded_data)
@@ -155,7 +155,7 @@
if("PRG_savefile")
if(!open_file)
open_file = sanitize(input(usr, "Enter file name:", "Save As") as text|null)
open_file = sanitize(tgui_input_text(usr, "Enter file name:", "Save As"))
if(!open_file)
return 0
if(!save_file(open_file))

View File

@@ -80,14 +80,14 @@
if("ban_nid")
if(!ntnet_global)
return
var/nid = input(usr,"Enter NID of device which you want to block from the network:", "Enter NID") as null|num
var/nid = tgui_input_number(usr,"Enter NID of device which you want to block from the network:", "Enter NID")
if(nid && tgui_status(usr, state) == STATUS_INTERACTIVE)
ntnet_global.banned_nids |= nid
return TRUE
if("unban_nid")
if(!ntnet_global)
return
var/nid = input(usr,"Enter NID of device which you want to unblock from the network:", "Enter NID") as null|num
var/nid = tgui_input_number(usr,"Enter NID of device which you want to unblock from the network:", "Enter NID")
if(nid && tgui_status(usr, state) == STATUS_INTERACTIVE)
ntnet_global.banned_nids -= nid
return TRUE

View File

@@ -119,7 +119,7 @@ var/warrant_uid = 0
if("editwarrantnamecustom")
. = TRUE
var/new_name = sanitize(input(usr, "Please input name") as null|text)
var/new_name = sanitize(tgui_input_text(usr, "Please input name"))
if(tgui_status(usr, state) == STATUS_INTERACTIVE)
if (!new_name)
return
@@ -127,7 +127,7 @@ var/warrant_uid = 0
if("editwarrantcharges")
. = TRUE
var/new_charges = sanitize(input(usr, "Please input charges", "Charges", activewarrant.fields["charges"]) as null|text)
var/new_charges = sanitize(tgui_input_text(usr, "Please input charges", "Charges", activewarrant.fields["charges"]))
if(tgui_status(usr, state) == STATUS_INTERACTIVE)
if (!new_charges)
return

View File

@@ -285,7 +285,7 @@
return 0
if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
var/attempt_pin = input(usr, "Enter pin code", "Vendor transaction") as num
var/attempt_pin = tgui_input_number(usr, "Enter pin code", "Vendor transaction")
customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2)
if(!customer_account)