More TGUI Input Conversions

This commit is contained in:
Casey
2022-06-19 07:08:38 -04:00
committed by CHOMPStation2
parent 1740fb34de
commit b0802ce267
101 changed files with 2948 additions and 143 deletions

View File

@@ -176,7 +176,7 @@
if(!check_interactivity(M))
return
var/input = sanitizeSafe(input(usr, "What do you want to name this?", "Rename", src.name) as null|text, MAX_NAME_LEN)
var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name this?", "Rename", src.name, MAX_NAME_LEN), MAX_NAME_LEN)
if(src && input)
to_chat(M, "<span class='notice'>The machine now has a label reading '[input]'.</span>")
name = input

View File

@@ -68,7 +68,7 @@ a creative player the means to solve many problems. Circuits are held inside an
if(!check_interactivity(M))
return
var/input = sanitizeSafe(input(usr, "What do you want to name the circuit?", "Rename", src.name) as null|text, MAX_NAME_LEN)
var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name the circuit?", "Rename", src.name, MAX_NAME_LEN), MAX_NAME_LEN)
if(src && input && assembly.check_interactivity(M))
to_chat(M, "<span class='notice'>The circuit '[src.name]' is now labeled '[input]'.</span>")
displayed_name = input

View File

@@ -159,7 +159,7 @@ list[](
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
return new_data
if("number")
new_data = input(usr, "Now type in a number.","[src] number writing", isnum(default) ? default : null) as null|num
new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing", isnum(default) ? default : null)
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
return new_data

View File

@@ -3,7 +3,7 @@
name = "char pin"
/datum/integrated_io/char/ask_for_pin_data(mob/user)
var/new_data = input(usr, "Please type in one character.","[src] char writing") as null|text
var/new_data = tgui_input_text(usr, "Please type in one character.","[src] char writing")
if(holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data ? "new_data" : "NULL"] into the pin.</span>")
write_data_to_pin(new_data)

View File

@@ -3,7 +3,7 @@
name = "dir pin"
/datum/integrated_io/dir/ask_for_pin_data(mob/user)
var/new_data = input(usr, "Please type in a valid dir number. \
var/new_data = tgui_input_number(usr, "Please type in a valid dir number. \
Valid dirs are;\n\
North/Fore = [NORTH],\n\
South/Aft = [SOUTH],\n\
@@ -14,7 +14,7 @@
Southeast = [SOUTHEAST],\n\
Southwest = [SOUTHWEST],\n\
Up = [UP],\n\
Down = [DOWN]","[src] dir writing") as null|num
Down = [DOWN]","[src] dir writing")
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
write_data_to_pin(new_data)

View File

@@ -4,7 +4,7 @@
// data = 0
/datum/integrated_io/number/ask_for_pin_data(mob/user)
var/new_data = input(usr, "Please type in a number.","[src] number writing") as null|num
var/new_data = tgui_input_number(usr, "Please type in a number.","[src] number writing")
if(isnum(new_data) && holder.check_interactivity(user) )
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
write_data_to_pin(new_data)

View File

@@ -129,7 +129,7 @@
to_chat(user, "<span class='notice'>You set \the [src]'s memory to \"[new_data]\".</span>")
if("number")
accepting_refs = 0
new_data = input(usr, "Now type in a number.","[src] number writing") as null|num
new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing")
if(isnum(new_data) && CanInteract(user, GLOB.tgui_physical_state))
data_to_write = new_data
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [new_data].</span>")