From af64bcf4061acbdcb98f974ead611f29f71ebd17 Mon Sep 17 00:00:00 2001 From: ItsSelis Date: Sun, 19 Jun 2022 12:21:51 +0200 Subject: [PATCH] More Input Conversion --- code/game/antagonist/antagonist_create.dm | 2 +- code/game/antagonist/station/rogue_ai.dm | 2 +- .../gamemodes/changeling/powers/mimic_voice.dm | 2 +- code/game/gamemodes/cult/runes.dm | 2 +- code/game/jobs/job/civilian_chaplain.dm | 6 +++--- code/game/machinery/computer/message.dm | 2 +- code/game/machinery/doorbell_vr.dm | 2 +- code/game/machinery/portable_turret.dm | 2 +- .../machinery/telecomms/machine_interactions.dm | 2 +- code/game/machinery/virtual_reality/ar_console.dm | 4 ++-- code/game/machinery/virtual_reality/vr_console.dm | 2 +- code/game/mecha/mecha.dm | 4 ++-- code/game/objects/items/blueprints.dm | 4 ++-- code/game/objects/items/devices/translocator_vr.dm | 2 +- code/game/objects/items/robot/robot_upgrades.dm | 2 +- code/game/objects/items/toys/godfigures.dm | 2 +- code/game/objects/items/uav.dm | 2 +- code/game/objects/items/weapons/AI_modules.dm | 2 +- .../objects/items/weapons/material/gravemarker.dm | 4 ++-- .../game/objects/items/weapons/storage/firstaid.dm | 2 +- code/game/objects/structures/door_assembly.dm | 2 +- code/game/objects/structures/ghost_pods/human.dm | 4 ++-- code/game/objects/structures/gravemarker.dm | 4 ++-- code/game/objects/structures/mirror.dm | 2 +- code/game/objects/structures/morgue.dm | 4 ++-- code/game/objects/structures/props/beam_prism.dm | 4 ++-- code/game/objects/structures/windoor_assembly.dm | 2 +- code/game/objects/structures/window.dm | 4 ++-- code/game/turfs/turf.dm | 2 +- code/modules/admin/verbs/custom_event.dm | 2 +- code/modules/admin/view_variables/topic.dm | 2 +- .../client/preference_setup/antagonism/01_basic.dm | 4 ++-- .../preference_setup/general/05_background.dm | 14 +++++++------- .../client/preference_setup/global/03_pai.dm | 2 +- .../client/preference_setup/loadout/gear_tweaks.dm | 4 ++-- .../preference_setup/loadout/gear_tweaks_vr.dm | 2 +- .../client/preference_setup/vore/07_traits.dm | 12 ++++++------ code/modules/client/verbs/character_directory.dm | 2 +- .../clothing/under/accessories/accessory_vr.dm | 6 +++--- code/modules/emotes/emote_mob.dm | 4 ++-- code/modules/games/cards.dm | 2 +- code/modules/ghosttrap/trap.dm | 2 +- .../integrated_electronics/core/assemblies.dm | 2 +- .../core/integrated_circuit.dm | 2 +- code/modules/integrated_electronics/core/pins.dm | 2 +- .../core/special_pins/char_pin.dm | 2 +- .../core/special_pins/dir_pin.dm | 4 ++-- .../core/special_pins/number_pin.dm | 2 +- code/modules/integrated_electronics/core/tools.dm | 2 +- .../integrated_electronics/subtypes/input.dm | 2 +- code/modules/library/lib_items.dm | 2 +- code/modules/library/lib_machines.dm | 6 +++--- .../materials/sheets/organic/animal_products.dm | 2 +- code/modules/mining/drilling/drill.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/emote.dm | 2 +- code/modules/mob/living/bot/SLed209bot.dm | 2 +- code/modules/mob/living/bot/cleanbot.dm | 2 +- code/modules/mob/living/bot/ed209bot.dm | 2 +- code/modules/mob/living/bot/edCLNbot.dm | 2 +- code/modules/mob/living/bot/farmbot.dm | 2 +- code/modules/mob/living/bot/floorbot.dm | 4 ++-- code/modules/mob/living/bot/medbot.dm | 2 +- code/modules/mob/living/bot/secbot.dm | 2 +- .../modules/mob/living/carbon/alien/progression.dm | 2 +- .../species/station/protean_vr/protean_powers.dm | 2 +- code/modules/mob/living/silicon/pai/recruit.dm | 2 +- code/modules/mob/living/silicon/robot/robot.dm | 2 +- .../mob/living/silicon/robot/robot_items.dm | 2 +- .../living/simple_mob/subtypes/animal/pets/cat.dm | 2 +- .../mob/living/simple_mob/subtypes/vore/vore.dm | 4 ++-- code/modules/mob/living/voice/voice.dm | 2 +- code/modules/mob/mob.dm | 2 +- .../file_system/programs/generic/file_browser.dm | 2 +- .../file_system/programs/generic/wordprocessor.dm | 2 +- .../programs/research/email_administration.dm | 4 ++-- code/modules/multiz/ladder_assembly_vr.dm | 2 +- code/modules/nifsoft/nif.dm | 2 +- code/modules/nifsoft/software/13_soulcatcher.dm | 4 ++-- code/modules/paperwork/folders.dm | 2 +- code/modules/paperwork/handlabeler.dm | 2 +- code/modules/paperwork/paper.dm | 4 ++-- code/modules/paperwork/paper_bundle.dm | 2 +- code/modules/paperwork/paper_sticky.dm | 2 +- code/modules/paperwork/photography.dm | 4 ++-- code/modules/persistence/graffiti.dm | 2 +- code/modules/projectiles/ammunition.dm | 2 +- .../reagents/reagent_containers/blood_pack.dm | 2 +- code/modules/reagents/reagent_containers/glass.dm | 2 +- code/modules/recycling/sortingmachinery.dm | 4 ++-- code/modules/tgui/modules/agentcard.dm | 6 +++--- code/modules/tgui/modules/appearance_changer.dm | 6 +++--- code/modules/tgui/modules/communications.dm | 4 ++-- code/modules/tgui/modules/law_manager.dm | 4 ++-- code/modules/tgui/modules/ntos-only/cardmod.dm | 2 +- code/modules/tgui/modules/ntos-only/email.dm | 10 +++++----- code/modules/xenobio/items/slime_objects.dm | 2 +- code/modules/xenobio/items/slimepotions.dm | 2 +- 98 files changed, 145 insertions(+), 145 deletions(-) diff --git a/code/game/antagonist/antagonist_create.dm b/code/game/antagonist/antagonist_create.dm index 84c5b2317e..3dd683377f 100644 --- a/code/game/antagonist/antagonist_create.dm +++ b/code/game/antagonist/antagonist_create.dm @@ -118,7 +118,7 @@ /datum/antagonist/proc/set_antag_name(var/mob/living/player) // Choose a name, if any. - var/newname = sanitize(input(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN) + var/newname = sanitize(tgui_input_text(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN) if (newname) player.real_name = newname player.name = player.real_name diff --git a/code/game/antagonist/station/rogue_ai.dm b/code/game/antagonist/station/rogue_ai.dm index e1b73b064b..fd3ee867f9 100644 --- a/code/game/antagonist/station/rogue_ai.dm +++ b/code/game/antagonist/station/rogue_ai.dm @@ -97,7 +97,7 @@ var/datum/antagonist/rogue_ai/malf testing("rogue_ai set_antag_name called on non-silicon mob [player]!") return // Choose a name, if any. - var/newname = sanitize(input(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN) + var/newname = sanitize(tgui_input_text(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN) if (newname) player.SetName(newname) if(player.mind) player.mind.name = player.name diff --git a/code/game/gamemodes/changeling/powers/mimic_voice.dm b/code/game/gamemodes/changeling/powers/mimic_voice.dm index 6b84c577ff..be4a055dc1 100644 --- a/code/game/gamemodes/changeling/powers/mimic_voice.dm +++ b/code/game/gamemodes/changeling/powers/mimic_voice.dm @@ -22,7 +22,7 @@ to_chat(src, "We return our vocal glands to their original location.") return - var/mimic_voice = sanitize(input(usr, "Enter a name to mimic.", "Mimic Voice", null), MAX_NAME_LEN) + var/mimic_voice = sanitize(tgui_input_text(usr, "Enter a name to mimic.", "Mimic Voice", null, MAX_NAME_LEN), MAX_NAME_LEN) if(!mimic_voice) return diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index fac7066de4..3ad86499bd 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -611,7 +611,7 @@ var/list/sacrificed = list() // returns 0 if the rune is not used. returns 1 if the rune is used. /obj/effect/rune/proc/communicate() . = 1 // Default output is 1. If the rune is deleted it will return 1 - var/input = input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")//sanitize() below, say() and whisper() have their own + var/input = tgui_input_text(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")//sanitize() below, say() and whisper() have their own if(!input) if (istype(src)) fizzle() diff --git a/code/game/jobs/job/civilian_chaplain.dm b/code/game/jobs/job/civilian_chaplain.dm index f811abf957..1d7cfd7f5e 100644 --- a/code/game/jobs/job/civilian_chaplain.dm +++ b/code/game/jobs/job/civilian_chaplain.dm @@ -38,7 +38,7 @@ /datum/job/chaplain/proc/religion_prompts(mob/living/carbon/human/H, obj/item/weapon/storage/bible/B, obj/item/weapon/card/id/I) var/religion_name = "Unitarianism" - var/new_religion = sanitize(input(H, "You are the crew services officer. Would you like to change your religion? Default is Unitarianism", "Name change", religion_name), MAX_NAME_LEN) + var/new_religion = sanitize(tgui_input_text(H, "You are the crew services officer. Would you like to change your religion? Default is Unitarianism", "Name change", religion_name, MAX_NAME_LEN), MAX_NAME_LEN) if(!new_religion) new_religion = religion_name @@ -79,12 +79,12 @@ B.name = "The Holy Book of [new_religion]" var/deity_name = "Hashem" - var/new_deity = sanitize(input(H, "Would you like to change your deity? Default is Hashem", "Name change", deity_name), MAX_NAME_LEN) + var/new_deity = sanitize(tgui_input_text(H, "Would you like to change your deity? Default is Hashem", "Name change", deity_name, MAX_NAME_LEN), MAX_NAME_LEN) if((length(new_deity) == 0) || (new_deity == "Hashem")) new_deity = deity_name - var/new_title = sanitize(input(H, "Would you like to change your title?", "Title Change", I.assignment), MAX_NAME_LEN) + var/new_title = sanitize(tgui_input_text(H, "Would you like to change your title?", "Title Change", I.assignment, MAX_NAME_LEN), MAX_NAME_LEN) var/list/all_jobs = get_job_datums() diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index ec5a1f5fcd..27009d097b 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -246,7 +246,7 @@ var/dkey = trim(tgui_input_text(usr, "Please enter the current decryption key.")) if(dkey && dkey != "") if(linkedServer.decryptkey == dkey) - var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):")) + var/newkey = trim(tgui_input_text(usr,"Please enter the new key (3 - 16 characters max):",null,null,16)) if(length(newkey) <= 3) set_temp("NOTICE: Decryption key too short!", "average") else if(length(newkey) > 16) diff --git a/code/game/machinery/doorbell_vr.dm b/code/game/machinery/doorbell_vr.dm index d90a46000f..906c41ea6d 100644 --- a/code/game/machinery/doorbell_vr.dm +++ b/code/game/machinery/doorbell_vr.dm @@ -129,7 +129,7 @@ if(default_deconstruction_screwdriver(user, W)) return else if(panel_open && istype(W, /obj/item/weapon/pen)) - var/t = sanitizeSafe(input(user, "Enter the name for \the [src].", src.name, initial(src.name)), MAX_NAME_LEN) + var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for \the [src].", src.name, initial(src.name), MAX_NAME_LEN), MAX_NAME_LEN) if(t && in_range(src, user)) name = t else if(panel_open && istype(W, /obj/item/device/multitool)) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 359410f494..87e39ac937 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -1092,7 +1092,7 @@ return if(istype(I, /obj/item/weapon/pen)) //you can rename turrets like bots! - var/t = sanitizeSafe(input(user, "Enter new turret name", name, finish_name) as text, MAX_NAME_LEN) + var/t = sanitizeSafe(tgui_input_text(user, "Enter new turret name", name, finish_name, MAX_NAME_LEN), MAX_NAME_LEN) if(!t) return if(!in_range(src, usr) && loc != usr) diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 41bb3e65fe..1a9fc2246e 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -288,7 +288,7 @@ . = TRUE if("id") - var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN) + var/newid = copytext(reject_bad_text(tgui_input_text(usr, "Specify the new ID for this machine", src, id)),1,MAX_MESSAGE_LEN) if(newid && canAccess(usr)) id = newid set_temp("-% New ID assigned: \"[id]\" %-", "average") diff --git a/code/game/machinery/virtual_reality/ar_console.dm b/code/game/machinery/virtual_reality/ar_console.dm index 6cf182e106..904c439596 100644 --- a/code/game/machinery/virtual_reality/ar_console.dm +++ b/code/game/machinery/virtual_reality/ar_console.dm @@ -103,7 +103,7 @@ occupant.enter_vr(avatar) - var/newname = sanitize(input(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it could also be [avatar.name]. Would you like to change it to something else?", "Name change") as null|text, MAX_NAME_LEN) + var/newname = sanitize(tgui_input_text(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it could also be [avatar.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN) if (newname) avatar.real_name = newname @@ -113,7 +113,7 @@ else // There's only one body per one of these pods, so let's be kind. - var/newname = sanitize(input(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it feels like it is [avatar.name]. Would you like to change it to something else?", "Name change") as null|text, MAX_NAME_LEN) + var/newname = sanitize(tgui_input_text(avatar, "Your mind feels foggy. You're certain your name is [occupant.real_name], but it feels like it is [avatar.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN) if(newname) avatar.real_name = newname diff --git a/code/game/machinery/virtual_reality/vr_console.dm b/code/game/machinery/virtual_reality/vr_console.dm index 4a83de34d3..9d165cc7e3 100644 --- a/code/game/machinery/virtual_reality/vr_console.dm +++ b/code/game/machinery/virtual_reality/vr_console.dm @@ -250,7 +250,7 @@ occupant.enter_vr(avatar) // Prompt for username after they've enterred the body. - var/newname = sanitize(input(avatar, "You are entering virtual reality. Your username is currently [src.name]. Would you like to change it to something else?", "Name change") as null|text, MAX_NAME_LEN) + var/newname = sanitize(tgui_input_text(avatar, "You are entering virtual reality. Your username is currently [src.name]. Would you like to change it to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN) if (newname) avatar.real_name = newname diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 3c428580f3..8b5b53b168 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -2551,7 +2551,7 @@ return if (href_list["change_name"]) if(usr != src.occupant) return - var/newname = sanitizeSafe(input(occupant,"Choose new exosuit name","Rename exosuit",initial(name)) as text, MAX_NAME_LEN) + var/newname = sanitizeSafe(tgui_input_text(occupant,"Choose new exosuit name","Rename exosuit",initial(name), MAX_NAME_LEN), MAX_NAME_LEN) if(newname) name = newname else @@ -2590,7 +2590,7 @@ if(!in_range(src, usr)) return var/mob/user = top_filter.getMob("user") if(user) - var/new_pressure = input(user,"Input new output pressure","Pressure setting",internal_tank_valve) as num + var/new_pressure = tgui_input_number(user,"Input new output pressure","Pressure setting",internal_tank_valve) if(new_pressure) internal_tank_valve = new_pressure to_chat(user, "The internal pressure valve has been set to [internal_tank_valve]kPa.") diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 00183ec90c..e8ea1b16c9 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -141,7 +141,7 @@ to_chat(usr, "Error! Please notify administration!") return var/list/turf/turfs = res - var/str = sanitizeSafe(input(usr, "New area name:","Blueprint Editing", ""), MAX_NAME_LEN) + var/str = sanitizeSafe(tgui_input_text(usr, "New area name:","Blueprint Editing", "", MAX_NAME_LEN), MAX_NAME_LEN) if(!str || !length(str)) //cancel return if(length(str) > 50) @@ -200,7 +200,7 @@ /obj/item/blueprints/proc/edit_area() var/area/A = get_area() var/prevname = "[A.name]" - var/str = sanitizeSafe(input(usr, "New area name:","Blueprint Editing", prevname), MAX_NAME_LEN) + var/str = sanitizeSafe(tgui_input_text(usr, "New area name:","Blueprint Editing", prevname, MAX_NAME_LEN), MAX_NAME_LEN) if(!str || !length(str) || str==prevname) //cancel return if(length(str) > 50) diff --git a/code/game/objects/items/devices/translocator_vr.dm b/code/game/objects/items/devices/translocator_vr.dm index 02089da037..3a0fb80bd0 100644 --- a/code/game/objects/items/devices/translocator_vr.dm +++ b/code/game/objects/items/devices/translocator_vr.dm @@ -135,7 +135,7 @@ This device records all warnings given and teleport events for admin review in c to_chat(user, "The translocator can't support any more beacons!") return - var/new_name = html_encode(input(user,"New beacon's name (2-20 char):","[src]") as text|null) + var/new_name = html_encode(tgui_input_text(user,"New beacon's name (2-20 char):","[src]",null,20)) if(!check_menu(user)) return diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index 3938f3c17b..ac184ea558 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -40,7 +40,7 @@ var/heldname = "default name" /obj/item/borg/upgrade/rename/attack_self(mob/user as mob) - heldname = sanitizeSafe(input(user, "Enter new robot name", "Robot Reclassification", heldname), MAX_NAME_LEN) + heldname = sanitizeSafe(tgui_input_text(user, "Enter new robot name", "Robot Reclassification", heldname, MAX_NAME_LEN), MAX_NAME_LEN) /obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/R) if(..()) return 0 diff --git a/code/game/objects/items/toys/godfigures.dm b/code/game/objects/items/toys/godfigures.dm index 027544a0eb..9801640d54 100644 --- a/code/game/objects/items/toys/godfigures.dm +++ b/code/game/objects/items/toys/godfigures.dm @@ -123,7 +123,7 @@ var/mob/M = usr if(!M.mind) return 0 - var/input = sanitizeSafe(input(usr, "What do you want to name the icon?", ,""), MAX_NAME_LEN) + var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name the icon?", ,"", null, MAX_NAME_LEN), MAX_NAME_LEN) if(src && input && !M.stat && in_range(M,src)) name = "icon of " + input diff --git a/code/game/objects/items/uav.dm b/code/game/objects/items/uav.dm index b1ff2723a8..f534ff9a42 100644 --- a/code/game/objects/items/uav.dm +++ b/code/game/objects/items/uav.dm @@ -136,7 +136,7 @@ cell = I else if(istype(I, /obj/item/weapon/pen) || istype(I, /obj/item/device/flashlight/pen)) - var/tmp_label = sanitizeSafe(input(user, "Enter a nickname for [src]", "Nickname", nickname), MAX_NAME_LEN) + var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a nickname for [src]", "Nickname", nickname, MAX_NAME_LEN), MAX_NAME_LEN) if(length(tmp_label) > 50 || length(tmp_label) < 3) to_chat(user, "The nickname must be between 3 and 50 characters.") else diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index 2eec58b136..0c318fc8dd 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -240,7 +240,7 @@ AI MODULES /obj/item/weapon/aiModule/freeform/attack_self(var/mob/user as mob) ..() - var/new_lawpos = input(usr, "Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num + var/new_lawpos = tgui_input_number(usr, "Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) if(new_lawpos < MIN_SUPPLIED_LAW_NUMBER) return lawpos = min(new_lawpos, MAX_SUPPLIED_LAW_NUMBER) var/newlaw = "" diff --git a/code/game/objects/items/weapons/material/gravemarker.dm b/code/game/objects/items/weapons/material/gravemarker.dm index d3c615e8fd..83d65a6c3b 100644 --- a/code/game/objects/items/weapons/material/gravemarker.dm +++ b/code/game/objects/items/weapons/material/gravemarker.dm @@ -13,14 +13,14 @@ /obj/item/weapon/material/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)) diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm index 84c1637a3e..2d19634aaf 100644 --- a/code/game/objects/items/weapons/storage/firstaid.dm +++ b/code/game/objects/items/weapons/storage/firstaid.dm @@ -208,7 +208,7 @@ /obj/item/weapon/storage/pill_bottle/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) - var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN) + var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN) if(length(tmp_label) > 50) to_chat(user, "The label can be at most 50 characters long.") else if(length(tmp_label) > 10) diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 108e824616..6846b52066 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -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() diff --git a/code/game/objects/structures/ghost_pods/human.dm b/code/game/objects/structures/ghost_pods/human.dm index f2b3291597..13ae71ef92 100644 --- a/code/game/objects/structures/ghost_pods/human.dm +++ b/code/game/objects/structures/ghost_pods/human.dm @@ -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 diff --git a/code/game/objects/structures/gravemarker.dm b/code/game/objects/structures/gravemarker.dm index e53fcdeb20..381401b352 100644 --- a/code/game/objects/structures/gravemarker.dm +++ b/code/game/objects/structures/gravemarker.dm @@ -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)) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 4fc64a5c52..8cb6749823 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -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() diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 6e1e8edf89..4e67afbc46 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -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)) diff --git a/code/game/objects/structures/props/beam_prism.dm b/code/game/objects/structures/props/beam_prism.dm index a8d22fad50..96c6dc57b9 100644 --- a/code/game/objects/structures/props/beam_prism.dm +++ b/code/game/objects/structures/props/beam_prism.dm @@ -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, "Rotating \the [src] [new_bearing] degrees would be a waste of time.") @@ -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, "Rotating \the [src] [new_bearing] degrees would be a waste of time.") diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 28e54a4062..0ea141ce2a 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -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() diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 098861595b..fa9d9dc2a0 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -612,7 +612,7 @@ to_chat(user, "\The [src] is linked to \the [buffered_button].") 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, "The new ID of \the [src] is [id]") @@ -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, "The new ID of \the [src] is [id]") diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 66376f4431..fa4f4a7e27 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -330,7 +330,7 @@ to_chat(vandal, "There's too much graffiti here to add more.") return FALSE - var/message = sanitize(input(usr, "Enter a message to engrave.", "Graffiti") as null|text, trim = TRUE) + var/message = sanitize(tgui_input_text(usr, "Enter a message to engrave.", "Graffiti"), trim = TRUE) if(!message) return FALSE diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index 6b92e9932e..a2550c6afe 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -7,7 +7,7 @@ to_chat(src, "Only administrators may use this command.") return - var/input = sanitize(input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null, MAX_PAPER_MESSAGE_LEN, extra = 0) + var/input = sanitize(tgui_input_text(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg, MAX_PAPER_MESSAGE_LEN, TRUE), MAX_PAPER_MESSAGE_LEN, extra = 0) if(!input || input == "") custom_event_msg = null log_admin("[usr.key] has cleared the custom event text.") diff --git a/code/modules/admin/view_variables/topic.dm b/code/modules/admin/view_variables/topic.dm index a014544090..5080b5cdd4 100644 --- a/code/modules/admin/view_variables/topic.dm +++ b/code/modules/admin/view_variables/topic.dm @@ -21,7 +21,7 @@ to_chat(usr, "This can only be used on instances of type /mob") return - var/new_name = sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null, MAX_NAME_LEN) + var/new_name = sanitize(tgui_input_text(usr,"What would you like to name this mob?","Input a name",M.real_name,MAX_NAME_LEN), MAX_NAME_LEN) if( !new_name || !M ) return message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].") diff --git a/code/modules/client/preference_setup/antagonism/01_basic.dm b/code/modules/client/preference_setup/antagonism/01_basic.dm index 100595aaba..feeff7172d 100644 --- a/code/modules/client/preference_setup/antagonism/01_basic.dm +++ b/code/modules/client/preference_setup/antagonism/01_basic.dm @@ -44,7 +44,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None") return TOPIC_REFRESH if(href_list["exploitable_record"]) - var/exploitmsg = sanitize(input(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record)) as message|null, MAX_RECORD_LENGTH, extra = 0) + var/exploitmsg = sanitize(tgui_input_text(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record), MAX_RECORD_LENGTH, TRUE), MAX_RECORD_LENGTH, extra = 0) if(!isnull(exploitmsg) && !jobban_isbanned(user, "Records") && CanUseTopic(user)) pref.exploit_record = exploitmsg return TOPIC_REFRESH @@ -54,7 +54,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None") if(!choice || !CanUseTopic(user)) return TOPIC_NOACTION if(choice == "Other") - var/raw_choice = sanitize(input(user, "Please enter a faction.", "Character Preference") as text|null, MAX_NAME_LEN) + var/raw_choice = sanitize(tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN) if(raw_choice) pref.antag_faction = raw_choice else diff --git a/code/modules/client/preference_setup/general/05_background.dm b/code/modules/client/preference_setup/general/05_background.dm index 50d1b362df..6593c9c2d3 100644 --- a/code/modules/client/preference_setup/general/05_background.dm +++ b/code/modules/client/preference_setup/general/05_background.dm @@ -71,7 +71,7 @@ if(!choice || !CanUseTopic(user)) return TOPIC_NOACTION if(choice == "Other") - var/raw_choice = sanitize(input(user, "Please enter a home system.", "Character Preference") as text|null, MAX_NAME_LEN) + var/raw_choice = sanitize(tgui_input_text(user, "Please enter a home system.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN) if(raw_choice && CanUseTopic(user)) pref.home_system = raw_choice else @@ -83,7 +83,7 @@ if(!choice || !CanUseTopic(user)) return TOPIC_NOACTION if(choice == "Other") - var/raw_choice = sanitize(input(user, "Please enter your current citizenship.", "Character Preference") as text|null, MAX_NAME_LEN) + var/raw_choice = sanitize(tgui_input_text(user, "Please enter your current citizenship.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN) if(raw_choice && CanUseTopic(user)) pref.citizenship = raw_choice else @@ -95,7 +95,7 @@ if(!choice || !CanUseTopic(user)) return TOPIC_NOACTION if(choice == "Other") - var/raw_choice = sanitize(input(user, "Please enter a faction.", "Character Preference") as text|null, MAX_NAME_LEN) + var/raw_choice = sanitize(tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN) if(raw_choice) pref.faction = raw_choice else @@ -107,7 +107,7 @@ if(!choice || !CanUseTopic(user)) return TOPIC_NOACTION if(choice == "Other") - var/raw_choice = sanitize(input(user, "Please enter a religon.", "Character Preference") as text|null, MAX_NAME_LEN) + var/raw_choice = sanitize(tgui_input_text(user, "Please enter a religon.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN) if(raw_choice) pref.religion = sanitize(raw_choice) else @@ -115,19 +115,19 @@ return TOPIC_REFRESH else if(href_list["set_medical_records"]) - var/new_medical = sanitize(input(user,"Enter medical information here.","Character Preference", html_decode(pref.med_record)) as message|null, MAX_RECORD_LENGTH, extra = 0) + var/new_medical = sanitize(tgui_input_text(user,"Enter medical information here.","Character Preference", html_decode(pref.med_record), MAX_RECORD_LENGTH, TRUE), MAX_RECORD_LENGTH, extra = 0) if(!isnull(new_medical) && !jobban_isbanned(user, "Records") && CanUseTopic(user)) pref.med_record = new_medical return TOPIC_REFRESH else if(href_list["set_general_records"]) - var/new_general = sanitize(input(user,"Enter employment information here.","Character Preference", html_decode(pref.gen_record)) as message|null, MAX_RECORD_LENGTH, extra = 0) + var/new_general = sanitize(tgui_input_text(user,"Enter employment information here.","Character Preference", html_decode(pref.gen_record), MAX_RECORD_LENGTH, TRUE), MAX_RECORD_LENGTH, extra = 0) if(!isnull(new_general) && !jobban_isbanned(user, "Records") && CanUseTopic(user)) pref.gen_record = new_general return TOPIC_REFRESH else if(href_list["set_security_records"]) - var/sec_medical = sanitize(input(user,"Enter security information here.","Character Preference", html_decode(pref.sec_record)) as message|null, MAX_RECORD_LENGTH, extra = 0) + var/sec_medical = sanitize(tgui_input_text(user,"Enter security information here.","Character Preference", html_decode(pref.sec_record), MAX_RECORD_LENGTH, TRUE), MAX_RECORD_LENGTH, extra = 0) if(!isnull(sec_medical) && !jobban_isbanned(user, "Records") && CanUseTopic(user)) pref.sec_record = sec_medical return TOPIC_REFRESH diff --git a/code/modules/client/preference_setup/global/03_pai.dm b/code/modules/client/preference_setup/global/03_pai.dm index 6993e0dc6d..0fdbf3dc58 100644 --- a/code/modules/client/preference_setup/global/03_pai.dm +++ b/code/modules/client/preference_setup/global/03_pai.dm @@ -42,7 +42,7 @@ var/t switch(href_list["option"]) if("name") - t = sanitizeName(input(user, "Enter a name for your pAI", "Global Preference", candidate.name) as text|null, MAX_NAME_LEN, 1) + t = sanitizeName(tgui_input_text(user, "Enter a name for your pAI", "Global Preference", candidate.name, MAX_NAME_LEN), MAX_NAME_LEN, 1) if(t && CanUseTopic(user)) candidate.name = t if("desc") diff --git a/code/modules/client/preference_setup/loadout/gear_tweaks.dm b/code/modules/client/preference_setup/loadout/gear_tweaks.dm index 11e0f1f777..b7cd2b5366 100644 --- a/code/modules/client/preference_setup/loadout/gear_tweaks.dm +++ b/code/modules/client/preference_setup/loadout/gear_tweaks.dm @@ -172,7 +172,7 @@ var/datum/gear_tweak/custom_name/gear_tweak_free_name = new() return if(valid_custom_names) return tgui_input_list(user, "Choose an item name.", "Character Preference", valid_custom_names, metadata) - var/san_input = sanitize(input(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata) as text|null, MAX_LNAME_LEN, extra = 0) + var/san_input = sanitize(tgui_input_text(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata, MAX_LNAME_LEN), MAX_LNAME_LEN, extra = 0) return san_input ? san_input : get_default() /datum/gear_tweak/custom_name/tweak_item(var/obj/item/I, var/metadata) @@ -204,7 +204,7 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new() return if(valid_custom_desc) return tgui_input_list(user, "Choose an item description.", "Character Preference",valid_custom_desc, metadata) - var/san_input = sanitize(input(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata) as message|null, extra = 0) + var/san_input = sanitize(tgui_input_text(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata, multiline = TRUE), extra = 0) return san_input ? san_input : get_default() /datum/gear_tweak/custom_desc/tweak_item(var/obj/item/I, var/metadata) diff --git a/code/modules/client/preference_setup/loadout/gear_tweaks_vr.dm b/code/modules/client/preference_setup/loadout/gear_tweaks_vr.dm index 488a62fbc9..4de3362d6f 100644 --- a/code/modules/client/preference_setup/loadout/gear_tweaks_vr.dm +++ b/code/modules/client/preference_setup/loadout/gear_tweaks_vr.dm @@ -5,7 +5,7 @@ return "" /datum/gear_tweak/collar_tag/get_metadata(var/user, var/metadata) - return sanitize( input(user, "Choose the tag text", "Character Preference", metadata) as text , MAX_NAME_LEN ) + return sanitize( tgui_input_text(user, "Choose the tag text", "Character Preference", metadata, MAX_NAME_LEN), MAX_NAME_LEN ) /datum/gear_tweak/collar_tag/tweak_item(var/obj/item/clothing/accessory/collar/C, var/metadata) if(metadata == "") diff --git a/code/modules/client/preference_setup/vore/07_traits.dm b/code/modules/client/preference_setup/vore/07_traits.dm index 931a3c1f58..8538dba867 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -219,8 +219,8 @@ return TOPIC_NOACTION else if(href_list["custom_species"]) - var/raw_choice = sanitize(input(user, "Input your custom species name:", - "Character Preference", pref.custom_species) as null|text, MAX_NAME_LEN) + var/raw_choice = sanitize(tgui_input_text(user, "Input your custom species name:", + "Character Preference", pref.custom_species, MAX_NAME_LEN), MAX_NAME_LEN) if (CanUseTopic(user)) pref.custom_species = raw_choice return TOPIC_REFRESH @@ -268,25 +268,25 @@ return TOPIC_REFRESH else if(href_list["custom_say"]) - var/say_choice = sanitize(input(usr, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say) as null|text, 12) + var/say_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say, 12), 12) if(say_choice) pref.custom_say = say_choice return TOPIC_REFRESH else if(href_list["custom_whisper"]) - var/whisper_choice = sanitize(input(usr, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper) as null|text, 12) + var/whisper_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper, 12), 12) if(whisper_choice) pref.custom_whisper = whisper_choice return TOPIC_REFRESH else if(href_list["custom_ask"]) - var/ask_choice = sanitize(input(usr, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask) as null|text, 12) + var/ask_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask, 12), 12) if(ask_choice) pref.custom_ask = ask_choice return TOPIC_REFRESH else if(href_list["custom_exclaim"]) - var/exclaim_choice = sanitize(input(usr, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [pref.real_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim) as null|text, 12) + var/exclaim_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [pref.real_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim, 12), 12) if(exclaim_choice) pref.custom_exclaim = exclaim_choice return TOPIC_REFRESH diff --git a/code/modules/client/verbs/character_directory.dm b/code/modules/client/verbs/character_directory.dm index fc003569d5..5820913572 100644 --- a/code/modules/client/verbs/character_directory.dm +++ b/code/modules/client/verbs/character_directory.dm @@ -137,7 +137,7 @@ GLOBAL_DATUM(character_directory, /datum/character_directory) return var/current_ad = usr.client.prefs.directory_ad - var/new_ad = sanitize(input(usr, "Change your character ad", "Character Ad", current_ad) as message|null, extra = 0) + var/new_ad = sanitize(tgui_input_text(usr, "Change your character ad", "Character Ad", current_ad, multiline = TRUE), extra = 0) if(isnull(new_ad)) return usr.client.prefs.directory_ad = new_ad diff --git a/code/modules/clothing/under/accessories/accessory_vr.dm b/code/modules/clothing/under/accessories/accessory_vr.dm index d337ef47a4..4c68c2be59 100644 --- a/code/modules/clothing/under/accessories/accessory_vr.dm +++ b/code/modules/clothing/under/accessories/accessory_vr.dm @@ -167,7 +167,7 @@ var/new_frequency = sanitize_frequency(frequency + text2num(href_list["freq"])) set_frequency(new_frequency) if(href_list["tag"]) - var/str = copytext(reject_bad_text(input(usr,"Tag text?","Set tag","")),1,MAX_NAME_LEN) + var/str = copytext(reject_bad_text(tgui_input_text(usr,"Tag text?","Set tag","",MAX_NAME_LEN)),1,MAX_NAME_LEN) if(!str || !length(str)) to_chat(usr,"[name]'s tag set to be blank.") name = initial(name) @@ -300,7 +300,7 @@ return to_chat(user,"You adjust the [name]'s tag.") - var/str = copytext(reject_bad_text(input(user,"Tag text?","Set tag","")),1,MAX_NAME_LEN) + var/str = copytext(reject_bad_text(tgui_input_text(user,"Tag text?","Set tag","",MAX_NAME_LEN)),1,MAX_NAME_LEN) if(!str || !length(str)) to_chat(user,"[name]'s tag set to be blank.") @@ -337,7 +337,7 @@ if(!(istype(user.get_active_hand(),I)) || !(istype(user.get_inactive_hand(),src)) || (user.stat)) return - var/str = copytext(reject_bad_text(input(user,"Tag text?","Set tag","")),1,MAX_NAME_LEN) + var/str = copytext(reject_bad_text(tgui_input_text(user,"Tag text?","Set tag","",MAX_NAME_LEN)),1,MAX_NAME_LEN) if(!str || !length(str)) if(!writtenon) diff --git a/code/modules/emotes/emote_mob.dm b/code/modules/emotes/emote_mob.dm index b0b3fce0bb..0a6a0793fb 100644 --- a/code/modules/emotes/emote_mob.dm +++ b/code/modules/emotes/emote_mob.dm @@ -54,7 +54,7 @@ if(act == "custom") if(!message) - message = sanitize_or_reflect(input(src,"Choose an emote to display.") as text|null, src) //VOREStation Edit - Reflect too long messages, within reason + message = sanitize_or_reflect(tgui_input_text(src,"Choose an emote to display."), src) //VOREStation Edit - Reflect too long messages, within reason if(!message) return if (!m_type) @@ -165,7 +165,7 @@ var/input if(!message) - input = sanitize(input(src,"Choose an emote to display.") as text|null) + input = sanitize(tgui_input_text(src,"Choose an emote to display.")) else input = message diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 58df571a49..4ee2728bdb 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -188,7 +188,7 @@ if(P.name != "Blank Card") to_chat(user,"You cannot write on that card.") return - var/cardtext = sanitize(input(user, "What do you wish to write on the card?", "Card Editing") as text|null, MAX_PAPER_MESSAGE_LEN) + var/cardtext = sanitize(tgui_input_text(user, "What do you wish to write on the card?", "Card Editing", null, MAX_PAPER_MESSAGE_LEN), MAX_PAPER_MESSAGE_LEN) if(!cardtext) return P.name = cardtext diff --git a/code/modules/ghosttrap/trap.dm b/code/modules/ghosttrap/trap.dm index 594d6f2e45..4e68683542 100644 --- a/code/modules/ghosttrap/trap.dm +++ b/code/modules/ghosttrap/trap.dm @@ -93,7 +93,7 @@ var/list/ghost_traps // Allows people to set their own name. May or may not need to be removed for posibrains if people are dumbasses. /datum/ghosttrap/proc/set_new_name(var/mob/target) - var/newname = sanitizeSafe(input(target,"Enter a name, or leave blank for the default name.", "Name change","") as text, MAX_NAME_LEN) + var/newname = sanitizeSafe(tgui_input_text(target,"Enter a name, or leave blank for the default name.", "Name change","", MAX_NAME_LEN), MAX_NAME_LEN) if (newname != "") target.real_name = newname target.name = target.real_name diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 11f4a53a0d..1f08f1dec5 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -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, "The machine now has a label reading '[input]'.") name = input diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm index 89cbf4fdd1..209b59d37a 100644 --- a/code/modules/integrated_electronics/core/integrated_circuit.dm +++ b/code/modules/integrated_electronics/core/integrated_circuit.dm @@ -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, "The circuit '[src.name]' is now labeled '[input]'.") displayed_name = input diff --git a/code/modules/integrated_electronics/core/pins.dm b/code/modules/integrated_electronics/core/pins.dm index a52e626dcc..c402cf022d 100644 --- a/code/modules/integrated_electronics/core/pins.dm +++ b/code/modules/integrated_electronics/core/pins.dm @@ -159,7 +159,7 @@ list[]( to_chat(user, "You input [new_data] into the pin.") 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, "You input [new_data] into the pin.") return new_data diff --git a/code/modules/integrated_electronics/core/special_pins/char_pin.dm b/code/modules/integrated_electronics/core/special_pins/char_pin.dm index 0449b70549..734d4515be 100644 --- a/code/modules/integrated_electronics/core/special_pins/char_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/char_pin.dm @@ -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, "You input [new_data ? "new_data" : "NULL"] into the pin.") write_data_to_pin(new_data) diff --git a/code/modules/integrated_electronics/core/special_pins/dir_pin.dm b/code/modules/integrated_electronics/core/special_pins/dir_pin.dm index 4b523f9114..368eb27b93 100644 --- a/code/modules/integrated_electronics/core/special_pins/dir_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/dir_pin.dm @@ -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, "You input [new_data] into the pin.") write_data_to_pin(new_data) diff --git a/code/modules/integrated_electronics/core/special_pins/number_pin.dm b/code/modules/integrated_electronics/core/special_pins/number_pin.dm index 92b07638bd..07fe8f089a 100644 --- a/code/modules/integrated_electronics/core/special_pins/number_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/number_pin.dm @@ -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, "You input [new_data] into the pin.") write_data_to_pin(new_data) diff --git a/code/modules/integrated_electronics/core/tools.dm b/code/modules/integrated_electronics/core/tools.dm index 278ddf0947..dcaaf58057 100644 --- a/code/modules/integrated_electronics/core/tools.dm +++ b/code/modules/integrated_electronics/core/tools.dm @@ -129,7 +129,7 @@ to_chat(user, "You set \the [src]'s memory to \"[new_data]\".") 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, "You set \the [src]'s memory to [new_data].") diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index 2d275e2386..4b9f5a9152 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -53,7 +53,7 @@ power_draw_per_use = 4 /obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user) - var/new_input = input(user, "Enter a number, please.","Number pad", get_pin_data(IC_OUTPUT, 1)) as null|num + var/new_input = tgui_input_number(user, "Enter a number, please.","Number pad", get_pin_data(IC_OUTPUT, 1)) if(isnum(new_input) && CanInteract(user, GLOB.tgui_physical_state)) set_pin_data(IC_OUTPUT, 1, new_input) push_data() diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 421110c391..62b5222552 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -33,7 +33,7 @@ O.loc = src update_icon() else if(istype(O, /obj/item/weapon/pen)) - var/newname = sanitizeSafe(input(usr, "What would you like to title this bookshelf?"), MAX_NAME_LEN) + var/newname = sanitizeSafe(tgui_input_text(usr, "What would you like to title this bookshelf?", null, null, MAX_NAME_LEN), MAX_NAME_LEN) if(!newname) return else diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index b4ea291cdb..a3ee1610c4 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -367,7 +367,7 @@ if(href_list["editbook"]) buffer_book = sanitizeSafe(tgui_input_text(usr, "Enter the book's title:")) if(href_list["editmob"]) - buffer_mob = sanitize(input(usr, "Enter the recipient's name:") as text|null, MAX_NAME_LEN) + buffer_mob = sanitize(tgui_input_text(usr, "Enter the recipient's name:", null, null, MAX_NAME_LEN), MAX_NAME_LEN) if(href_list["checkout"]) var/datum/borrowbook/b = new /datum/borrowbook b.bookname = sanitizeSafe(buffer_book) @@ -382,7 +382,7 @@ var/obj/item/weapon/book/b = locate(href_list["delbook"]) inventory.Remove(b) if(href_list["setauthor"]) - var/newauthor = sanitize(input(usr, "Enter the author's name: ") as text|null) + var/newauthor = sanitize(tgui_input_text(usr, "Enter the author's name: ")) if(newauthor) scanner.cache.author = newauthor if(href_list["setcategory"]) @@ -462,7 +462,7 @@ query.Execute() if(href_list["orderbyid"]) - var/orderid = input(usr, "Enter your order:") as num|null + var/orderid = tgui_input_number(usr, "Enter your order:") if(orderid) if(isnum(orderid)) var/nhref = "src=\ref[src];targetid=[orderid]" diff --git a/code/modules/materials/sheets/organic/animal_products.dm b/code/modules/materials/sheets/organic/animal_products.dm index c0084bf93c..4a0c9cd7bb 100644 --- a/code/modules/materials/sheets/organic/animal_products.dm +++ b/code/modules/materials/sheets/organic/animal_products.dm @@ -163,4 +163,4 @@ desc = "A handmade blindfold that covers the eyes, preventing sight." /obj/item/clothing/accessory/collar/craftable/attack_self(mob/living/user as mob) - given_name = sanitizeSafe(input(usr, "What would you like to label the collar?", "Collar Labelling", null) as text, MAX_NAME_LEN) + given_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the collar?", "Collar Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN) diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index 868056afd8..0baa14a790 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -173,7 +173,7 @@ /obj/machinery/mining/drill/attackby(obj/item/O as obj, mob/user as mob) if(!active) if(istype(O, /obj/item/device/multitool)) - var/newtag = text2num(sanitizeSafe(input(user, "Enter new ID number or leave empty to cancel.", "Assign ID number") as text, 4)) + var/newtag = text2num(sanitizeSafe(tgui_input_text(user, "Enter new ID number or leave empty to cancel.", "Assign ID number", null, 4), 4)) if(newtag) name = "[initial(name)] #[newtag]" to_chat(user, "You changed the drill ID to: [newtag]") diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 1a78de6558..d786f54e24 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -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) diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index f59ebf612c..48cdfa3ebd 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -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 diff --git a/code/modules/mob/living/bot/SLed209bot.dm b/code/modules/mob/living/bot/SLed209bot.dm index 82f3c43cc2..f016bc55f2 100644 --- a/code/modules/mob/living/bot/SLed209bot.dm +++ b/code/modules/mob/living/bot/SLed209bot.dm @@ -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) diff --git a/code/modules/mob/living/bot/cleanbot.dm b/code/modules/mob/living/bot/cleanbot.dm index c6d790adeb..3d854bd166 100644 --- a/code/modules/mob/living/bot/cleanbot.dm +++ b/code/modules/mob/living/bot/cleanbot.dm @@ -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) diff --git a/code/modules/mob/living/bot/ed209bot.dm b/code/modules/mob/living/bot/ed209bot.dm index 8700988e59..f699191a66 100644 --- a/code/modules/mob/living/bot/ed209bot.dm +++ b/code/modules/mob/living/bot/ed209bot.dm @@ -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) diff --git a/code/modules/mob/living/bot/edCLNbot.dm b/code/modules/mob/living/bot/edCLNbot.dm index 5ef7cdf9c9..ffdcdb1f44 100644 --- a/code/modules/mob/living/bot/edCLNbot.dm +++ b/code/modules/mob/living/bot/edCLNbot.dm @@ -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) diff --git a/code/modules/mob/living/bot/farmbot.dm b/code/modules/mob/living/bot/farmbot.dm index 969bfc1c83..938ed1d8e0 100644 --- a/code/modules/mob/living/bot/farmbot.dm +++ b/code/modules/mob/living/bot/farmbot.dm @@ -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 diff --git a/code/modules/mob/living/bot/floorbot.dm b/code/modules/mob/living/bot/floorbot.dm index a7a7def771..22584ae359 100644 --- a/code/modules/mob/living/bot/floorbot.dm +++ b/code/modules/mob/living/bot/floorbot.dm @@ -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) diff --git a/code/modules/mob/living/bot/medbot.dm b/code/modules/mob/living/bot/medbot.dm index ced48594f1..2866420be4 100644 --- a/code/modules/mob/living/bot/medbot.dm +++ b/code/modules/mob/living/bot/medbot.dm @@ -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) diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index f6a868d11a..a9854f0148 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -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) diff --git a/code/modules/mob/living/carbon/alien/progression.dm b/code/modules/mob/living/carbon/alien/progression.dm index 1c4c37b083..0dd4ba7e13 100644 --- a/code/modules/mob/living/carbon/alien/progression.dm +++ b/code/modules/mob/living/carbon/alien/progression.dm @@ -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])") diff --git a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm index 6967b1b5c7..8f0a9e4306 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm @@ -215,7 +215,7 @@ to_chat(src,"You can't process [substance]!") 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 diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index 5bbab6d160..a8b457aa10 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -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") diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index f1d2b353cf..7287eefa02 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -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 diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index 9636f2da51..1249a2da57 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -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 diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm index ea41d429f8..c29ce4d137 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm @@ -257,7 +257,7 @@ var/list/_cat_default_emotes = list( if(named) to_chat(user, "\The [name] already has a name!") 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, "The name can be at most 50 characters long.") else diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/vore.dm b/code/modules/mob/living/simple_mob/subtypes/vore/vore.dm index b15a7e0e18..4dc8c04caa 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/vore.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/vore.dm @@ -19,7 +19,7 @@ to_chat(src, "You've already set your name. Ask an admin to toggle \"nameset\" to 0 if you really must.") 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 diff --git a/code/modules/mob/living/voice/voice.dm b/code/modules/mob/living/voice/voice.dm index 9caa58cb33..0e9e805dc9 100644 --- a/code/modules/mob/living/voice/voice.dm +++ b/code/modules/mob/living/voice/voice.dm @@ -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("[bicon(comm)] [src.name] has left, and now you see [new_name].") diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 67466f350d..9fbd520134 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -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 diff --git a/code/modules/modular_computers/file_system/programs/generic/file_browser.dm b/code/modules/modular_computers/file_system/programs/generic/file_browser.dm index e37e994f43..17fd005f9a 100644 --- a/code/modules/modular_computers/file_system/programs/generic/file_browser.dm +++ b/code/modules/modular_computers/file_system/programs/generic/file_browser.dm @@ -63,7 +63,7 @@ var/oldtext = html_decode(F.stored_data) oldtext = replacetext(oldtext, "\[br\]", "\n") - var/newtext = sanitize(replacetext(input(usr, "Editing file [open_file]. You may use most tags used in paper formatting:", "Text Editor", oldtext) as message|null, "\n", "\[br\]"), MAX_TEXTFILE_LENGTH) + var/newtext = sanitize(replacetext(tgui_input_text(usr, "Editing file [open_file]. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH) if(!newtext) return diff --git a/code/modules/modular_computers/file_system/programs/generic/wordprocessor.dm b/code/modules/modular_computers/file_system/programs/generic/wordprocessor.dm index 44c5a821ae..1acc0e7157 100644 --- a/code/modules/modular_computers/file_system/programs/generic/wordprocessor.dm +++ b/code/modules/modular_computers/file_system/programs/generic/wordprocessor.dm @@ -166,7 +166,7 @@ var/oldtext = html_decode(loaded_data) oldtext = replacetext(oldtext, "\[br\]", "\n") - var/newtext = sanitize(replacetext(input(usr, "Editing file '[open_file]'. You may use most tags used in paper formatting:", "Text Editor", oldtext) as message|null, "\n", "\[br\]"), MAX_TEXTFILE_LENGTH) + var/newtext = sanitize(replacetext(tgui_input_text(usr, "Editing file '[open_file]'. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH) if(!newtext) return loaded_data = newtext diff --git a/code/modules/modular_computers/file_system/programs/research/email_administration.dm b/code/modules/modular_computers/file_system/programs/research/email_administration.dm index 0ad80422cb..8b5eddc699 100644 --- a/code/modules/modular_computers/file_system/programs/research/email_administration.dm +++ b/code/modules/modular_computers/file_system/programs/research/email_administration.dm @@ -92,7 +92,7 @@ if(!current_account) return TRUE - var/newpass = sanitize(input(usr,"Enter new password for account [current_account.login]", "Password"), 100) + var/newpass = sanitize(tgui_input_text(usr,"Enter new password for account [current_account.login]", "Password", null, 100), 100) if(!newpass) return TRUE current_account.password = newpass @@ -120,7 +120,7 @@ var/newdomain = sanitize(tgui_input_list(usr,"Pick domain:", "Domain name", using_map.usable_email_tlds)) if(!newdomain) return TRUE - var/newlogin = sanitize(input(usr,"Pick account name (@[newdomain]):", "Account name"), 100) + var/newlogin = sanitize(tgui_input_text(usr,"Pick account name (@[newdomain]):", "Account name", null, 100), 100) if(!newlogin) return TRUE diff --git a/code/modules/multiz/ladder_assembly_vr.dm b/code/modules/multiz/ladder_assembly_vr.dm index 3512a3b07f..b6e5bddf7e 100644 --- a/code/modules/multiz/ladder_assembly_vr.dm +++ b/code/modules/multiz/ladder_assembly_vr.dm @@ -16,7 +16,7 @@ /obj/structure/ladder_assembly/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/weapon/pen)) - var/t = sanitizeSafe(input(user, "Enter the name for the ladder.", "Ladder Name", src.created_name), MAX_NAME_LEN) + var/t = sanitizeSafe(tgui_input_text(user, "Enter the name for the ladder.", "Ladder Name", src.created_name, MAX_NAME_LEN), MAX_NAME_LEN) if(in_range(src, user)) created_name = t return diff --git a/code/modules/nifsoft/nif.dm b/code/modules/nifsoft/nif.dm index 60025acca8..8735fb18f4 100644 --- a/code/modules/nifsoft/nif.dm +++ b/code/modules/nifsoft/nif.dm @@ -666,7 +666,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable to_chat(src,"You don't have a NIF, not sure why this was here.") return - var/new_flavor = sanitize(input(src,"Describe how your NIF alters your appearance, like glowy eyes or metal plate on your head, etc. Be sensible. Clear this for no examine text. 128ch max.","Describe NIF", nif.examine_msg) as null|text, max_length = 128) + var/new_flavor = sanitize(tgui_input_text(src,"Describe how your NIF alters your appearance, like glowy eyes or metal plate on your head, etc. Be sensible. Clear this for no examine text. 128ch max.","Describe NIF", nif.examine_msg, 128), max_length = 128) //They clicked cancel or meanwhile lost their NIF if(!nif || isnull(new_flavor)) return //No changes diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index a2da8ecdea..21b1c20aec 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -125,10 +125,10 @@ switch(choice) if("Design Inside") - var/new_flavor = input(nif.human, "Type what the prey sees after being 'caught'. This will be \ + var/new_flavor = tgui_input_text(nif.human, "Type what the prey sees after being 'caught'. This will be \ printed after an intro ending with: \"Around you, you see...\" to the prey. If you already \ have prey, this will be printed to them after \"Your surroundings change to...\". Limit 2048 char.", \ - "VR Environment", html_decode(inside_flavor)) as message + "VR Environment", html_decode(inside_flavor), MAX_MESSAGE_LEN*2, TRUE) new_flavor = sanitize(new_flavor, MAX_MESSAGE_LEN*2) inside_flavor = new_flavor nif.notify("Updating VR environment...") diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index 2275ef1bd4..4e42427456 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -69,7 +69,7 @@ to_chat(user, "You put the [W] into \the [src].") update_icon() else if(istype(W, /obj/item/weapon/pen)) - var/n_name = sanitizeSafe(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text, MAX_NAME_LEN) + var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the folder?", "Folder Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN) if((loc == usr && usr.stat == 0)) name = "folder[(n_name ? text("- '[n_name]'") : null)]" return diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm index 1b2624c125..5666b97d5e 100644 --- a/code/modules/paperwork/handlabeler.dm +++ b/code/modules/paperwork/handlabeler.dm @@ -73,7 +73,7 @@ if(mode) to_chat(user, SPAN_NOTICE("You turn on \the [src].")) //Now let them chose the text. - var/str = sanitizeSafe(input(user,"Label text?","Set label",""), MAX_NAME_LEN) + var/str = sanitizeSafe(tgui_input_text(user,"Label text?","Set label","",MAX_NAME_LEN), MAX_NAME_LEN) if(!str || !length(str)) to_chat(user, SPAN_WARNING("Invalid text.")) return diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 0f2d8d8481..e25e5f88a3 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -180,7 +180,7 @@ if((CLUMSY in usr.mutations) && prob(50)) to_chat(usr, "You cut yourself on the paper.") return - var/n_name = sanitizeSafe(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text, MAX_NAME_LEN) + var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the paper?", "Paper Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN) // We check loc one level up, so we can rename in clipboards and such. See also: /obj/item/weapon/photo/rename() if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == 0 && n_name) @@ -431,7 +431,7 @@ to_chat(usr, "There isn't enough space left on \the [src] to write anything.") return - var/raw = input(usr, "Enter what you want to write:", "Write") as null|message + var/raw = tgui_input_text(usr, "Enter what you want to write:", "Write", multiline = TRUE) if(!raw) return diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index 24aeae6c71..287927a6d3 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -192,7 +192,7 @@ set category = "Object" set src in usr - var/n_name = sanitizeSafe(input(usr, "What would you like to label the bundle?", "Bundle Labelling", null) as text, MAX_NAME_LEN) + var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the bundle?", "Bundle Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN) if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == 0) name = "[(n_name ? text("[n_name]") : "paper")]" add_fingerprint(usr) diff --git a/code/modules/paperwork/paper_sticky.dm b/code/modules/paperwork/paper_sticky.dm index 04f4249cfb..ba2a9195b3 100644 --- a/code/modules/paperwork/paper_sticky.dm +++ b/code/modules/paperwork/paper_sticky.dm @@ -34,7 +34,7 @@ if(writing_space <= 0) to_chat(user, SPAN_WARNING("There is no room left on \the [src].")) return - var/text = sanitizeSafe(input(usr, "What would you like to write?") as text, writing_space) + var/text = sanitizeSafe(tgui_input_text(usr, "What would you like to write?", null, null, writing_space), writing_space) if(!text || thing.loc != user || (!Adjacent(user) && loc != user) || user.incapacitated()) return user.visible_message("\The [user] jots a note down on \the [src].") diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index cc4d8103e1..4a79eb64a8 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -47,7 +47,7 @@ var/global/photo_count = 0 /obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob) if(istype(P, /obj/item/weapon/pen)) - var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text, 128) + var/txt = sanitize(tgui_input_text(user, "What would you like to write on the back?", "Photo Writing", null, 128), 128) if(loc == user && user.stat == 0) scribble = txt ..() @@ -75,7 +75,7 @@ var/global/photo_count = 0 set category = "Object" set src in usr - var/n_name = sanitizeSafe(input(usr, "What would you like to label the photo?", "Photo Labelling", null) as text, MAX_NAME_LEN) + var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the photo?", "Photo Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN) //loc.loc check is for making possible renaming photos in clipboards if(( (loc == usr || (loc.loc && loc.loc == usr)) && usr.stat == 0)) name = "[(n_name ? text("[n_name]") : "photo")]" diff --git a/code/modules/persistence/graffiti.dm b/code/modules/persistence/graffiti.dm index cbd2fe01a9..e9a031bc8e 100644 --- a/code/modules/persistence/graffiti.dm +++ b/code/modules/persistence/graffiti.dm @@ -55,7 +55,7 @@ to_chat(user, SPAN_WARNING("You are banned from leaving persistent information across rounds.")) return - var/_message = sanitize(input(usr, "Enter an additional message to engrave.", "Graffiti") as null|text, trim = TRUE) + var/_message = sanitize(tgui_input_text(usr, "Enter an additional message to engrave.", "Graffiti"), trim = TRUE) if(_message && loc && user && !user.incapacitated() && user.Adjacent(loc) && thing.loc == user) user.visible_message("\The [user] begins carving something into \the [loc].") if(do_after(user, max(20, length(_message)), src) && loc) diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index 46736474b7..b600bb8ce0 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -37,7 +37,7 @@ return var/tmp_label = "" - var/label_text = sanitizeSafe(input(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label), MAX_NAME_LEN) + var/label_text = sanitizeSafe(tgui_input_text(user, "Inscribe some text into \the [initial(BB.name)]","Inscription",tmp_label,MAX_NAME_LEN), MAX_NAME_LEN) if(length(label_text) > 20) to_chat(user, "The inscription can be at most 20 characters long.") else if(!label_text) diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm index 693330fef7..e5158def75 100644 --- a/code/modules/reagents/reagent_containers/blood_pack.dm +++ b/code/modules/reagents/reagent_containers/blood_pack.dm @@ -56,7 +56,7 @@ /obj/item/weapon/reagent_containers/blood/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) - var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN) + var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN) if(length(tmp_label) > 50) to_chat(user, "The label can be at most 50 characters long.") else if(length(tmp_label) > 10) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index e4e3849ac2..2d450ba8cf 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -122,7 +122,7 @@ /obj/item/weapon/reagent_containers/glass/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) - var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN) + var/tmp_label = sanitizeSafe(tgui_input_text(user, "Enter a label for [name]", "Label", label_text, MAX_NAME_LEN), MAX_NAME_LEN) if(length(tmp_label) > 50) to_chat(user, "The label can be at most 50 characters long.") else if(length(tmp_label) > 10) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 4d77ad473e..94d2232c26 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -42,7 +42,7 @@ else if(istype(W, /obj/item/weapon/pen)) switch(tgui_alert(usr, "What would you like to alter?","Select Alteration",list("Title","Description","Cancel"))) if("Title") - var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN) + var/str = sanitizeSafe(tgui_input_text(usr,"Label text?","Set label","", MAX_NAME_LEN), MAX_NAME_LEN) if(!str || !length(str)) to_chat(user, " Invalid text.") return @@ -153,7 +153,7 @@ else if(istype(W, /obj/item/weapon/pen)) switch(tgui_alert(usr, "What would you like to alter?","Select Alteration",list("Title","Description","Cancel"))) if("Title") - var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN) + var/str = sanitizeSafe(tgui_input_text(usr,"Label text?","Set label","", MAX_NAME_LEN), MAX_NAME_LEN) if(!str || !length(str)) to_chat(user, " Invalid text.") return diff --git a/code/modules/tgui/modules/agentcard.dm b/code/modules/tgui/modules/agentcard.dm index 012438dda6..0bdbd967ce 100644 --- a/code/modules/tgui/modules/agentcard.dm +++ b/code/modules/tgui/modules/agentcard.dm @@ -45,7 +45,7 @@ to_chat(usr, "Electronic warfare [S.electronic_warfare ? "enabled" : "disabled"].") . = TRUE if("age") - var/new_age = input(usr,"What age would you like to put on this card?","Agent Card Age", S.age) as null|num + var/new_age = tgui_input_number(usr,"What age would you like to put on this card?","Agent Card Age", S.age) if(!isnull(new_age) && tgui_status(usr, state) == STATUS_INTERACTIVE) if(new_age < 0) S.age = initial(S.age) @@ -63,7 +63,7 @@ to_chat(usr, "Appearance changed to [choice].") . = TRUE if("assignment") - var/new_job = sanitize(input(usr,"What assignment would you like to put on this card?\nChanging assignment will not grant or remove any access levels.","Agent Card Assignment", S.assignment) as null|text) + var/new_job = sanitize(tgui_input_text(usr,"What assignment would you like to put on this card?\nChanging assignment will not grant or remove any access levels.","Agent Card Assignment", S.assignment)) if(!isnull(new_job) && tgui_status(usr, state) == STATUS_INTERACTIVE) S.assignment = new_job to_chat(usr, "Occupation changed to '[new_job]'.") @@ -97,7 +97,7 @@ var/mob/living/carbon/human/H = usr if(H.dna) default = md5(H.dna.uni_identity) - var/new_fingerprint_hash = sanitize(input(usr,"What fingerprint hash would you like to be written on this card?","Agent Card Fingerprint Hash",default) as null|text) + var/new_fingerprint_hash = sanitize(tgui_input_text(usr,"What fingerprint hash would you like to be written on this card?","Agent Card Fingerprint Hash",default)) if(!isnull(new_fingerprint_hash) && tgui_status(usr, state) == STATUS_INTERACTIVE) S.fingerprint_hash = new_fingerprint_hash to_chat(usr, "Fingerprint hash changed to '[new_fingerprint_hash]'.") diff --git a/code/modules/tgui/modules/appearance_changer.dm b/code/modules/tgui/modules/appearance_changer.dm index 37a7231b97..d6d7e5f386 100644 --- a/code/modules/tgui/modules/appearance_changer.dm +++ b/code/modules/tgui/modules/appearance_changer.dm @@ -93,8 +93,8 @@ if(can_change(APPEARANCE_RACE) && (params["race"] in valid_species)) if(target.change_species(params["race"])) if(params["race"] == "Custom Species") - target.custom_species = sanitize(input(usr, "Input custom species name:", - "Custom Species Name") as null|text, MAX_NAME_LEN) + target.custom_species = sanitize(tgui_input_text(usr, "Input custom species name:", + "Custom Species Name", null, MAX_NAME_LEN), MAX_NAME_LEN) cut_data() generate_data(usr) changed_hook(APPEARANCECHANGER_CHANGED_RACE) @@ -113,7 +113,7 @@ return 1 if("skin_tone") if(can_change_skin_tone()) - var/new_s_tone = input(usr, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Skin Tone", -target.s_tone + 35) as num|null + var/new_s_tone = tgui_input_number(usr, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Skin Tone", -target.s_tone + 35, 220, 1) if(isnum(new_s_tone) && can_still_topic(usr, state)) new_s_tone = 35 - max(min( round(new_s_tone), 220),1) changed_hook(APPEARANCECHANGER_CHANGED_SKINTONE) diff --git a/code/modules/tgui/modules/communications.dm b/code/modules/tgui/modules/communications.dm index 050c366caf..8138f6f75a 100644 --- a/code/modules/tgui/modules/communications.dm +++ b/code/modules/tgui/modules/communications.dm @@ -324,11 +324,11 @@ post_status(src, params["statdisp"], user = usr) if("setmsg1") - stat_msg1 = reject_bad_text(sanitize(input(usr, "Line 1", "Enter Message Text", stat_msg1) as text|null, 40), 40) + stat_msg1 = reject_bad_text(sanitize(tgui_input_text(usr, "Line 1", "Enter Message Text", stat_msg1, 40), 40), 40) setMenuState(usr, COMM_SCREEN_STAT) if("setmsg2") - stat_msg2 = reject_bad_text(sanitize(input(usr, "Line 2", "Enter Message Text", stat_msg2) as text|null, 40), 40) + stat_msg2 = reject_bad_text(sanitize(tgui_input_text(usr, "Line 2", "Enter Message Text", stat_msg2, 40), 40), 40) setMenuState(usr, COMM_SCREEN_STAT) // OMG CENTCOMM LETTERHEAD diff --git a/code/modules/tgui/modules/law_manager.dm b/code/modules/tgui/modules/law_manager.dm index 3a9ca9cf88..847281a554 100644 --- a/code/modules/tgui/modules/law_manager.dm +++ b/code/modules/tgui/modules/law_manager.dm @@ -89,7 +89,7 @@ return TRUE if("change_supplied_law_position") - var/new_position = input(usr, "Enter new supplied law position between 1 and [MAX_SUPPLIED_LAW_NUMBER], inclusive. Inherent laws at the same index as a supplied law will not be stated.", "Law Position", supplied_law_position) as num|null + var/new_position = tgui_input_number(usr, "Enter new supplied law position between 1 and [MAX_SUPPLIED_LAW_NUMBER], inclusive. Inherent laws at the same index as a supplied law will not be stated.", "Law Position", supplied_law_position) if(isnum(new_position) && can_still_topic(usr, state)) supplied_law_position = CLAMP(new_position, 1, MAX_SUPPLIED_LAW_NUMBER) return TRUE @@ -98,7 +98,7 @@ if(is_malf(usr)) var/datum/ai_law/AL = locate(params["edit_law"]) in owner.laws.all_laws() if(AL) - var/new_law = sanitize(input(usr, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law", AL.law)) + var/new_law = sanitize(tgui_input_text(usr, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law", AL.law)) if(new_law && new_law != AL.law && is_malf(usr) && can_still_topic(usr, state)) log_and_message_admins("has changed a law of [owner] from '[AL.law]' to '[new_law]'") AL.law = new_law diff --git a/code/modules/tgui/modules/ntos-only/cardmod.dm b/code/modules/tgui/modules/ntos-only/cardmod.dm index 8a8ace688f..b6e4a8063b 100644 --- a/code/modules/tgui/modules/ntos-only/cardmod.dm +++ b/code/modules/tgui/modules/ntos-only/cardmod.dm @@ -192,7 +192,7 @@ if(computer && program.can_run(usr, 1) && id_card) var/t1 = params["assign_target"] if(t1 == "Custom") - var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment", id_card.assignment), 45) + var/temp_t = sanitize(tgui_input_text(usr, "Enter a custom job assignment.","Assignment", id_card.assignment, 45), 45) //let custom jobs function as an impromptu alt title, mainly for sechuds if(temp_t) id_card.assignment = temp_t diff --git a/code/modules/tgui/modules/ntos-only/email.dm b/code/modules/tgui/modules/ntos-only/email.dm index 746582ae7f..af10b738ef 100644 --- a/code/modules/tgui/modules/ntos-only/email.dm +++ b/code/modules/tgui/modules/ntos-only/email.dm @@ -279,7 +279,7 @@ var/oldtext = html_decode(msg_body) oldtext = replacetext(oldtext, "\[editorbr\]", "\n") - var/newtext = sanitize(replacetext(input(usr, "Enter your message. You may use most tags from paper formatting", "Message Editor", oldtext) as message|null, "\n", "\[editorbr\]"), 20000) + var/newtext = sanitize(replacetext(tgui_input_text(usr, "Enter your message. You may use most tags from paper formatting", "Message Editor", oldtext, 20000, TRUE), "\n", "\[editorbr\]"), 20000) if(newtext) msg_body = newtext return 1 @@ -362,13 +362,13 @@ return 1 if("changepassword") - var/oldpassword = sanitize(input(user,"Please enter your old password:", "Password Change"), 100) + var/oldpassword = sanitize(tgui_input_text(user,"Please enter your old password:", "Password Change", null, 100), 100) if(!oldpassword) return 1 - var/newpassword1 = sanitize(input(user,"Please enter your new password:", "Password Change"), 100) + var/newpassword1 = sanitize(tgui_input_text(user,"Please enter your new password:", "Password Change", null, 100), 100) if(!newpassword1) return 1 - var/newpassword2 = sanitize(input(user,"Please re-enter your new password:", "Password Change"), 100) + var/newpassword2 = sanitize(tgui_input_text(user,"Please re-enter your new password:", "Password Change", null, 100), 100) if(!newpassword2) return 1 @@ -399,7 +399,7 @@ error = "Error exporting file. Are you using a functional and NTOS-compliant device?" return 1 - var/filename = sanitize(input(user,"Please specify file name:", "Message export"), 100) + var/filename = sanitize(tgui_input_text(user,"Please specify file name:", "Message export", null, 100), 100) if(!filename) return 1 diff --git a/code/modules/xenobio/items/slime_objects.dm b/code/modules/xenobio/items/slime_objects.dm index 72cc0e01e3..90012d7548 100644 --- a/code/modules/xenobio/items/slime_objects.dm +++ b/code/modules/xenobio/items/slime_objects.dm @@ -57,7 +57,7 @@ S.set_species("Promethean") S.shapeshifter_set_colour("#2398FF") visible_message("The monkey cube suddenly takes the shape of a humanoid!") - var/newname = sanitize(input(S, "You are a Promethean. Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN) + var/newname = sanitize(tgui_input_text(S, "You are a Promethean. Would you like to change your name to something else?", "Name change", null, MAX_NAME_LEN), MAX_NAME_LEN) if(newname) S.real_name = newname S.name = S.real_name diff --git a/code/modules/xenobio/items/slimepotions.dm b/code/modules/xenobio/items/slimepotions.dm index 11d2d07571..fa1484e0d9 100644 --- a/code/modules/xenobio/items/slimepotions.dm +++ b/code/modules/xenobio/items/slimepotions.dm @@ -110,7 +110,7 @@ playsound(src, 'sound/effects/bubbles.ogg', 50, 1) AI.remove_target() // So hostile things stop attacking people even if not hostile anymore. - var/newname = copytext(sanitize(input(user, "Would you like to give \the [M] a name?", "Name your new pet", M.name) as null|text),1,MAX_NAME_LEN) + var/newname = copytext(sanitize(tgui_input_text(user, "Would you like to give \the [M] a name?", "Name your new pet", M.name, MAX_NAME_LEN)),1,MAX_NAME_LEN) if(newname) M.name = newname