mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-17 18:14:25 +01:00
More Input Conversion
This commit is contained in:
@@ -155,7 +155,7 @@
|
||||
bound_height = width * world.icon_size
|
||||
|
||||
/obj/structure/door_assembly/proc/rename_door(mob/living/user)
|
||||
var/t = sanitizeSafe(input(user, "Enter the name for the windoor.", src.name, src.created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the windoor.", src.name, src.created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!in_range(src, user) && src.loc != user) return
|
||||
created_name = t
|
||||
update_state()
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
E.description_antag = "This is a 'disguised' emag, to make your escape from wherever you happen to be trapped."
|
||||
H.equip_to_appropriate_slot(E)
|
||||
|
||||
var/newname = sanitize(input(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change") as null|text, MAX_NAME_LEN)
|
||||
var/newname = sanitize(tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if (newname)
|
||||
H.real_name = newname
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
var/obj/item/C = new newpath(H)
|
||||
H.equip_to_appropriate_slot(C)
|
||||
|
||||
var/newname = sanitize(input(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change") as null|text, MAX_NAME_LEN)
|
||||
var/newname = sanitize(tgui_input_text(H, "Your mind feels foggy, and you recall your name might be [H.real_name]. Would you like to change your name?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if (newname)
|
||||
H.real_name = newname
|
||||
|
||||
|
||||
@@ -52,14 +52,14 @@
|
||||
|
||||
/obj/structure/gravemarker/attackby(obj/item/weapon/W, mob/user as mob)
|
||||
if(W.is_screwdriver())
|
||||
var/carving_1 = sanitizeSafe(input(user, "Who is \the [src.name] for?", "Gravestone Naming", null) as text, MAX_NAME_LEN)
|
||||
var/carving_1 = sanitizeSafe(tgui_input_text(user, "Who is \the [src.name] for?", "Gravestone Naming", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(carving_1)
|
||||
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
|
||||
if(do_after(user, material.hardness * W.toolspeed))
|
||||
user.visible_message("[user] carves something into \the [src.name].", "You carve your message into \the [src.name].")
|
||||
grave_name += carving_1
|
||||
update_icon()
|
||||
var/carving_2 = sanitizeSafe(input(user, "What message should \the [src.name] have?", "Epitaph Carving", null) as text, MAX_NAME_LEN)
|
||||
var/carving_2 = sanitizeSafe(tgui_input_text(user, "What message should \the [src.name] have?", "Epitaph Carving", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(carving_2)
|
||||
user.visible_message("[user] starts carving \the [src.name].", "You start carving \the [src.name].")
|
||||
if(do_after(user, material.hardness * W.toolspeed))
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
if(user.mind)
|
||||
user.mind.transfer_to(vox)
|
||||
spawn(1)
|
||||
var/newname = sanitizeSafe(input(vox,"Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN)
|
||||
var/newname = sanitizeSafe(tgui_input_text(vox,"Enter a name, or leave blank for the default name.", "Name change","", MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!newname || newname == "")
|
||||
var/datum/language/L = GLOB.all_languages[vox.species.default_language]
|
||||
newname = L.get_random_name()
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
/obj/structure/morgue/attackby(P as obj, mob/user as mob)
|
||||
if (istype(P, /obj/item/weapon/pen))
|
||||
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
|
||||
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null)
|
||||
if (user.get_active_hand() != P)
|
||||
return
|
||||
if ((!in_range(src, usr) && src.loc != user))
|
||||
@@ -249,7 +249,7 @@ GLOBAL_LIST_BOILERPLATE(all_crematoriums, /obj/structure/morgue/crematorium)
|
||||
|
||||
/obj/structure/morgue/crematorium/attackby(P as obj, mob/user as mob)
|
||||
if (istype(P, /obj/item/weapon/pen))
|
||||
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
|
||||
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null)
|
||||
if (user.get_active_hand() != P)
|
||||
return
|
||||
if ((!in_range(src, usr) > 1 && src.loc != user))
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
var/new_bearing
|
||||
if(free_rotate)
|
||||
new_bearing = input(usr, "What bearing do you want to rotate \the [src] to?", "[name]") as num
|
||||
new_bearing = tgui_input_number(usr, "What bearing do you want to rotate \the [src] to?", "[name]")
|
||||
new_bearing = round(new_bearing)
|
||||
if(new_bearing <= -1 || new_bearing > 360)
|
||||
to_chat(user, "<span class='warning'>Rotating \the [src] [new_bearing] degrees would be a waste of time.</span>")
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
var/new_bearing
|
||||
if(free_rotate)
|
||||
new_bearing = input(usr, "What bearing do you want to rotate \the [src] to?", "[name]") as num
|
||||
new_bearing = tgui_input_number(usr, "What bearing do you want to rotate \the [src] to?", "[name]")
|
||||
new_bearing = round(new_bearing)
|
||||
if(new_bearing <= -1 || new_bearing > 360)
|
||||
to_chat(user, "<span class='warning'>Rotating \the [src] [new_bearing] degrees would be a waste of time.</span>")
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/windoor_assembly/proc/rename_door(mob/living/user)
|
||||
var/t = sanitizeSafe(input(user, "Enter the name for the windoor.", src.name, src.created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the windoor.", src.name, src.created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!in_range(src, user) && src.loc != user) return
|
||||
created_name = t
|
||||
update_state()
|
||||
|
||||
@@ -612,7 +612,7 @@
|
||||
to_chat(user, "<span class='notice'>\The [src] is linked to \the [buffered_button].</span>")
|
||||
return TRUE
|
||||
// Otherwise fall back to asking them
|
||||
var/t = sanitizeSafe(input(user, "Enter the ID for the window.", src.name, null), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter the ID for the window.", src.name, null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if (!t && user.get_active_hand() != W && in_range(src, user))
|
||||
src.id = t
|
||||
to_chat(user, "<span class='notice'>The new ID of \the [src] is [id]</span>")
|
||||
@@ -667,7 +667,7 @@
|
||||
var/obj/item/device/multitool/MT = W
|
||||
if(!id)
|
||||
// If no ID is set yet (newly built button?) let them select an ID for first-time use!
|
||||
var/t = sanitizeSafe(input(user, "Enter an ID for \the [src].", src.name, null), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter an ID for \the [src].", src.name, null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if (t && user.get_active_hand() != W && in_range(src, user))
|
||||
src.id = t
|
||||
to_chat(user, "<span class='notice'>The new ID of \the [src] is [id]</span>")
|
||||
|
||||
Reference in New Issue
Block a user