mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-28 06:28:01 +01:00
More Input Conversion
This commit is contained in:
@@ -763,7 +763,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
var/max_length = 50
|
||||
|
||||
var/message = sanitize(input(usr, "Write a message. It cannot be longer than [max_length] characters.","Blood writing", ""))
|
||||
var/message = sanitize(tgui_input_text(usr, "Write a message. It cannot be longer than [max_length] characters.","Blood writing", "", max_length))
|
||||
|
||||
if (message)
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
var/input
|
||||
if(!message)
|
||||
input = sanitize_or_reflect(input(src, "Choose an emote to display.") as text|null, src) //VOREStation Edit - Reflect too long messages, within reason
|
||||
input = sanitize_or_reflect(tgui_input_text(src, "Choose an emote to display."), src) //VOREStation Edit - Reflect too long messages, within reason
|
||||
else
|
||||
input = message
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
/obj/item/weapon/secbot_assembly/ed209_assembly/slime/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) // Here in the event it's added into a PoI or some such. Standard construction relies on the standard ED up until taser.
|
||||
if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
qdel(src)
|
||||
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
..()
|
||||
|
||||
if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
..()
|
||||
|
||||
if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -409,7 +409,7 @@
|
||||
qdel(src)
|
||||
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = input(user, "Enter new robot name", name, created_name) as text
|
||||
var/t = tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN)
|
||||
t = sanitize(t, MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
|
||||
@@ -382,7 +382,7 @@
|
||||
user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
else if (istype(W, /obj/item/weapon/pen))
|
||||
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, user) && loc != user)
|
||||
@@ -412,7 +412,7 @@
|
||||
user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, user) && loc != user)
|
||||
|
||||
@@ -535,7 +535,7 @@
|
||||
/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && loc != usr)
|
||||
|
||||
@@ -472,7 +472,7 @@
|
||||
qdel(src)
|
||||
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, user) && loc != user)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
if(mind)
|
||||
mind.transfer_to(adult)
|
||||
if (can_namepick_as_adult)
|
||||
var/newname = sanitize(input(adult, "You have become an adult. Choose a name for yourself.", "Adult Name") as null|text, MAX_NAME_LEN)
|
||||
var/newname = sanitize(tgui_input_text(adult, "You have become an adult. Choose a name for yourself.", "Adult Name", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
|
||||
if(!newname)
|
||||
adult.fully_replace_character_name(name, "[src.adult_name] ([instance_num])")
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
to_chat(src,"<span class='warning'>You can't process [substance]!</span>")
|
||||
return //Only a few things matter, the rest are best not cluttering the lists.
|
||||
|
||||
var/howmuch = input(src,"How much do you want to store? (0-[matstack.get_amount()])","Select amount") as null|num
|
||||
var/howmuch = tgui_input_number(src,"How much do you want to store? (0-[matstack.get_amount()])","Select amount",null,matstack.get_amount(),0)
|
||||
if(!howmuch || matstack != get_active_hand() || howmuch > matstack.get_amount())
|
||||
return //Quietly fail
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
|
||||
|
||||
switch(option)
|
||||
if("name")
|
||||
t = sanitizeSafe(input(usr, "Enter a name for your pAI", "pAI Name", candidate.name) as text, MAX_NAME_LEN)
|
||||
t = sanitizeSafe(tgui_input_text(usr, "Enter a name for your pAI", "pAI Name", candidate.name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(t)
|
||||
candidate.name = t
|
||||
if("desc")
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
|
||||
spawn(0)
|
||||
var/newname
|
||||
newname = sanitizeSafe(input(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
|
||||
newname = sanitizeSafe(tgui_input_text(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","", MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if (newname)
|
||||
custom_name = newname
|
||||
sprite_name = newname
|
||||
|
||||
@@ -300,7 +300,7 @@
|
||||
/obj/item/weapon/pen/robopen/proc/RenamePaper(mob/user, obj/item/weapon/paper/paper)
|
||||
if ( !user || !paper )
|
||||
return
|
||||
var/n_name = sanitizeSafe(input(user, "What would you like to label the paper?", "Paper Labelling", null) as text, 32)
|
||||
var/n_name = sanitizeSafe(tgui_input_text(user, "What would you like to label the paper?", "Paper Labelling", null, 32), 32)
|
||||
if ( !user || !paper )
|
||||
return
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ var/list/_cat_default_emotes = list(
|
||||
if(named)
|
||||
to_chat(user, "<span class='notice'>\The [name] already has a name!</span>")
|
||||
else
|
||||
var/tmp_name = sanitizeSafe(input(user, "Give \the [name] a name", "Name"), MAX_NAME_LEN)
|
||||
var/tmp_name = sanitizeSafe(tgui_input_text(user, "Give \the [name] a name", "Name", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(length(tmp_name) > 50)
|
||||
to_chat(user, "<span class='notice'>The name can be at most 50 characters long.</span>")
|
||||
else
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
to_chat(src, "<span class='userdanger'>You've already set your name. Ask an admin to toggle \"nameset\" to 0 if you really must.</span>")
|
||||
return
|
||||
var/newname
|
||||
newname = sanitizeSafe(input(src,"Set your name. You only get to do this once. Max 52 chars.", "Name set","") as text, MAX_NAME_LEN)
|
||||
newname = sanitizeSafe(tgui_input_text(src,"Set your name. You only get to do this once. Max 52 chars.", "Name set","", MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if (newname)
|
||||
name = newname
|
||||
voice_name = newname
|
||||
@@ -30,7 +30,7 @@
|
||||
set desc = "Set your description."
|
||||
set category = "Abilities"
|
||||
var/newdesc
|
||||
newdesc = sanitizeSafe(input(src,"Set your description. Max 4096 chars.", "Description set","") as text, MAX_MESSAGE_LEN)
|
||||
newdesc = sanitizeSafe(tgui_input_text(src,"Set your description. Max 4096 chars.", "Description set",""), MAX_MESSAGE_LEN)
|
||||
if(newdesc)
|
||||
desc = newdesc
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
set desc = "Changes your name."
|
||||
set src = usr
|
||||
|
||||
var/new_name = sanitizeSafe(input(src, "Who would you like to be now?", "Communicator", src.client.prefs.real_name) as text, MAX_NAME_LEN)
|
||||
var/new_name = sanitizeSafe(tgui_input_text(src, "Who would you like to be now?", "Communicator", src.client.prefs.real_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(new_name)
|
||||
if(comm)
|
||||
comm.visible_message("<span class='notice'>[bicon(comm)] [src.name] has left, and now you see [new_name].</span>")
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
set src in usr
|
||||
if(usr != src)
|
||||
to_chat(usr, "No.")
|
||||
var/msg = sanitize(input(usr,"Set the flavor text in your 'examine' verb.","Flavor Text",html_decode(flavor_text)) as message|null, extra = 0) //VOREStation Edit: separating out OOC notes
|
||||
var/msg = sanitize(tgui_input_text(usr,"Set the flavor text in your 'examine' verb.","Flavor Text",html_decode(flavor_text), multiline = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
|
||||
|
||||
if(msg != null)
|
||||
flavor_text = msg
|
||||
|
||||
Reference in New Issue
Block a user