Input Conversion Part 2

This commit is contained in:
ItsSelis
2022-06-19 03:40:24 +02:00
parent 12611af1ee
commit 2d7b081a55
80 changed files with 160 additions and 160 deletions
+4 -4
View File
@@ -75,7 +75,7 @@
var/mob/living/carbon/human/H = usr
if(H.dna)
default = H.dna.b_type
var/new_blood_type = sanitize(input(usr,"What blood type would you like to be written on this card?","Agent Card Blood Type",default) as null|text)
var/new_blood_type = sanitize(tgui_input_text(usr,"What blood type would you like to be written on this card?","Agent Card Blood Type",default))
if(!isnull(new_blood_type) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.blood_type = new_blood_type
to_chat(usr, "<span class='notice'>Blood type changed to '[new_blood_type]'.</span>")
@@ -86,7 +86,7 @@
var/mob/living/carbon/human/H = usr
if(H.dna)
default = H.dna.unique_enzymes
var/new_dna_hash = sanitize(input(usr,"What DNA hash would you like to be written on this card?","Agent Card DNA Hash",default) as null|text)
var/new_dna_hash = sanitize(tgui_input_text(usr,"What DNA hash would you like to be written on this card?","Agent Card DNA Hash",default))
if(!isnull(new_dna_hash) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.dna_hash = new_dna_hash
to_chat(usr, "<span class='notice'>DNA hash changed to '[new_dna_hash]'.</span>")
@@ -103,7 +103,7 @@
to_chat(usr, "<span class='notice'>Fingerprint hash changed to '[new_fingerprint_hash]'.</span>")
. = TRUE
if("name")
var/new_name = sanitizeName(input(usr,"What name would you like to put on this card?","Agent Card Name", S.registered_name) as null|text)
var/new_name = sanitizeName(tgui_input_text(usr,"What name would you like to put on this card?","Agent Card Name", S.registered_name))
if(!isnull(new_name) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.registered_name = new_name
S.update_name()
@@ -114,7 +114,7 @@
to_chat(usr, "<span class='notice'>Photo changed.</span>")
. = TRUE
if("sex")
var/new_sex = sanitize(input(usr,"What sex would you like to put on this card?","Agent Card Sex", S.sex) as null|text)
var/new_sex = sanitize(tgui_input_text(usr,"What sex would you like to put on this card?","Agent Card Sex", S.sex))
if(!isnull(new_sex) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.sex = new_sex
to_chat(usr, "<span class='notice'>Sex changed to '[new_sex]'.</span>")
+1 -1
View File
@@ -260,7 +260,7 @@
if(message_cooldown > world.time)
to_chat(usr, "<span class='warning'>Please allow at least one minute to pass between announcements.</span>")
return
var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") as null|message
var/input = tgui_input_text(usr, "Please write a message to announce to the station crew.", "Priority Announcement", multiline = TRUE)
if(!input || message_cooldown > world.time || ..() || !(is_authenticated(usr) == COMM_AUTHENTICATION_MAX))
return
if(length(input) < COMM_MSGLEN_MINIMUM)
@@ -18,7 +18,7 @@
switch(action)
if("set_tag")
var/new_ident = sanitize_text(input(usr, "Enter a new ident tag.", "Gyrotron Control", gyro_tag) as null|text)
var/new_ident = sanitize_text(tgui_input_text(usr, "Enter a new ident tag.", "Gyrotron Control", gyro_tag))
if(new_ident)
gyro_tag = new_ident
return TRUE
+9 -9
View File
@@ -319,8 +319,8 @@
R.fields["x"] = linked.x
R.fields["y"] = linked.y
if("new")
var/newx = input(usr, "Input new entry x coordinate", "Coordinate input", linked.x) as num
var/newy = input(usr, "Input new entry y coordinate", "Coordinate input", linked.y) as num
var/newx = tgui_input_number(usr, "Input new entry x coordinate", "Coordinate input", linked.x)
var/newy = tgui_input_number(usr, "Input new entry y coordinate", "Coordinate input", linked.y)
R.fields["x"] = CLAMP(newx, 1, world.maxx)
R.fields["y"] = CLAMP(newy, 1, world.maxy)
known_sectors[sec_name] = R
@@ -335,12 +335,12 @@
if("setcoord")
if(params["setx"])
var/newx = input(usr, "Input new destiniation x coordinate", "Coordinate input", dx) as num|null
var/newx = tgui_input_number(usr, "Input new destiniation x coordinate", "Coordinate input", dx)
if(newx)
dx = CLAMP(newx, 1, world.maxx)
if(params["sety"])
var/newy = input(usr, "Input new destiniation y coordinate", "Coordinate input", dy) as num|null
var/newy = tgui_input_number(usr, "Input new destiniation y coordinate", "Coordinate input", dy)
if(newy)
dy = CLAMP(newy, 1, world.maxy)
. = TRUE
@@ -356,13 +356,13 @@
. = TRUE
if("speedlimit")
var/newlimit = input(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null
var/newlimit = tgui_input_number(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000)
if(newlimit)
speedlimit = CLAMP(newlimit/1000, 0, 100)
. = TRUE
if("accellimit")
var/newlimit = input(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null
var/newlimit = tgui_input_number(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000)
if(newlimit)
accellimit = max(newlimit/1000, 0)
. = TRUE
@@ -402,7 +402,7 @@
. = TRUE
if("set_global_limit")
var/newlim = input(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100, 100, 0)
linked.thrust_limit = clamp(newlim/100, 0, 1)
for(var/datum/ship_engine/E in linked.engines)
E.set_thrust_limit(linked.thrust_limit)
@@ -416,7 +416,7 @@
if("set_limit")
var/datum/ship_engine/E = locate(params["engine"])
var/newlim = input(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit(), 100, 0)
var/limit = clamp(newlim/100, 0, 1)
if(istype(E))
E.set_thrust_limit(limit)
@@ -437,7 +437,7 @@
/* END ENGINES */
/* SENSORS */
if("range")
var/nrange = input(usr, "Set new sensors range", "Sensor range", sensors.range) as num|null
var/nrange = tgui_input_number(usr, "Set new sensors range", "Sensor range", sensors.range)
if(nrange)
sensors.set_range(CLAMP(nrange, 1, world.view))
. = TRUE