From 965f8f4a611d695efa05eaef627592b4454b3abf Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sat, 1 Feb 2025 18:22:56 -0700 Subject: [PATCH] [MIRROR] remove old inputs (#10038) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- code/_helpers/text.dm | 2 +- code/_helpers/unsorted.dm | 2 +- code/controllers/verbs.dm | 2 +- code/controllers/vote.dm | 4 +-- code/datums/mind.dm | 2 +- code/game/gamemodes/cult/ritual.dm | 6 ++-- .../gamemodes/technomancer/spells/chroma.dm | 2 +- code/game/jobs/job/civilian_chaplain.dm | 6 ++-- code/game/jobs/job_controller.dm | 32 +++++++++---------- code/game/machinery/CableLayer.dm | 2 +- code/game/machinery/cryo.dm | 2 +- code/game/machinery/event/christmas_ch.dm | 4 +-- code/game/machinery/petrification.dm | 2 +- code/game/machinery/suit_dispenser.dm | 2 +- .../telecomms/machine_interactions.dm | 2 +- code/game/machinery/telecrystal_storage_ch.dm | 12 +++---- .../game/mecha/equipment/tools/cable_layer.dm | 2 +- code/game/objects/effects/alien/alien egg.dm | 2 +- code/game/objects/items/crayons.dm | 26 +++++++++------ .../items/devices/communicator/cartridge.dm | 16 +++++----- .../objects/items/devices/text_to_speech.dm | 4 ++- code/game/objects/items/gunbox_yw.dm | 6 ++-- code/game/objects/structures/artstuff.dm | 6 ++-- code/game/objects/structures/reflectors_ch.dm | 2 +- code/game/objects/structures/window.dm | 2 +- code/modules/admin/admin_verbs_vr.dm | 4 +-- code/modules/admin/callproc/callproc.dm | 2 +- code/modules/admin/verbs/admin_ch.dm | 6 ++-- code/modules/admin/verbs/buildmode.dm | 2 +- code/modules/admin/verbs/change_appearance.dm | 8 ++--- code/modules/admin/verbs/debug_ch.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 6 ++-- code/modules/casino/casino.dm | 8 ++--- .../preference_setup/general/03_body.dm | 2 +- .../client/preference_setup/vore/07_traits.dm | 2 +- .../client/verbs/character_directory.dm | 2 +- code/modules/clothing/accessories/hands.dm | 2 +- code/modules/clothing/accessories/rings.dm | 5 ++- .../clothing/gloves/miscellaneous_vr.dm | 2 +- code/modules/clothing/head/pilot_helmet.dm | 2 +- .../spacesuits/rig/modules/protean.dm | 2 +- .../spacesuits/rig/modules/specific/voice.dm | 2 +- .../spacesuits/rig/modules/utility.dm | 2 +- code/modules/economy/EFTPOS.dm | 9 +++--- code/modules/food/food.dm | 2 +- code/modules/food/food/snacks.dm | 2 +- code/modules/games/dice.dm | 4 +-- code/modules/instruments/songs/editor.dm | 2 +- .../core/special_pins/color_pin.dm | 2 +- .../testing_shenanigans.dm | 10 +++--- code/modules/library/lib_items.dm | 2 +- code/modules/media/mediamanager.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 8 ++--- .../living/carbon/human/human_powers_YW.dm | 2 +- .../human/species/lleill/lleill_abilities.dm | 2 +- .../human/species/shadekin/dark_portal_ch.dm | 8 ++--- .../human/species/species_shapeshift.dm | 10 +++--- .../human/species/species_shapeshift_vr.dm | 18 +++++------ .../human/species/station/prommie_blob.dm | 2 +- .../station/protean_vr/protean_powers.dm | 24 +++++++------- .../station/station_special_abilities_ch.dm | 6 ++-- .../station/station_special_abilities_vr.dm | 2 +- .../mob/living/carbon/metroid/items.dm | 4 +-- code/modules/mob/living/living.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 4 ++- .../robot/drone/drone_manufacturer_unify.dm | 2 +- .../simple_mob/subtypes/animal/animal.dm | 2 +- .../living/simple_mob/subtypes/animal/vox.dm | 4 +-- .../simple_mob/subtypes/vore/bigdragon.dm | 12 +++---- .../simple_mob/subtypes/vore/bigdragon_ch.dm | 16 +++++----- .../subtypes/vore/demon/demon_abilities_ch.dm | 5 ++- .../simple_mob/subtypes/vore/goia_ch.dm | 22 ++++++------- .../programs/generic/ntnrc_client.dm | 2 +- code/modules/organs/internal/eyes.dm | 2 +- code/modules/paperwork/paper.dm | 2 +- code/modules/pda/cart_apps.dm | 4 +-- .../fusion/fuel_assembly/fuel_injector.dm | 4 +-- .../power/fusion/gyrotron/gyrotron_control.dm | 4 +-- code/modules/projectiles/guns/energy/stun.dm | 4 +-- .../projectiles/guns/projectile/pistol.dm | 2 +- .../projectiles/guns/projectile/revolver.dm | 4 +-- .../projectiles/guns/projectile/shotgun.dm | 2 +- code/modules/spells/general/rune_write.dm | 8 ++--- .../tgui/modules/admin/player_notes.dm | 4 +-- code/modules/tgui/modules/rcon.dm | 14 +++++--- code/modules/vore/eating/living_ch.dm | 20 ++++++------ code/modules/vore/eating/living_vr.dm | 2 +- code/modules/vore/eating/simple_animal_vr.dm | 2 +- code/modules/vore/eating/vorepanel_vr.dm | 22 ++++++------- code/modules/vote/vote_verb.dm | 2 +- code/modules/xenoarcheaology/effect_master.dm | 4 +-- maps/tether_better/tether_things.dm | 2 +- maps/yw/cryogaia_things.dm | 2 +- .../modules/admin/functions/modify_traits.dm | 10 +++--- .../mob/living/simple_animal/aliens/synx.dm | 8 ++--- .../simple_mob/subtypes/vore/bigdragon.dm | 2 +- .../simple_mob/subtypes/vore/swoopie.dm | 2 +- .../living/simple_mob/subtypes/vore/vore.dm | 4 +-- .../code/modules/overmap/dynamic_sector.dm | 25 +++++++-------- .../dispenser/chem_synthesizer_ch.dm | 16 +++++----- tools/IconSplitter/IconSplitter.dm | 4 +-- 101 files changed, 302 insertions(+), 282 deletions(-) diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index 1f42289aef..88163e5561 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -27,7 +27,7 @@ * Text sanitization */ // Can be used almost the same way as normal input for text -/proc/clean_input(Message, Title, Default, mob/user=usr) +/proc/clean_input(Message, Title, Default, mob/user) var/txt = input(user, Message, Title, Default) as text | null if(txt) return html_encode(txt) diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index c4818440fb..072d34b96c 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -345,7 +345,7 @@ Turf and target are seperate in case you want to teleport some distance from a t for(var/i=1,i<=3,i++) //we get 3 attempts to pick a suitable name. //newname = tgui_input_text(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname) - newname = input(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname) + newname = tgui_input_text(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname, MAX_NAME_LEN) if((world.time-time_passed)>3000) return //took too long newname = sanitizeName(newname, ,allow_numbers) //returns null if the name doesn't meet some basic requirements. Tidies up a few other things like bad-characters. diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index 165748c64b..dd29ca8bc8 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -97,7 +97,7 @@ options["LEGACY: transfer_controller"] = transfer_controller options["LEGACY: gas_data"] = gas_data - var/pick = input(mob, "Choose a controller to debug/view variables of.", "VV controller:") as null|anything in options // Leaving as input() due to debug tool + var/pick = tgui_input_list(mob, "Choose a controller to debug/view variables of.", "VV controller:", options) if(!pick) return var/datum/D = options[pick] diff --git a/code/controllers/vote.dm b/code/controllers/vote.dm index 720e1d47e1..c7b317c699 100644 --- a/code/controllers/vote.dm +++ b/code/controllers/vote.dm @@ -234,11 +234,11 @@ SUBSYSTEM_DEF(vote) choices.Add(antag.role_text) choices.Add("None") if(VOTE_CUSTOM) - question = sanitizeSafe(input(usr, "What is the vote for?") as text|null) + question = sanitizeSafe(tgui_input_text(usr, "What is the vote for?")) if(!question) return 0 for(var/i = 1 to 10) - var/option = capitalize(sanitize(input(usr, "Please enter an option or hit cancel to finish") as text|null)) + var/option = capitalize(sanitize(tgui_input_text(usr, "Please enter an option or hit cancel to finish")) if(!option || mode || !usr.client) break choices.Add(option) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 10c406d47a..6f693e9c49 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -179,7 +179,7 @@ if(antag) antag.place_mob(src.current) else if (href_list["role_edit"]) - var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in joblist + var/new_role = tgui_input_list(usr, "Select new role", "Assigned role", assigned_role, joblist) if (!new_role) return assigned_role = new_role diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 81b5bba11e..8d6c4c144b 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -447,7 +447,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," if (!istype(user.loc,/turf)) to_chat(user, span_notice("You do not have enough space to write a proper rune.")) var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun") - r = input(user, "Choose a rune to scribe", "Rune Scribing") in runes // Remains input() for extreme blocking + r = tgui_input_list(user, "Choose a rune to scribe", "Rune Scribing", runes, timeout=30 SECONDS) var/obj/effect/rune/R = new /obj/effect/rune if(ishuman(user)) var/mob/living/carbon/human/H = user @@ -460,7 +460,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") var/beacon if(user) - beacon = input(user, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking + beacon = tgui_input_list(user, "Select the last rune", "Rune Scribing", words, timeout=30 SECONDS) R.word1=cultwords["travel"] R.word2=cultwords["self"] R.word3=beacon @@ -470,7 +470,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") var/beacon if(user) - beacon = input(user, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking + beacon = tgui_input_list(user, "Select the last rune", "Rune Scribing", words, timeout=30 SECONDS) R.word1=cultwords["travel"] R.word2=cultwords["other"] R.word3=beacon diff --git a/code/game/gamemodes/technomancer/spells/chroma.dm b/code/game/gamemodes/technomancer/spells/chroma.dm index 9e51ef4e1e..a1d89ed253 100644 --- a/code/game/gamemodes/technomancer/spells/chroma.dm +++ b/code/game/gamemodes/technomancer/spells/chroma.dm @@ -36,7 +36,7 @@ qdel(src) /obj/item/spell/chroma/on_use_cast(mob/user) - var/new_color = input(user, "Choose the color you want your light to be.", "Color selection") as null|color + var/new_color = tgui_color_picker(user, "Choose the color you want your light to be.", "Color selection") if(new_color) color_to_use = new_color set_light(6, 5, l_color = new_color) diff --git a/code/game/jobs/job/civilian_chaplain.dm b/code/game/jobs/job/civilian_chaplain.dm index a980fd2325..d3d0112474 100644 --- a/code/game/jobs/job/civilian_chaplain.dm +++ b/code/game/jobs/job/civilian_chaplain.dm @@ -60,7 +60,7 @@ /datum/job/chaplain/proc/religion_prompts(mob/living/carbon/human/H, obj/item/storage/bible/B, obj/item/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)) if(!new_religion) new_religion = religion_name @@ -101,12 +101,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)) 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)) var/list/all_jobs = get_job_datums() diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 080d5f9431..e9cc8070d9 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -704,7 +704,7 @@ var/global/datum/controller/occupations/job_master pred_names += M.real_name //very cringe if(preds.len) - var/pred_name = input(C, "Choose a Predator.", "Pred Spawnpoint") as null|anything in pred_names + var/pred_name = tgui_input_list(C, "Choose a Predator.", "Pred Spawnpoint", pred_names) if(!pred_name) return var/index = pred_names.Find(pred_name) @@ -718,19 +718,19 @@ var/global/datum/controller/occupations/job_master continue //CHOMPAdd End available_bellies += Y - var/backup = alert(C, "Do you want a mind backup?", "Confirm", "Yes", "No") + var/backup = tgui_alert(C, "Do you want a mind backup?", "Confirm", list("Yes", "No")) if(backup == "Yes") backup = 1 - vore_spawn_gut = input(C, "Choose a Belly.", "Belly Spawnpoint") as null|anything in available_bellies + vore_spawn_gut = tgui_input_list(C, "Choose a Belly.", "Belly Spawnpoint", available_bellies) if(!vore_spawn_gut) return //CHOMPAdd Start if(vore_spawn_gut.vorespawn_absorbed & VS_FLAG_ABSORB_YES) absorb_choice = TRUE if(vore_spawn_gut.vorespawn_absorbed & VS_FLAG_ABSORB_PREY) - if(alert(C, "Do you want to start absorbed into [pred]'s [vore_spawn_gut]?", "Confirm", "Yes", "No") != "Yes") + if(tgui_alert(C, "Do you want to start absorbed into [pred]'s [vore_spawn_gut]?", "Confirm", list("Yes", "No")) != "Yes") absorb_choice = FALSE - else if(alert(C, "[pred]'s [vore_spawn_gut] will start with you absorbed. Continue?", "Confirm", "Yes", "No") != "Yes") + else if(tgui_alert(C, "[pred]'s [vore_spawn_gut] will start with you absorbed. Continue?", "Confirm", list("Yes", "No")) != "Yes") return //CHOMPAdd End to_chat(C, span_boldwarning("[pred] has received your spawn request. Please wait.")) @@ -751,9 +751,9 @@ var/global/datum/controller/occupations/job_master else //CHOMPEdit Start if(absorb_choice) - confirm = alert(pred, "[C.prefs.real_name] is attempting to spawn absorbed as your [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes") + confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn absorbed as your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) else - confirm = alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes") + confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) //CHOMPEdit End if(confirm != "Yes") to_chat(C, span_warning("[pred] has declined your spawn request.")) @@ -799,7 +799,7 @@ var/global/datum/controller/occupations/job_master preys += M prey_names += M.real_name if(preys.len) - var/prey_name = input(C, "Choose a Prey to spawn nom.", "Prey Spawnpoint") as null|anything in prey_names + var/prey_name = tgui_input_list(C, "Choose a Prey to spawn nom.", "Prey Spawnpoint", prey_names) if(!prey_name) return var/index = prey_names.Find(prey_name) @@ -809,7 +809,7 @@ var/global/datum/controller/occupations/job_master var/datum/vore_preferences/P = C.prefs_vr for(var/Y in P.belly_prefs) available_bellies += Y["name"] - vore_spawn_gut = input(C, "Choose your Belly.", "Belly Spawnpoint") as null|anything in available_bellies + vore_spawn_gut = tgui_input_list(C, "Choose your Belly.", "Belly Spawnpoint", available_bellies) if(!vore_spawn_gut) return //CHOMPAdd Start @@ -834,9 +834,9 @@ var/global/datum/controller/occupations/job_master else //CHOMPEdit Start if(absorb_choice) - confirm = alert(prey, "[C.prefs.real_name] is attempting to televore and instantly absorb you with their [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes") + confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore and instantly absorb you with their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) else - confirm = alert(prey, "[C.prefs.real_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", "No", "Yes") + confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) //CHOMPEdit End if(confirm != "Yes") to_chat(C, span_warning("[prey] has declined your spawn request.")) @@ -907,10 +907,10 @@ var/global/datum/controller/occupations/job_master else item_names += "[I.name] (\a [initial(I.name)] at [I.loc.name])" if(LAZYLEN(items)) - var/backup = alert(C, "Do you want a mind backup?", "Confirm", "Yes", "No") + var/backup = tgui_alert(C, "Do you want a mind backup?", "Confirm", list("Yes", "No")) if(backup == "Yes") backup = 1 - var/item_name = input(C, "Choose an Item to spawn as.", "Item TF Spawnpoint") as null|anything in item_names + var/item_name = tgui_input_list(C, "Choose an Item to spawn as.", "Item TF Spawnpoint", item_names) if(!item_name) return var/index = item_names.Find(item_name) @@ -921,7 +921,7 @@ var/global/datum/controller/occupations/job_master to_chat(C, "[carrier] has received your spawn request. Please wait.") log_and_message_admins("[key_name(C)] has requested to item spawn into [key_name(carrier)]'s possession") - var/confirm = alert(carrier, "[C.prefs.real_name] is attempting to join as the [item_name] in your possession.", "Confirm", "No", "Yes") + var/confirm = tgui_alert(carrier, "[C.prefs.real_name] is attempting to join as the [item_name] in your possession.", "Confirm", list("No", "Yes")) if(confirm != "Yes") to_chat(C, span_warning("[carrier] has declined your spawn request.")) var/message = sanitizeSafe(input(carrier,"Do you want to leave them a message?")as text|null) @@ -942,7 +942,7 @@ var/global/datum/controller/occupations/job_master if(backup) addtimer(CALLBACK(src, PROC_REF(m_backup_client), C), 5 SECONDS) else - var/confirm = alert(C, "\The [item.name] is currently not in any character's possession! Do you still want to spawn as it?", "Confirm", "No", "Yes") + var/confirm = tgui_alert(C, "\The [item.name] is currently not in any character's possession! Do you still want to spawn as it?", "Confirm", list("No", "Yes")) if(confirm != "Yes") return log_and_message_admins("[key_name(C)] has item spawned into \a [item.name] that was not held by anyone") @@ -952,7 +952,7 @@ var/global/datum/controller/occupations/job_master if(istype(item, /obj/item/capture_crystal)) var/obj/item/capture_crystal/cryst = item if(cryst.spawn_mob_type) - var/confirm = alert(C, "Do you want to spawn with your slot's vore organs and prefs?", "Confirm", "No", "Yes") + var/confirm = tgui_alert(C, "Do you want to spawn with your slot's vore organs and prefs?", "Confirm", list("No", "Yes")) if(confirm == "Yes") vorgans = TRUE else diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm index aedbb035f3..0563918e14 100644 --- a/code/game/machinery/CableLayer.dm +++ b/code/game/machinery/CableLayer.dm @@ -36,7 +36,7 @@ if(O.has_tool_quality(TOOL_WIRECUTTER)) if(cable && cable.get_amount()) - var/m = round(input(user, "Please specify the length of cable to cut", "Cut cable", min(cable.get_amount(), 30)) as num, 1) + var/m = tgui_input_number(user, "Please specify the length of cable to cut", "Cut cable", min(cable.get_amount(), 30)) m = min(m, cable.get_amount()) m = min(m, 30) if(m) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 6c656f35e5..c71bf80e7a 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -363,7 +363,7 @@ /datum/data/function/proc/reset() return -/datum/data/function/proc/r_input(href, href_list, mob/user as mob) +/datum/data/function/proc/r_input(href, href_list, mob/user) return /datum/data/function/proc/display() diff --git a/code/game/machinery/event/christmas_ch.dm b/code/game/machinery/event/christmas_ch.dm index ba57a417d2..184706c4f2 100644 --- a/code/game/machinery/event/christmas_ch.dm +++ b/code/game/machinery/event/christmas_ch.dm @@ -46,7 +46,7 @@ to_chat(usr, span_warning("Only Santa can bind and unbind his sack!")) return -/obj/structure/event/santa_sack/attack_hand(mob/user as mob) +/obj/structure/event/santa_sack/attack_hand(mob/user) . = ..() if(usr.ckey != santa_ckey) to_chat(usr, span_warning("Only Santa can give presents! (Be nice or you might end up in Santa's sack!)")) @@ -56,7 +56,7 @@ for(var/mob/living/R in oview(user.loc,1)) receivers += R - var/mob/living/T = input("Choose who to give a present to.") as null| mob in view(user.loc,1) + var/mob/living/T = tgui_input_list(user, "Choose who to give a present to.", "Give Present", mobs_in_view(1, user)) if(!T || !T.ckey) return diff --git a/code/game/machinery/petrification.dm b/code/game/machinery/petrification.dm index e7d8a9d51e..402a2e9cc3 100644 --- a/code/game/machinery/petrification.dm +++ b/code/game/machinery/petrification.dm @@ -202,7 +202,7 @@ if (!length(targets)) popup_msg(user, "No targets within range. Make sure there is a humanoid being within a 3x3 metre square in front of the interface.") return - var/selected = input(user, "Choose the target.", "Petrification Target") as null|anything in targets + var/selected = tgui_input_list(user, "Choose the target.", "Petrification Target", targets) if (selected && ishuman(targets[selected]) && is_valid_target(targets[selected])) var/confirmation = tgui_alert(targets[selected], "You have been selected as a petrification target. If you press confirm, you will possibly be turned into a statue, and if the option is selected, possibly one that cannot be reverted back from a statue at all.","Petrification Target",list("Confirm", "Cancel")) if (confirmation != "Confirm") diff --git a/code/game/machinery/suit_dispenser.dm b/code/game/machinery/suit_dispenser.dm index 174baf10f6..30cd935bd4 100644 --- a/code/game/machinery/suit_dispenser.dm +++ b/code/game/machinery/suit_dispenser.dm @@ -186,7 +186,7 @@ var/list/dispenser_presets = list() dispenser_flags &= ~GD_BUSY return - var/choice = input("Select equipment to dispense.", "Equipment Dispenser") as null|anything in gear_list + var/choice = tgui_input_list(user, "Select equipment to dispense.", "Equipment Dispenser", gear_list) if(!choice) dispenser_flags &= ~GD_BUSY diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 2a1a1e2f3c..d5e4c03b49 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -217,7 +217,7 @@ switch(action) if("change_freq") . = TRUE - var/newfreq = input(ui.user, "Specify a new frequency for new signals to change to. Enter null to turn off frequency changing. Decimals assigned automatically.", src, network) as null|num + var/newfreq = tgui_input_number(ui.user, "Specify a new frequency for new signals to change to. Enter null to turn off frequency changing. Decimals assigned automatically.", src, network, round_value=FALSE) if(canAccess(ui.user)) if(newfreq) if(findtext(num2text(newfreq), ".")) diff --git a/code/game/machinery/telecrystal_storage_ch.dm b/code/game/machinery/telecrystal_storage_ch.dm index 4e071ae065..32d2935e02 100644 --- a/code/game/machinery/telecrystal_storage_ch.dm +++ b/code/game/machinery/telecrystal_storage_ch.dm @@ -34,10 +34,10 @@ item_records.Add(item) qdel(O) -/obj/machinery/smartfridge/tcrystal/tgui_act(action, params) +/obj/machinery/smartfridge/tcrystal/tgui_act(action, params, datum/tgui/ui) if(..()) return TRUE - + add_fingerprint(usr) switch(action) if("Release") @@ -45,11 +45,11 @@ if(params["amount"]) amount = params["amount"] else - amount = input("How many items?", "How many items would you like to take out?", 1) as num|null - + amount = tgui_input_number(ui.user, "How many items?", "How many items would you like to take out?", 1) + if(QDELETED(src) || QDELETED(usr) || !usr.Adjacent(src)) return FALSE - + var/index = text2num(params["index"]) var/datum/stored_item/I = item_records[index] var/count = I.get_amount() @@ -138,4 +138,4 @@ /obj/tcspawner/stack240 desc = "This item spawns stack of 240 telecrystals" - amount_to_spawn = 240 \ No newline at end of file + amount_to_spawn = 240 diff --git a/code/game/mecha/equipment/tools/cable_layer.dm b/code/game/mecha/equipment/tools/cable_layer.dm index 7439792c23..54516bb5ef 100644 --- a/code/game/mecha/equipment/tools/cable_layer.dm +++ b/code/game/mecha/equipment/tools/cable_layer.dm @@ -38,7 +38,7 @@ return if(href_list["cut"]) if(cable && cable.get_amount()) - var/m = round(input(chassis.occupant, "Please specify the length of cable to cut", "Cut cable", min(cable.get_amount(), 30)) as num, 1) + var/m = tgui_input_number(chassis.occupant, "Please specify the length of cable to cut", "Cut cable", min(cable.get_amount(), 30)) m = min(m, cable.get_amount()) if(m) use_cable(m) diff --git a/code/game/objects/effects/alien/alien egg.dm b/code/game/objects/effects/alien/alien egg.dm index 4a61dfe4d8..9f6c0690d2 100644 --- a/code/game/objects/effects/alien/alien egg.dm +++ b/code/game/objects/effects/alien/alien egg.dm @@ -59,7 +59,7 @@ to_chat(user, span_danger("You are banned from playing a Genaprawn.")) //CHOMPedit return - var/confirm = alert(user, "Are you sure you want to join as a Genaprawn larva?", "Become Larva", "No", "Yes") //CHOMPedit + var/confirm = tgui_alert(user, "Are you sure you want to join as a Genaprawn larva?", "Become Larva", list("No", "Yes")) //CHOMPedit if(!src || confirm != "Yes") return diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 6741fa8eb7..1bcbe5f030 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -60,12 +60,16 @@ colourName = "rainbow" uses = 0 -/obj/item/pen/crayon/rainbow/attack_self(mob/living/user as mob) - colour = input(user, "Please select the main colour.", "Crayon colour") as color - shadeColour = input(user, "Please select the shade colour.", "Crayon colour") as color +/obj/item/pen/crayon/rainbow/attack_self(mob/living/user) + var/new_colour = tgui_color_picker(user, "Please select the main colour.", "Crayon colour", colour) + if(new_colour) + colour = new_colour + new_colour = tgui_color_picker(user, "Please select the shade colour.", "Crayon shade colour", shadeColour) + if(new_colour) + shadeColour = new_colour return -/obj/item/pen/crayon/afterattack(atom/target, mob/user as mob, proximity, click_parameters) // CHOMPEdit - Click parameters +/obj/item/pen/crayon/afterattack(atom/target, mob/user, proximity, click_parameters) // CHOMPEdit - Click parameters if(!proximity) return if(istype(target,/turf/simulated/floor)) var/drawtype = tgui_input_list(user, "Choose what you'd like to draw.", "Crayon scribbles", list("graffiti","rune","letter","arrow")) @@ -186,7 +190,7 @@ colourName = "mime" uses = 0 -/obj/item/pen/crayon/marker/mime/attack_self(mob/living/user as mob) //inversion +/obj/item/pen/crayon/marker/mime/attack_self(mob/living/user) //inversion if(colour != "#FFFFFF" && shadeColour != "#000000") colour = "#FFFFFF" shadeColour = "#000000" @@ -204,12 +208,16 @@ colourName = "rainbow" uses = 0 -/obj/item/pen/crayon/marker/rainbow/attack_self(mob/living/user as mob) - colour = input(user, "Please select the main colour.", "Marker colour") as color - shadeColour = input(user, "Please select the shade colour.", "Marker colour") as color +/obj/item/pen/crayon/marker/rainbow/attack_self(mob/living/user) + var/new_colour = tgui_color_picker(user, "Please select the main colour.", "Marker colour", colour) + if(new_colour) + colour = new_colour + new_colour = tgui_color_picker(user, "Please select the shade colour.", "Marker colour", shadeColour) + if(new_colour) + shadeColour = new_colour return -/obj/item/pen/crayon/marker/attack(mob/living/M as mob, mob/living/user as mob) +/obj/item/pen/crayon/marker/attack(mob/living/M, mob/living/user) if(M == user) to_chat(user, "You take a bite of the marker and swallow it.") user.nutrition += 1 diff --git a/code/game/objects/items/devices/communicator/cartridge.dm b/code/game/objects/items/devices/communicator/cartridge.dm index f2f426dcd5..4ea2b30836 100644 --- a/code/game/objects/items/devices/communicator/cartridge.dm +++ b/code/game/objects/items/devices/communicator/cartridge.dm @@ -57,7 +57,7 @@ if(!istype(user)) // Ref no longer valid return - var/newVal = input(user, "Input a new [href_list["signaler_value"]].", href_list["signaler_value"], (href_list["signaler_value"] == "Code" ? S.code : S.frequency)) as num|null + var/newVal = tgui_input_number(user, "Input a new [href_list["signaler_value"]].", href_list["signaler_value"], (href_list["signaler_value"] == "Code" ? S.code : S.frequency), round_value=FALSE) if(newVal) switch(href_list["signaler_value"]) if("Code") @@ -99,7 +99,7 @@ if(!istype(user)) // Ref no longer valid return - var/newTag = input(user, "Please enter desired tag.", G.tag) as text|null + var/newTag = tgui_input_text(user, "Please enter desired tag.", "Name Tag", G.tag) if(newTag) G.tag = newTag @@ -133,7 +133,7 @@ return var/timeout = world.time + 600 - var/reason = sanitize(input(user, "Reason:","Why do you require this item?","") as null|text) + var/reason = sanitize(tgui_input_text(user, "Reason:","Why do you require this item?","")) if(world.time > timeout) to_chat(user, span_warning("Error. Request timed out.")) return @@ -155,7 +155,7 @@ return if(href_list["edit"]) - var/new_val = sanitize(input(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]) as null|text) + var/new_val = sanitize(tgui_input_text(user, href_list["edit"], "Enter the new value for this field:", href_list["default"])) if(!new_val) return @@ -219,9 +219,9 @@ var/list/L = E.contents[href_list["index"]] if(href_list["edit"]) - var/field = alert(user, "Select which field to edit", , "Name", "Quantity", "Value") + var/field = tgui_alert(user, "Select which field to edit", "Field?", list("Name", "Quantity", "Value")) - var/new_val = sanitize(input(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]) as null|text) + var/new_val = sanitize(tgui_input_text(user, href_list["edit"], "Enter the new value for this field:", href_list["default"])) if(!new_val) return @@ -244,7 +244,7 @@ // Else clause means they're editing/deleting the whole export report, rather than a specific item in it else if(href_list["edit"]) - var/new_val = sanitize(input(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]) as null|text) + var/new_val = sanitize(tgui_input_text(user, href_list["edit"], "Enter the new value for this field:", href_list["default"])) if(!new_val) return @@ -291,7 +291,7 @@ post_status("alert", href_list["alert"]) internal_data["stat_display_special"] = href_list["alert"] if("setmsg") - internal_data["stat_display_line[href_list["line"]]"] = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", internal_data["stat_display_line[href_list["line"]]"]) as text|null, 40), 40) + internal_data["stat_display_line[href_list["line"]]"] = reject_bad_text(sanitize(tgui_input_text(usr, "Line 1", "Enter Message Text", internal_data["stat_display_line[href_list["line"]]"], 40), 40), 40) else post_status(href_list["stat_display"]) internal_data["stat_display_special"] = href_list["stat_display"] diff --git a/code/game/objects/items/devices/text_to_speech.dm b/code/game/objects/items/devices/text_to_speech.dm index 572ee939a7..38fa0aefb4 100644 --- a/code/game/objects/items/devices/text_to_speech.dm +++ b/code/game/objects/items/devices/text_to_speech.dm @@ -17,7 +17,9 @@ desc = "[initial(desc)] This one is assigned to [user.real_name]." named = 1 /* //Another way of naming the device. Gives more freedom, but could lead to issues. - device_name = copytext(sanitize(input(user, "What would you like to name your device? You must input a name before the device can be used.", "Name your device", "") as null|text),1,MAX_NAME_LEN) + device_name = sanitize(tgui_input_text(user, "What would you like to name your device? You must input a name before the device can be used.", "Name your device", "", MAX_NAME_LEN)) + if(!device_name) + return name = "[initial(name)] - [device_name]" named = 1 */ diff --git a/code/game/objects/items/gunbox_yw.dm b/code/game/objects/items/gunbox_yw.dm index c3c0c0bff0..18f4b2159a 100644 --- a/code/game/objects/items/gunbox_yw.dm +++ b/code/game/objects/items/gunbox_yw.dm @@ -9,7 +9,7 @@ options["Jackhammer Revolver Shotgun (12 Gauge)"] = list(/obj/item/gun/projectile/revolvershotgun, /obj/item/ammo_magazine/m12gdrumjack, /obj/item/ammo_magazine/m12gdrumjack, /obj/item/ammo_magazine/m12gdrumjack/beanbag) options["WT550 Machine Pistol (9mm)"] = list(/obj/item/gun/projectile/automatic/wt550, /obj/item/ammo_magazine/m9mmt/rubber, /obj/item/ammo_magazine/m9mmt, /obj/item/ammo_magazine/m9mmt) options["X01 Energy Gun (Weapon Cell)"] = list(/obj/item/gun/energy/x01, /obj/item/cell/device/weapon, /obj/item/cell/device/weapon) - var/choice = input(user,"Would you prefer a Jackhammer shotgun, a WT550 Machine Pistol, or an X01 Energy Gun?") as null|anything in options + var/choice = tgui_input_list(user,"Would you prefer a Jackhammer shotgun, a WT550 Machine Pistol, or an X01 Energy Gun?", "Choose Weapon", options) if(src && choice) var/list/things_to_spawn = options[choice] for(var/new_type in things_to_spawn) // Spawn all the things, the gun and the ammo. @@ -29,11 +29,11 @@ options["NSCW Variable Pistol(Microbattery)"] = list(/obj/item/storage/secure/briefcase/nsfw_pack_hos) options["E-Gun (Weapon Cell)"] = list(/obj/item/gun/energy/gun, /obj/item/cell/device/weapon, /obj/item/cell/device/weapon) options["Consul Revolver (.44)"] = list(/obj/item/gun/projectile/revolver/consul, /obj/item/ammo_magazine/s44, /obj/item/ammo_magazine/s44, /obj/item/ammo_magazine/s44/rubber) - var/choice = input(user,"Would you prefer an NSCW, e-gun or a revolver?") as null|anything in options + var/choice = tgui_input_list(user,"Would you prefer an NSCW, e-gun or a revolver?", "Choose Weapon", options) if(src && choice) var/list/things_to_spawn = options[choice] for(var/new_type in things_to_spawn) // Spawn all the things, the gun and the ammo. var/atom/movable/AM = new new_type(get_turf(src)) if(istype(AM, /obj/item/gun)) to_chat(user, "You have chosen \the [AM].") - qdel(src) \ No newline at end of file + qdel(src) diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index dfaec9e263..acba21ad56 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -105,7 +105,7 @@ var/choice = tgui_alert(user, "Adjusting the base color of this canvas will replace ALL pixels with the selected color. Are you sure?", "Confirm Color Fill", list("Yes", "No")) if(choice != "Yes") return - var/basecolor = input(user, "Select a base color for the canvas:", "Base Color", canvas_color) as null|color + var/basecolor = tgui_color_picker(user, "Select a base color for the canvas:", "Base Color", canvas_color) if(basecolor && Adjacent(user) && user.get_active_hand() == I) canvas_color = basecolor reset_grid() @@ -215,7 +215,7 @@ return canvas_color /obj/item/canvas/proc/try_rename(mob/user) - var/new_name = stripped_input(user,"What do you want to name the painting?", max_length = 250) + var/new_name = tgui_input_text(user,"What do you want to name the painting?", max_length = 250, encode=TRUE) if(new_name != painting_name && new_name && CanUseTopic(user, GLOB.tgui_physical_state)) painting_name = new_name SStgui.update_uis(src) @@ -306,7 +306,7 @@ /obj/item/paint_palette/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/paint_brush)) var/obj/item/paint_brush/P = W - var/newcolor = input(user, "Select a new paint color:", "Paint Palette", P.selected_color) as null|color + var/newcolor = tgui_color_picker(user, "Select a new paint color:", "Paint Palette", P.selected_color) if(newcolor && Adjacent(user, P) && Adjacent(user, src)) P.update_paint(newcolor) else diff --git a/code/game/objects/structures/reflectors_ch.dm b/code/game/objects/structures/reflectors_ch.dm index 57205d2f43..dea7c58263 100644 --- a/code/game/objects/structures/reflectors_ch.dm +++ b/code/game/objects/structures/reflectors_ch.dm @@ -170,7 +170,7 @@ if (!can_rotate || admin) to_chat(user, span_warning("The rotation is locked!")) return FALSE - var/new_angle = input(user, "Input a new angle for primary reflection face.", "Reflector Angle", rotation_angle) as null|num + var/new_angle = tgui_input_number(user, "Input a new angle for primary reflection face.", "Reflector Angle", rotation_angle, 360, -360) if(!CanUseTopic(user)) return if(!isnull(new_angle)) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index c506284db3..c821cb3072 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -620,7 +620,7 @@ // Otherwise fall back to asking them... and remind them what the current ID is. if(id) to_chat(user, "The window's current ID is [id].") - var/t = sanitizeSafe(input(user, "Enter the new ID for the window.", src.name, null), MAX_NAME_LEN) + var/t = sanitizeSafe(tgui_input_text(user, "Enter the new ID for the window.", src.name, id), MAX_NAME_LEN) if(t && in_range(src, user)) src.id = t to_chat(user, span_notice("The new ID of \the [src] is '[id]'.")) diff --git a/code/modules/admin/admin_verbs_vr.dm b/code/modules/admin/admin_verbs_vr.dm index c3d3b6d71d..3ebb0787f2 100644 --- a/code/modules/admin/admin_verbs_vr.dm +++ b/code/modules/admin/admin_verbs_vr.dm @@ -26,10 +26,10 @@ if(isobj(T)) possible_things |= T if(!center) - center = input(usr, "What should act as the center of the orbit?", "Center") as anything in possible_things + center = tgui_input_list(src, "What should act as the center of the orbit?", "Center", possible_things) possible_things -= center if(!orbiter) - orbiter = input(usr, "What should act as the orbiter of the orbit?", "Orbiter") as anything in possible_things + orbiter = tgui_input_list(src, "What should act as the orbiter of the orbit?", "Orbiter", possible_things) if(!center || !orbiter) to_chat(usr, span_warning("A center of orbit and an orbiter must be configured. You can also do this by marking a target.")) return diff --git a/code/modules/admin/callproc/callproc.dm b/code/modules/admin/callproc/callproc.dm index f1bb2833fb..a7be3c50c5 100644 --- a/code/modules/admin/callproc/callproc.dm +++ b/code/modules/admin/callproc/callproc.dm @@ -171,7 +171,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) //var/list/named_args = list() //Named arguments are removed, due to them making proccalling take too long. while(argnum--) /* //Named arguments are removed, due to them making proccalling take too long. - var/named_arg = input(usr,"Leave blank for positional argument. Positional arguments will be considered as if they were added first.", "Named argument") as text|null + var/named_arg = tgui_input_text(usr,"Leave blank for positional argument. Positional arguments will be considered as if they were added first.", "Named argument") if(isnull(named_arg)) return null //Cancel */ diff --git a/code/modules/admin/verbs/admin_ch.dm b/code/modules/admin/verbs/admin_ch.dm index 2ec58e363d..80f791a60c 100644 --- a/code/modules/admin/verbs/admin_ch.dm +++ b/code/modules/admin/verbs/admin_ch.dm @@ -16,14 +16,14 @@ if(content != null) coords += content if(coords.len>3) - alert("You entered too many coordinates! Only 3 are required.") + tgui_alert(src, "You entered too many coordinates! Only 3 are required.") return if(coords.len<3) - alert("You didn't enter enough coordinates! 3 are required.") + tgui_alert(src, "You didn't enter enough coordinates! 3 are required.") return destination = locate(coords[1],coords[2],coords[3]) if(!destination) - alert("Invalid coordinates!") + tgui_alert(src, "Invalid coordinates!") return if("atom") value = vv_get_value(VV_ATOM_REFERENCE) diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm index c9ef8d27ed..b4447a9ef0 100644 --- a/code/modules/admin/verbs/buildmode.dm +++ b/code/modules/admin/verbs/buildmode.dm @@ -324,7 +324,7 @@ if(input) new_light_intensity = input if("Color") - var/input = input(usr, "New light color.","Light Maker",3) as null|color + var/input = tgui_color_picker(usr, "New light color.","Light Maker",new_light_color) if(input) new_light_color = input if(BUILDMODE_DROP) diff --git a/code/modules/admin/verbs/change_appearance.dm b/code/modules/admin/verbs/change_appearance.dm index 8210e3fb12..29834f079d 100644 --- a/code/modules/admin/verbs/change_appearance.dm +++ b/code/modules/admin/verbs/change_appearance.dm @@ -48,26 +48,26 @@ return if(tgui_alert(usr, "Are you sure you wish to edit this mob's appearance? Skrell, Unathi, Tajaran can result in unintended consequences.","Danger!",list("Yes","No")) != "Yes") return - var/new_facial = input(usr, "Please select facial hair color.", "Character Generation") as color + var/new_facial = tgui_color_picker(usr, "Please select facial hair color.", "Character Generation") if(new_facial) M.r_facial = hex2num(copytext(new_facial, 2, 4)) M.g_facial = hex2num(copytext(new_facial, 4, 6)) M.b_facial = hex2num(copytext(new_facial, 6, 8)) - var/new_hair = input(usr, "Please select hair color.", "Character Generation") as color + var/new_hair = tgui_color_picker(usr, "Please select hair color.", "Character Generation") if(new_facial) M.r_hair = hex2num(copytext(new_hair, 2, 4)) M.g_hair = hex2num(copytext(new_hair, 4, 6)) M.b_hair = hex2num(copytext(new_hair, 6, 8)) - var/new_eyes = input(usr, "Please select eye color.", "Character Generation") as color + var/new_eyes = tgui_color_picker(usr, "Please select eye color.", "Character Generation") if(new_eyes) M.r_eyes = hex2num(copytext(new_eyes, 2, 4)) M.g_eyes = hex2num(copytext(new_eyes, 4, 6)) M.b_eyes = hex2num(copytext(new_eyes, 6, 8)) M.update_eyes() - var/new_skin = input(usr, "Please select body color. This is for Tajaran, Unathi, and Skrell only!", "Character Generation") as color + var/new_skin = tgui_color_picker(usr, "Please select body color. This is for Tajaran, Unathi, and Skrell only!", "Character Generation") if(new_skin) M.r_skin = hex2num(copytext(new_skin, 2, 4)) M.g_skin = hex2num(copytext(new_skin, 4, 6)) diff --git a/code/modules/admin/verbs/debug_ch.dm b/code/modules/admin/verbs/debug_ch.dm index b453a7a397..a00a71d736 100644 --- a/code/modules/admin/verbs/debug_ch.dm +++ b/code/modules/admin/verbs/debug_ch.dm @@ -6,7 +6,7 @@ if(!check_rights(R_ADMIN|R_EVENT|R_DEBUG)) //CHOMPStation Edit TFF 24/4/19: Allow Devs to use Quick-NIF verb. return - var/mob/living/carbon/human/H = input("Pick a mob with a player","Quick Authentic NIF") as null|anything in player_list + var/mob/living/carbon/human/H = tgui_input_list(usr, "Pick a mob with a player","Quick Authentic NIF", player_list) if(!H) return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index ea85ef2437..615c7677fd 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -813,11 +813,11 @@ Traitors and the like can also be revived with the previous role mostly intact. switch(tgui_alert(usr, "Temporary Ban?","Temporary Ban",list("Yes","No"))) if("Yes") - var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num + var/mins = tgui_input_number(usr,"How long (in minutes)?","Ban time",1440) as num if(!mins) return if(mins >= 525600) mins = 525599 - var/reason = input(usr,"Reason?","reason","Griefer") as text + var/reason = tgui_input_text(usr,"Reason?","reason","Griefer") if(!reason) return if(M) @@ -833,7 +833,7 @@ Traitors and the like can also be revived with the previous role mostly intact. else if("No") - var/reason = input(usr,"Reason?","reason","Griefer") as text + var/reason = tgui_input_text(usr,"Reason?","reason","Griefer") if(!reason) return AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0) diff --git a/code/modules/casino/casino.dm b/code/modules/casino/casino.dm index 56b6161be1..edbf68e966 100644 --- a/code/modules/casino/casino.dm +++ b/code/modules/casino/casino.dm @@ -402,7 +402,7 @@ if(user.incapacitated()) return if(ishuman(user) || isrobot(user)) - switch(input(user,"Choose what to do","Wheel Of Fortune") in list("Spin the Wheel! (Not Lottery)", "Set the interval", "Cancel")) + switch(tgui_input_list(user,"Choose what to do","Wheel Of Fortune", list("Spin the Wheel! (Not Lottery)", "Set the interval", "Cancel"))) if("Cancel") return if("Spin the Wheel! (Not Lottery)") @@ -431,7 +431,7 @@ else to_chat(user, span_warning("Proper access, allowed staff controls.")) if(ishuman(user) || isrobot(user)) - switch(input(user,"Choose what to do (Management)","Wheel Of Fortune (Management)") in list("Spin the Lottery Wheel!", "Toggle Lottery Sales", "Toggle Public Spins", "Reset Lottery", "Cancel")) + switch(tgui_input_list(user,"Choose what to do (Management)","Wheel Of Fortune (Management)", list("Spin the Lottery Wheel!", "Toggle Lottery Sales", "Toggle Public Spins", "Reset Lottery", "Cancel"))) if("Cancel") return if("Spin the Lottery Wheel!") @@ -579,7 +579,7 @@ return if(ishuman(user) || isrobot(user)) - switch(input(user,"Choose what to do","SPASM") in list("Show selected Prize", "Select Prize", "Become Prize (Please examine yourself first)", "Cancel")) + switch(tgui_input_list(user,"Choose what to do","SPASM", list("Show selected Prize", "Select Prize", "Become Prize (Please examine yourself first)", "Cancel"))) if("Cancel") return if("Show selected Prize") @@ -692,7 +692,7 @@ else to_chat(user, span_warning("Proper access, allowed staff controls.")) if(ishuman(user) || isrobot(user)) - switch(input(user,"Choose what to do (Management)","SPASM (Management)") in list("Toggle Sentient Prize Sales", "Wipe Selected Prize Entry", "Change Prize Value", "Cancel")) + switch(tgui_input_list(user,"Choose what to do (Management)","SPASM (Management)", list("Toggle Sentient Prize Sales", "Wipe Selected Prize Entry", "Change Prize Value", "Cancel"))) if("Cancel") return diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 16ae29d01a..1a6102076e 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -652,7 +652,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O else if(href_list["grad_style"]) var/list/valid_gradients = GLOB.hair_gradients - var/new_grad_style = input(user, "Choose a color pattern for your hair:", "Character Preference", pref.grad_style) as null|anything in valid_gradients + var/new_grad_style = tgui_input_list(user, "Choose a color pattern for your hair:", "Character Preference", pref.grad_style, valid_gradients) if(new_grad_style && CanUseTopic(user)) pref.grad_style = new_grad_style return TOPIC_REFRESH_UPDATE_PREVIEW diff --git a/code/modules/client/preference_setup/vore/07_traits.dm b/code/modules/client/preference_setup/vore/07_traits.dm index 84f4c5f593..4a4c148855 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -382,7 +382,7 @@ var/global/list/valid_bloodreagents = list("default",REAGENT_ID_IRON,REAGENT_ID_ return TOPIC_REFRESH_UPDATE_PREVIEW else if(href_list["blood_color"]) - var/color_choice = input(user, "Pick a blood color (does not apply to synths)","Blood Color",pref.blood_color) as color + var/color_choice = tgui_color_picker(user, "Pick a blood color (does not apply to synths)","Blood Color",pref.blood_color) if(color_choice) pref.blood_color = sanitize_hexcolor(color_choice, default="#A10808") return TOPIC_REFRESH diff --git a/code/modules/client/verbs/character_directory.dm b/code/modules/client/verbs/character_directory.dm index 479dc5fb19..33c4da3a7a 100644 --- a/code/modules/client/verbs/character_directory.dm +++ b/code/modules/client/verbs/character_directory.dm @@ -325,7 +325,7 @@ GLOBAL_DATUM(character_directory, /datum/character_directory) var/list/names_list = list() for(var/C in vantag_choices_list) names_list[vantag_choices_list[C]] = C - var/list/new_eventtag = input(usr, "Pick your preference for event involvement", "Event Preference Tag", usr?.client?.prefs?.vantag_preference) as null|anything in names_list + var/list/new_eventtag = tgui_input_list(usr, "Pick your preference for event involvement", "Event Preference Tag", usr?.client?.prefs?.vantag_preference, names_list) if(!new_eventtag) return return set_for_mind_or_prefs(user, action, names_list[new_eventtag], can_set_prefs, can_set_mind) diff --git a/code/modules/clothing/accessories/hands.dm b/code/modules/clothing/accessories/hands.dm index 085df20126..29ef92b761 100644 --- a/code/modules/clothing/accessories/hands.dm +++ b/code/modules/clothing/accessories/hands.dm @@ -41,7 +41,7 @@ if(!M.mind) return 0 - var/input = sanitizeSafe(input(M, "Who do you want to dedicate the bracelet to?", ,""), MAX_NAME_LEN) + var/input = sanitizeSafe(tgui_input_text(M, "Who do you want to dedicate the bracelet to?","Friendship Bracelet" ,"", MAX_NAME_LEN), MAX_NAME_LEN) if(src && input && !M.stat && in_range(M,src)) desc = "A beautiful friendship bracelet in all the colors of the rainbow. It's dedicated to [input]." diff --git a/code/modules/clothing/accessories/rings.dm b/code/modules/clothing/accessories/rings.dm index 828402da13..9cdba62cf6 100644 --- a/code/modules/clothing/accessories/rings.dm +++ b/code/modules/clothing/accessories/rings.dm @@ -119,7 +119,10 @@ var/partnername = "" /obj/item/clothing/accessory/ring/wedding/attack_self(mob/user) - partnername = copytext(sanitize(input(user, "Would you like to change the holoengraving on the ring?", "Name your spouse", "Bae") as null|text),1,MAX_NAME_LEN) + var/input = tgui_input_text(user, "Would you like to change the holoengraving on the ring?", "Name your spouse", "Bae", MAX_NAME_LEN) + if(!input) + return + partnername = sanitize(input) name = "[initial(name)] - [partnername]" /obj/item/clothing/accessory/ring/wedding/silver diff --git a/code/modules/clothing/gloves/miscellaneous_vr.dm b/code/modules/clothing/gloves/miscellaneous_vr.dm index 4dee540772..373c8a376d 100644 --- a/code/modules/clothing/gloves/miscellaneous_vr.dm +++ b/code/modules/clothing/gloves/miscellaneous_vr.dm @@ -8,7 +8,7 @@ body_parts_covered = null /obj/item/clothing/gloves/weddingring/attack_self(mob/user) - partnername = copytext(sanitize(input(user, "Would you like to change the holoengraving on the ring?", "Name your betrothed", "Bae") as null|text),1,MAX_NAME_LEN) + partnername = copytext(sanitize(tgui_input_text(user, "Would you like to change the holoengraving on the ring?", "Name your betrothed", "Bae", MAX_NAME_LEN)),1,MAX_NAME_LEN) name = "[initial(name)] - [partnername]" /obj/item/clothing/gloves/weddingring/silver diff --git a/code/modules/clothing/head/pilot_helmet.dm b/code/modules/clothing/head/pilot_helmet.dm index 90b17a89ab..79f20e04a8 100644 --- a/code/modules/clothing/head/pilot_helmet.dm +++ b/code/modules/clothing/head/pilot_helmet.dm @@ -159,7 +159,7 @@ set category = "Object" set src in usr - var/newcolor = input(usr,"Pick a color!","HUD Color") as null|color + var/newcolor = tgui_color_picker(usr,"Pick a color!","HUD Color") if(newcolor) for(var/img in list("top_words","left_bar","right_bar","flyboxes")) var/image/I = images[img] diff --git a/code/modules/clothing/spacesuits/rig/modules/protean.dm b/code/modules/clothing/spacesuits/rig/modules/protean.dm index 85b45e0c46..f6a31c4774 100644 --- a/code/modules/clothing/spacesuits/rig/modules/protean.dm +++ b/code/modules/clothing/spacesuits/rig/modules/protean.dm @@ -73,7 +73,7 @@ These should come standard with the Protean rigsuit, unless you want them to wor var/armor_weight_ratio = 0.01 //This amount of slowdown per 1% of armour. 3 slowdown at the max armour. /obj/item/rig_module/protean/armor/engage() - var/armor_chosen = input(usr, "Which armor to adjust?", "Protean Armor") as null|anything in armor_settings + var/armor_chosen = tgui_input_list(usr, "Which armor to adjust?", "Protean Armor", armor_settings) if(armor_chosen) var/armorvalue = tgui_input_number(usr, "Set armour reduction value (Max of 60%)", "Protean Armor",0,60) if(isnum(armorvalue)) diff --git a/code/modules/clothing/spacesuits/rig/modules/specific/voice.dm b/code/modules/clothing/spacesuits/rig/modules/specific/voice.dm index 5f32f15c41..aeea41514a 100644 --- a/code/modules/clothing/spacesuits/rig/modules/specific/voice.dm +++ b/code/modules/clothing/spacesuits/rig/modules/specific/voice.dm @@ -44,7 +44,7 @@ voice_holder.active = 0 to_chat(usr, span_blue("You disable the speech synthesiser.")) if("Set Name") - var/raw_choice = sanitize(input(usr, "Please enter a new name.") as text|null, MAX_NAME_LEN) + var/raw_choice = sanitize(tgui_input_text(usr, "Please enter a new name.", voice_holder.voice, MAX_NAME_LEN)) if(!raw_choice) return 0 voice_holder.voice = raw_choice diff --git a/code/modules/clothing/spacesuits/rig/modules/utility.dm b/code/modules/clothing/spacesuits/rig/modules/utility.dm index 2bf7344c97..0183ce2e0e 100644 --- a/code/modules/clothing/spacesuits/rig/modules/utility.dm +++ b/code/modules/clothing/spacesuits/rig/modules/utility.dm @@ -336,7 +336,7 @@ voice_holder.active = 0 to_chat(usr, span_blue("You disable the speech synthesiser.")) if("Set Name") - var/raw_choice = sanitize(input(usr, "Please enter a new name.") as text|null, MAX_NAME_LEN) + var/raw_choice = sanitize(tgui_input_text(usr, "Please enter a new name.", max_length=MAX_NAME_LEN)) if(!raw_choice) return 0 voice_holder.voice = raw_choice diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm index 2f32c0182a..4101cd4f17 100644 --- a/code/modules/economy/EFTPOS.dm +++ b/code/modules/economy/EFTPOS.dm @@ -158,9 +158,9 @@ else to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Incorrect code entered.")) if("change_id") - var/attempt_code = text2num(input(usr, "Re-enter the current EFTPOS access code", "Confirm EFTPOS code")) + var/attempt_code = tgui_input_number(usr, "Re-enter the current EFTPOS access code", "Confirm EFTPOS code") if(attempt_code == access_code) - eftpos_name = sanitize(input(usr, "Enter a new terminal ID for this device", "Enter new EFTPOS ID"), MAX_NAME_LEN) + " EFTPOS scanner" + eftpos_name = sanitize(tgui_input_text(usr, "Enter a new terminal ID for this device", "Enter new EFTPOS ID",max_length=MAX_NAME_LEN), MAX_NAME_LEN) + " EFTPOS scanner" print_reference() else to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Incorrect code entered.")) @@ -175,8 +175,9 @@ else to_chat(usr, "[icon2html(src, usr.client)]" + span_warning("Account not found.")) if("trans_purpose") - var/choice = sanitize(input(usr, "Enter reason for EFTPOS transaction", "Transaction purpose")) - if(choice) transaction_purpose = choice + var/choice = sanitize(tgui_input_text(usr, "Enter reason for EFTPOS transaction", "Transaction purpose")) + if(choice) + transaction_purpose = choice if("trans_value") var/try_num = tgui_input_number(usr, "Enter amount for EFTPOS transaction", "Transaction amount") if(try_num < 0) diff --git a/code/modules/food/food.dm b/code/modules/food/food.dm index e040656378..23c7beaa8a 100644 --- a/code/modules/food/food.dm +++ b/code/modules/food/food.dm @@ -26,7 +26,7 @@ if(user.stat == DEAD || !(ishuman(user) || isrobot(user))) to_chat(user, span_warning("You can't cook!")) return - var/n_name = sanitizeSafe(input(user, "What would you like to name \the [src]? Leave blank to reset.", "Food Naming", null) as text, MAX_NAME_LEN) + var/n_name = sanitizeSafe(tgui_input_text(user, "What would you like to name \the [src]? Leave blank to reset.", "Food Naming", initial(name), MAX_NAME_LEN)) if(!n_name) n_name = initial(name) diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index 92f9797f21..2cce884894 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -4269,7 +4269,7 @@ if( src.open ) return - var/t = sanitize(input(user, "Enter what you want to add to the tag:", "Write", null, null) as text, 30) + var/t = sanitize(tgui_input_text(user, "Enter what you want to add to the tag:", "Write", "", 30)) var/obj/item/pizzabox/boxtotagto = src if( boxes.len > 0 ) diff --git a/code/modules/games/dice.dm b/code/modules/games/dice.dm index fddae8306f..017295511c 100644 --- a/code/modules/games/dice.dm +++ b/code/modules/games/dice.dm @@ -22,7 +22,7 @@ else if(tamper_proof) to_chat(user, span_warning("This [name] is proofed against tampering!")) else - var/to_weight = input("What should the [name] be weighted towards? You can't undo this later, only change the number!","Set the desired result") as null|num + var/to_weight = tgui_input_number(user, "What should the [name] be weighted towards? You can't undo this later, only change the number!","Set the desired result", 1, 6, 1) if(isnull(to_weight) || (to_weight < 1) || (to_weight > sides)) //You must input a number higher than 0 and no greater than the number of sides return 0 else @@ -34,7 +34,7 @@ ..() if(cheater) if(!loaded) - var/to_weight = input("What should the [name] be weighted towards?","Set the desired result") as null|num + var/to_weight = tgui_input_number(user, "What should the [name] be weighted towards?","Set the desired result", 1, 6, 1) if(isnull(to_weight) || (to_weight < 1) || (to_weight > sides) ) //You must input a number higher than 0 and no greater than the number of sides return 0 else diff --git a/code/modules/instruments/songs/editor.dm b/code/modules/instruments/songs/editor.dm index 695cd8bfee..7280365573 100644 --- a/code/modules/instruments/songs/editor.dm +++ b/code/modules/instruments/songs/editor.dm @@ -180,7 +180,7 @@ else if(href_list["modifyline"]) var/num = round(text2num(href_list["modifyline"]),1) - var/content = stripped_input(usr, "Enter your line: ", parent.name, lines[num], MUSIC_MAXLINECHARS) + var/content = tgui_input_text(usr, "Enter your line: ", parent.name, lines[num], MUSIC_MAXLINECHARS, encode=TRUE) if(!content || !in_range(parent, usr)) return if(num > lines.len || num < 1) diff --git a/code/modules/integrated_electronics/core/special_pins/color_pin.dm b/code/modules/integrated_electronics/core/special_pins/color_pin.dm index 628999b001..b254bd4b37 100644 --- a/code/modules/integrated_electronics/core/special_pins/color_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/color_pin.dm @@ -3,7 +3,7 @@ name = "color pin" /datum/integrated_io/color/ask_for_pin_data(mob/user) - var/new_data = input(user, "Please select a color.","[src] color writing", data ? data : "#000000") as null|color + var/new_data = tgui_color_picker(user, "Please select a color.","[src] color writing", data ? data : "#000000") if(holder.check_interactivity(user) ) to_chat(user, span_notice("You input a new color into the pin.")) write_data_to_pin(new_data) diff --git a/code/modules/interserver shipping/testing_shenanigans.dm b/code/modules/interserver shipping/testing_shenanigans.dm index 62fbe5b4a5..aa09981455 100644 --- a/code/modules/interserver shipping/testing_shenanigans.dm +++ b/code/modules/interserver shipping/testing_shenanigans.dm @@ -6,7 +6,7 @@ usr << "Not enough people have talked to you!" return - var/choice = input("Choose the origin to review.", "Origin?", null) as anything in shipping_contacts + var/choice = tgui_input_list(usr, "Choose the origin to review.", "Origin?", shipping_contacts) if (!choice || choice == "origin") usr << "No selection sent, or origin selected." return @@ -18,7 +18,7 @@ return choice = null - choice = input("Choose the RID to accept or deny.", "RID?", null) as anything in rids + choice = tgui_input_list(usr, "Choose the RID to accept or deny.", "RID?", rids) if (!choice) usr << "Cancelled." return @@ -29,7 +29,7 @@ usr << "Cannot find the ship! REE!" return - choice = alert("Accept or deny?", "HRRRM?", "Accept", "Deny") == "Accept" ? TRUE : FALSE + choice = tgui_alert(usr, "Accept or deny?", "HRRRM?", list("Accept", "Deny")) == "Accept" ? TRUE : FALSE if (choice) ship.inbound_accepted() @@ -49,7 +49,7 @@ usr << "No requests to be finalized." return - var/choice = input("Choose a RID to finalize and send off!", "RID?", null) as anything in rids + var/choice = tgui_input_list(usr, "Choose a RID to finalize and send off!", "RID?", rids) if (!choice) usr << "Cancelled." return @@ -106,4 +106,4 @@ usr << ":REE: [e]" shipping_contacts["origin"]["[ship.request_id]"] = ship - usr << "Created" \ No newline at end of file + usr << "Created" diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 0914049128..4572cd781b 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -243,7 +243,7 @@ Book Cart End src.name = newtitle src.title = newtitle if("Contents") - var/content = sanitize(input(user, "Write your book's contents (HTML NOT allowed):") as message|null, MAX_BOOK_MESSAGE_LEN) + var/content = sanitize(tgui_input_text(user, "Write your book's contents (HTML NOT allowed):", max_length=MAX_BOOK_MESSAGE_LEN, multiline=TRUE), MAX_BOOK_MESSAGE_LEN) if(!content) to_chat(user, "The content is invalid.") return diff --git a/code/modules/media/mediamanager.dm b/code/modules/media/mediamanager.dm index ac05bad823..791d49434c 100644 --- a/code/modules/media/mediamanager.dm +++ b/code/modules/media/mediamanager.dm @@ -62,7 +62,7 @@ if(QDELETED(src.media) || !istype(src.media)) to_chat(user, span_warning("You have no media datum to change, if you're not in the lobby tell an admin.")) return - var/value = input(user, "Choose your Jukebox volume.", "Jukebox volume", media.volume) + var/value = tgui_input_number(user, "Choose your Jukebox volume.", "Jukebox volume", media.volume, 100, 0) value = round(max(0, min(100, value))) media.update_volume(value) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 4ed313da7a..d60c125dbc 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -884,19 +884,19 @@ remove_verb(src, /mob/living/carbon/human/proc/morph) return - var/new_facial = input(src, "Please select facial hair color.", "Character Generation",rgb(r_facial,g_facial,b_facial)) as color + var/new_facial = tgui_color_picker(src, "Please select facial hair color.", "Character Generation",rgb(r_facial,g_facial,b_facial)) if(new_facial) r_facial = hex2num(copytext(new_facial, 2, 4)) g_facial = hex2num(copytext(new_facial, 4, 6)) b_facial = hex2num(copytext(new_facial, 6, 8)) - var/new_hair = input(src, "Please select hair color.", "Character Generation",rgb(r_hair,g_hair,b_hair)) as color + var/new_hair = tgui_color_picker(src, "Please select hair color.", "Character Generation",rgb(r_hair,g_hair,b_hair)) if(new_facial) r_hair = hex2num(copytext(new_hair, 2, 4)) g_hair = hex2num(copytext(new_hair, 4, 6)) b_hair = hex2num(copytext(new_hair, 6, 8)) - var/new_eyes = input(src, "Please select eye color.", "Character Generation",rgb(r_eyes,g_eyes,b_eyes)) as color + var/new_eyes = tgui_color_picker(src, "Please select eye color.", "Character Generation",rgb(r_eyes,g_eyes,b_eyes)) if(new_eyes) r_eyes = hex2num(copytext(new_eyes, 2, 4)) g_eyes = hex2num(copytext(new_eyes, 4, 6)) @@ -1079,7 +1079,7 @@ set name = "sim" set background = 1 - var/damage = input(src, "Wound damage","Wound damage") as num + var/damage = tgui_input_number(src, "Wound damage","Wound damage") var/germs = 0 var/tdamage = 0 diff --git a/code/modules/mob/living/carbon/human/human_powers_YW.dm b/code/modules/mob/living/carbon/human/human_powers_YW.dm index b15474362f..37bd7a569d 100644 --- a/code/modules/mob/living/carbon/human/human_powers_YW.dm +++ b/code/modules/mob/living/carbon/human/human_powers_YW.dm @@ -3,7 +3,7 @@ set desc = "Talk telepathically to someone over a distance." set category = "Abilities.General" //CHOMPEdit - var/msg = sanitize(input("Message:", "Project mind") as text|null) + var/msg = sanitize(tgui_input_text(src, "Message:", "Project mind")) if(msg) var/mob/living/carbon/human/H = M log_say("(GreyTP to [key_name(M)]) [msg]", src) diff --git a/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm b/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm index c98ab0881c..ef50271b63 100644 --- a/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm +++ b/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm @@ -73,7 +73,7 @@ last_special = world.time + 50 - var/new_skin = input(src, "Please select a new body color.", "Shapeshifter Colour", rgb(r_skin, g_skin, b_skin)) as null|color + var/new_skin = tgui_color_picker(src, "Please select a new body color.", "Shapeshifter Colour", rgb(r_skin, g_skin, b_skin)) if(!new_skin) return lleill_set_colour(new_skin) diff --git a/code/modules/mob/living/carbon/human/species/shadekin/dark_portal_ch.dm b/code/modules/mob/living/carbon/human/species/shadekin/dark_portal_ch.dm index 29bb829957..a144abcd82 100644 --- a/code/modules/mob/living/carbon/human/species/shadekin/dark_portal_ch.dm +++ b/code/modules/mob/living/carbon/human/species/shadekin/dark_portal_ch.dm @@ -102,8 +102,8 @@ GLOBAL_LIST_BOILERPLATE(all_darkportal_hubs, /obj/structure/dark_portal/hub) to_chat(user, span_warning("You can't use this while phase shifted!")) return if(locked != src) - var/confirm = alert(user, "This portal is currently open to [locked_name]. Change the portal destination?", "Change Portal Destination", "Yes", "Cancel") - if(confirm == "Cancel") + var/confirm = tgui_alert(user, "This portal is currently open to [locked_name]. Change the portal destination?", "Change Portal Destination", list("Yes", "Cancel")) + if(!confirm || confirm == "Cancel") return var/list/L = list() for(var/obj/structure/dark_portal/hub/H in GLOB.all_darkportal_hubs) @@ -189,8 +189,8 @@ GLOBAL_LIST_BOILERPLATE(all_darkportal_minions, /obj/structure/dark_portal/minio to_chat(user, span_warning("You can't use this while phase shifted!")) return FALSE if(icon_state == "minion1") - var/confirm = alert(user, "This portal is currently open to [locked_name]. Close this portal to the dark?", "Close Portal", "Yes", "Cancel") - if(confirm == "Cancel") + var/confirm = tgui_alert(user, "This portal is currently open to [locked_name]. Close this portal to the dark?", "Close Portal", list("Yes", "Cancel")) + if(!confirm || confirm == "Cancel") return if(confirm == "Yes") close_portal() diff --git a/code/modules/mob/living/carbon/human/species/species_shapeshift.dm b/code/modules/mob/living/carbon/human/species/species_shapeshift.dm index ae7b7297c8..69ff16c26b 100644 --- a/code/modules/mob/living/carbon/human/species/species_shapeshift.dm +++ b/code/modules/mob/living/carbon/human/species/species_shapeshift.dm @@ -179,7 +179,7 @@ var/list/wrapped_species_by_ref = list() last_special = world.time + 50 - var/new_skin = input(src, "Please select a new body color.", "Shapeshifter Colour", rgb(r_skin, g_skin, b_skin)) as null|color + var/new_skin = tgui_color_picker(src, "Please select a new body color.", "Shapeshifter Colour", rgb(r_skin, g_skin, b_skin)) if(!new_skin) return shapeshifter_set_colour(new_skin) @@ -217,15 +217,15 @@ var/list/wrapped_species_by_ref = list() last_special = world.time + 50 - var/new_hair = input(src, "Please select a new hair color.", "Hair Colour") as color + var/new_hair = tgui_color_picker(src, "Please select a new hair color.", "Hair Colour") if(!new_hair) return shapeshifter_set_hair_color(new_hair) - var/new_grad = input(src, "Please select a new hair gradient color.", "Hair Gradient Colour") as color + var/new_grad = tgui_color_picker(src, "Please select a new hair gradient color.", "Hair Gradient Colour") if(!new_grad) return shapeshifter_set_grad_color(new_grad) - var/new_fhair = input(src, "Please select a new facial hair color.", "Facial Hair Color") as color + var/new_fhair = tgui_color_picker(src, "Please select a new facial hair color.", "Facial Hair Color") if(!new_fhair) return shapeshifter_set_facial_color(new_fhair) @@ -317,7 +317,7 @@ var/list/wrapped_species_by_ref = list() last_special = world.time + 50 var/current_color = rgb(r_eyes,g_eyes,b_eyes) - var/new_eyes = input(src, "Pick a new color for your eyes.","Eye Color", current_color) as null|color + var/new_eyes = tgui_color_picker(src, "Pick a new color for your eyes.","Eye Color", current_color) if(!new_eyes) return diff --git a/code/modules/mob/living/carbon/human/species/species_shapeshift_vr.dm b/code/modules/mob/living/carbon/human/species/species_shapeshift_vr.dm index bd1ece1752..9c55b9769e 100644 --- a/code/modules/mob/living/carbon/human/species/species_shapeshift_vr.dm +++ b/code/modules/mob/living/carbon/human/species/species_shapeshift_vr.dm @@ -28,7 +28,7 @@ //Allow color picks var/current_pri_color = rgb(r_ears,g_ears,b_ears) - var/new_pri_color = input(src, "Pick primary ear color:","Ear Color (Pri)", current_pri_color) as null|color + var/new_pri_color = tgui_color_picker(src, "Pick primary ear color:","Ear Color (Pri)", current_pri_color) if(new_pri_color) var/list/new_color_rgb_list = hex2rgb(new_pri_color) r_ears = new_color_rgb_list[1] @@ -38,7 +38,7 @@ //Indented inside positive primary color choice, don't bother if they clicked cancel var/current_sec_color = rgb(r_ears2,g_ears2,b_ears2) - var/new_sec_color = input(src, "Pick secondary ear color (only applies to some ears):","Ear Color (sec)", current_sec_color) as null|color + var/new_sec_color = tgui_color_picker(src, "Pick secondary ear color (only applies to some ears):","Ear Color (sec)", current_sec_color) if(new_sec_color) new_color_rgb_list = hex2rgb(new_sec_color) r_ears2 = new_color_rgb_list[1] @@ -47,7 +47,7 @@ var/current_ter_color = rgb(r_ears3,g_ears3,b_ears3) - var/new_ter_color = input(src, "Pick tertiary ear color (only applies to some ears):","Ear Color (sec)", current_ter_color) as null|color + var/new_ter_color = tgui_color_picker(src, "Pick tertiary ear color (only applies to some ears):","Ear Color (sec)", current_ter_color) if(new_ter_color) new_color_rgb_list = hex2rgb(new_sec_color) r_ears3 = new_color_rgb_list[1] @@ -114,7 +114,7 @@ //Allow color picks var/current_pri_color = rgb(r_tail,g_tail,b_tail) - var/new_pri_color = input(src, "Pick primary tail color:","Tail Color (Pri)", current_pri_color) as null|color + var/new_pri_color = tgui_color_picker(src, "Pick primary tail color:","Tail Color (Pri)", current_pri_color) if(new_pri_color) var/list/new_color_rgb_list = hex2rgb(new_pri_color) r_tail = new_color_rgb_list[1] @@ -124,7 +124,7 @@ //Indented inside positive primary color choice, don't bother if they clicked cancel var/current_sec_color = rgb(r_tail2,g_tail2,b_tail2) - var/new_sec_color = input(src, "Pick secondary tail color (only applies to some tails):","Tail Color (sec)", current_sec_color) as null|color + var/new_sec_color = tgui_color_picker(src, "Pick secondary tail color (only applies to some tails):","Tail Color (sec)", current_sec_color) if(new_sec_color) new_color_rgb_list = hex2rgb(new_sec_color) r_tail2 = new_color_rgb_list[1] @@ -133,7 +133,7 @@ var/current_ter_color = rgb(r_tail3,g_tail3,b_tail3) - var/new_ter_color = input(src, "Pick tertiary tail color (only applies to some tails):","Tail Color (sec)", current_ter_color) as null|color + var/new_ter_color = tgui_color_picker(src, "Pick tertiary tail color (only applies to some tails):","Tail Color (sec)", current_ter_color) if(new_ter_color) new_color_rgb_list = hex2rgb(new_ter_color) r_tail3 = new_color_rgb_list[1] @@ -168,7 +168,7 @@ //Allow color picks var/current_color = rgb(r_wing,g_wing,b_wing) - var/new_color = input(src, "Pick wing color:","Wing Color", current_color) as null|color + var/new_color = tgui_color_picker(src, "Pick wing color:","Wing Color", current_color) if(new_color) var/list/new_color_rgb_list = hex2rgb(new_color) r_wing = new_color_rgb_list[1] @@ -178,7 +178,7 @@ //Indented inside positive primary color choice, don't bother if they clicked cancel var/current_sec_color = rgb(r_wing2,g_wing2,b_wing2) - var/new_sec_color = input(src, "Pick secondary wing color (only applies to some wings):","Wing Color (sec)", current_sec_color) as null|color + var/new_sec_color = tgui_color_picker(src, "Pick secondary wing color (only applies to some wings):","Wing Color (sec)", current_sec_color) if(new_sec_color) new_color_rgb_list = hex2rgb(new_sec_color) r_wing2 = new_color_rgb_list[1] @@ -187,7 +187,7 @@ var/current_ter_color = rgb(r_wing3,g_wing3,b_wing3) - var/new_ter_color = input(src, "Pick tertiary wing color (only applies to some wings):","Wing Color (sec)", current_ter_color) as null|color + var/new_ter_color = tgui_color_picker(src, "Pick tertiary wing color (only applies to some wings):","Wing Color (sec)", current_ter_color) if(new_ter_color) new_color_rgb_list = hex2rgb(new_ter_color) r_wing3 = new_color_rgb_list[1] diff --git a/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm b/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm index 3a95a60133..9cab07174b 100644 --- a/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm +++ b/code/modules/mob/living/carbon/human/species/station/prommie_blob.dm @@ -310,7 +310,7 @@ last_special = world.time + 25 - var/new_skin = input(src, "Please select a new body color.", "Shapeshifter Colour", color) as null|color + var/new_skin = tgui_color_picker(src, "Please select a new body color.", "Shapeshifter Colour", color) if(!new_skin) return color = new_skin 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 caf59cf37c..b83c24332e 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 @@ -460,7 +460,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = input("Pick underbelly color:","Underbelly Color", S.dragon_overlays[1]) as null|color + var/new_color = tgui_color_picker(protie, "Pick underbelly color:","Underbelly Color", S.dragon_overlays[1]) if(!new_color) return 0 S.dragon_overlays[1] = choice @@ -473,7 +473,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = input("Pick body color:","Body Color", S.dragon_overlays[2]) as null|color + var/new_color = tgui_color_picker(protie, "Pick body color:","Body Color", S.dragon_overlays[2]) if(!new_color) return 0 S.dragon_overlays[2] = choice @@ -486,7 +486,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = input("Pick ear color:","Ear Color", S.dragon_overlays[3]) as null|color + var/new_color = tgui_color_picker(protie, "Pick ear color:","Ear Color", S.dragon_overlays[3]) if(!new_color) return 0 S.dragon_overlays[3] = choice @@ -499,7 +499,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = input("Pick mane color:","Mane Color", S.dragon_overlays[4]) as null|color + var/new_color = tgui_color_picker(protie, "Pick mane color:","Mane Color", S.dragon_overlays[4]) if(!new_color) return 0 S.dragon_overlays[4] = choice @@ -512,7 +512,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = input("Pick horn color:","Horn Color", S.dragon_overlays[5]) as null|color + var/new_color = tgui_color_picker(protie, "Pick horn color:","Horn Color", S.dragon_overlays[5]) if(!new_color) return 0 S.dragon_overlays[5] = choice @@ -525,7 +525,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = input("Pick eye color:","Eye Color", S.dragon_overlays[6]) as null|color + var/new_color = tgui_color_picker(protie, "Pick eye color:","Eye Color", S.dragon_overlays[6]) if(!new_color) return 0 S.dragon_overlays[6] = choice @@ -575,7 +575,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = input("Pick shell color:","Shell Color", S.dullahan_overlays[3]) as null|color + var/new_color = tgui_color_picker(src, "Pick shell color:","Shell Color", S.dullahan_overlays[3]) if(!new_color) return 0 S.dullahan_overlays[3] = choice //metal overlay is 3, eyes is 4 @@ -594,7 +594,7 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = input("Pick eye color:","Eye Color", S.dullahan_overlays[4]) as null|color + var/new_color = tgui_color_picker(src, "Pick eye color:","Eye Color", S.dullahan_overlays[4]) if(!new_color) return 0 S.dullahan_overlays[4] = choice @@ -607,14 +607,14 @@ choice = show_radial_menu(protie, protie, options, radius = 90) if(!choice || QDELETED(protie) || protie.incapacitated()) return 0 - var/new_color = input("Pick decal color:","Decal Color", S.dullahan_overlays[5]) as null|color + var/new_color = tgui_color_picker(src, "Pick decal color:","Decal Color", S.dullahan_overlays[5]) if(!new_color) return 0 S.dullahan_overlays[5] = choice S.dullahan_overlays[S.dullahan_overlays[5]] = new_color if("Import") var/dinput_style - dinput_style = sanitizeSafe(input(protie,"Paste the style string you exported with Export Style.", "Style loading","") as text, 128) + dinput_style = sanitizeSafe(tgui_input_text(protie,"Paste the style string you exported with Export Style.", "Style loading","", 120), 128) if(dinput_style) var/list/dinput_style_list = splittext(dinput_style, ";") if((LAZYLEN(dinput_style_list) == 6) && (dinput_style_list[1] in dullahanmetal_styles) && (dinput_style_list[3] in dullahandecals_styles) && (dinput_style_list[5] in dullahaneyes_styles)) @@ -655,12 +655,12 @@ S.blob_appearance = "dullahan" // CHOMPEdit End if("Primary") - var/new_color = input("Pick primary color:","Protean Primary", "#FF0000") as null|color + var/new_color = tgui_color_picker(protie, "Pick primary color:","Protean Primary", "#FF0000") if(!new_color) return S.blob_color_1 = new_color if("Highlight") - var/new_color = input("Pick highlight color:","Protean Highlight", "#FF0000") as null|color + var/new_color = tgui_color_picker(protie, "Pick highlight color:","Protean Highlight", "#FF0000") if(!new_color) return S.blob_color_2 = new_color diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_ch.dm b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_ch.dm index 5614b93331..8d761759e7 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_ch.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_ch.dm @@ -28,7 +28,7 @@ to_chat(C, span_warning("You must have a tighter grip to bite this creature.")) return - var/choice = input(src, "What do you wish to inject?") as null|anything in list(REAGENT_APHRODISIAC, "Numbing", "Paralyzing") + var/choice = tgui_input_list(src, "What do you wish to inject?", "Reagent", list(REAGENT_APHRODISIAC, "Numbing", "Paralyzing")) last_special = world.time + 600 @@ -127,7 +127,7 @@ var/eggs = 0 if(last_special > world.time) return - var/choice = input(src, "What do you want to do?") as null|anything in list("Make a Egg", "lay your Eggs") + var/choice = tgui_input_list(src, "What do you want to do?", "Egg Option", list("Make a Egg", "lay your Eggs")) last_special = world.time + 600 if(!choice) @@ -182,7 +182,7 @@ var/eggs = 0 var/list/victims = list() for(var/mob/living/carbon/C in oview(1)) victims += C - var/mob/living/carbon/T = input(src, "Who will we sting?") as null|anything in victims + var/mob/living/carbon/T = tgui_input_list(src, "Who will we sting?", "Target", victims) if(!T) return diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm index 44b788985c..6ac4d74044 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm @@ -1116,7 +1116,7 @@ to_chat(src, span_warning("You are not a weaver! How are you doing this? Tell a developer!")) return - var/new_silk_color = input(src, "Pick a color for your woven products:","Silk Color", species.silk_color) as null|color + var/new_silk_color = tgui_color_picker(src, "Pick a color for your woven products:","Silk Color", species.silk_color) if(new_silk_color) species.silk_color = new_silk_color diff --git a/code/modules/mob/living/carbon/metroid/items.dm b/code/modules/mob/living/carbon/metroid/items.dm index 0c3f258840..27d214eb8b 100644 --- a/code/modules/mob/living/carbon/metroid/items.dm +++ b/code/modules/mob/living/carbon/metroid/items.dm @@ -151,7 +151,7 @@ qdel(M) - var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN) + var/newname = sanitize(tgui_input_text(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime", MAX_NAME_LEN)) if (!newname) newname = "pet slime" @@ -203,7 +203,7 @@ pet.colour = "[M.colour]" to_chat(user, "You feed the slime the potion, removing it's powers and calming it.") qdel(M) - var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN) + var/newname = sanitize(tgui_input_text(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime", MAX_NAME_LEN)) if (!newname) newname = "pet slime" diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index fe7c9971fa..f6244ead15 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1413,7 +1413,7 @@ /mob/living/verb/mob_sleep() set name = "Sleep" set category = "IC.Game" - if(!toggled_sleeping && alert(src, "Are you sure you wish to go to sleep? You will snooze until you use the Sleep verb again.", "Sleepy Time", "No", "Yes") == "No") + if(!toggled_sleeping && tgui_alert(src, "Are you sure you wish to go to sleep? You will snooze until you use the Sleep verb again.", "Sleepy Time", list("No", "Yes")) != "Yes") return toggled_sleeping = !toggled_sleeping to_chat(src, span_notice("You are [toggled_sleeping ? "now sleeping. Use the Sleep verb again to wake up" : "no longer sleeping"].")) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 46b24123bd..300ef01311 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -607,7 +607,9 @@ var/list/ai_verbs_default = list( var/input var/choice - choice = alert("Would you like to modify your hologram's model, or color?",,"Model","Color","Cancel") + choice = tgui_alert(src, "Would you like to modify your hologram's model, or color?", "Modify Hologram", list("Model","Color","Cancel")) + if(!choice || choice == "Cancel") + return switch(choice) if("Color") diff --git a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer_unify.dm b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer_unify.dm index 4d3efd6280..ecc14cbf46 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer_unify.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer_unify.dm @@ -13,7 +13,7 @@ /obj/machinery/drone_fabricator/proc/choose_dronetype(possible_drones) var/choice - choice = input(usr,"What module would you like to use?") as null|anything in possible_drones + choice = tgui_input_list(usr,"What module would you like to use?", "Drone Type", possible_drones) if(!choice) return drone_type = possible_drones[choice] //UNIFY end diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/animal.dm b/code/modules/mob/living/simple_mob/subtypes/animal/animal.dm index 836e4b7041..f2a693660d 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/animal.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/animal.dm @@ -34,7 +34,7 @@ set category = "IC.Settings" set desc = "Set your flavour text." set src = usr - var/new_flavour_text = sanitize((input("Please describe yourself.", "Flavour Text", flavor_text) as message|null), MAX_MESSAGE_LEN) + var/new_flavour_text = sanitize((tgui_input_text(src, "Please describe yourself.", "Flavour Text", flavor_text, MAX_MESSAGE_LEN, TRUE))) if(length(new_flavour_text) && !QDELETED(src)) flavor_text = new_flavour_text to_chat(src, span_notice("Your flavour text has been updated.")) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/vox.dm b/code/modules/mob/living/simple_mob/subtypes/animal/vox.dm index 502701e6c1..4f2546dcc9 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/vox.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/vox.dm @@ -101,8 +101,8 @@ var/text = null targets += getmobs() //Fill list, prompt user with list - target = input("Select a creature!", "Speak to creature", null, null) as null|anything in targets - text = input("What would you like to say?", "Speak to creature", null, null) + target = tgui_input_list(src, "Select a creature!", "Speak to creature", targets) + text = tgui_input_text(src, "What would you like to say?", "Speak to creature") if (!target || !text) return diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon.dm b/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon.dm index aae77a7b72..fd89f50376 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon.dm @@ -427,7 +427,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick underbelly color:","Underbelly Color", overlay_colors["Underbelly"]) as null|color + var/new_color = tgui_color_picker(src, "Pick underbelly color:","Underbelly Color", overlay_colors["Underbelly"]) if(!new_color) return 0 under = choice @@ -440,7 +440,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick body color:","Body Color", overlay_colors["Body"]) as null|color + var/new_color = tgui_color_picker(src, "Pick body color:","Body Color", overlay_colors["Body"]) if(!new_color) return 0 body = choice @@ -453,7 +453,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick ear color:","Ear Color", overlay_colors["Ears"]) as null|color + var/new_color = tgui_color_picker(src, "Pick ear color:","Ear Color", overlay_colors["Ears"]) if(!new_color) return 0 ears = choice @@ -466,7 +466,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick mane color:","Mane Color", overlay_colors["Mane"]) as null|color + var/new_color = tgui_color_picker(src, "Pick mane color:","Mane Color", overlay_colors["Mane"]) if(!new_color) return 0 mane = choice @@ -479,7 +479,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick horn color:","Horn Color", overlay_colors["Horns"]) as null|color + var/new_color = tgui_color_picker(src, "Pick horn color:","Horn Color", overlay_colors["Horns"]) if(!new_color) return 0 horns = choice @@ -492,7 +492,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick eye color:","Eye Color", overlay_colors["Eyes"]) as null|color + var/new_color = tgui_color_picker(src, "Pick eye color:","Eye Color", overlay_colors["Eyes"]) if(!new_color) return 0 eyes = choice diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon_ch.dm b/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon_ch.dm index ff0bb40509..5d384b4e52 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon_ch.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon_ch.dm @@ -323,7 +323,7 @@ I think I covered everything. to_chat(src, span_userdanger("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 @@ -334,7 +334,7 @@ I think I covered everything. set desc = "Set your description." set category = "Abilities.Settings" 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","")) if(newdesc) desc = newdesc */ @@ -457,7 +457,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick underbelly color:","Underbelly Color", overlay_colors["Underbelly"]) as null|color + var/new_color = tgui_color_picker(src, "Pick underbelly color:","Underbelly Color", overlay_colors["Underbelly"]) if(!new_color) return 0 under = choice @@ -470,7 +470,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick body color:","Body Color", overlay_colors["Body"]) as null|color + var/new_color = tgui_color_picker(src, "Pick body color:","Body Color", overlay_colors["Body"]) if(!new_color) return 0 body = choice @@ -483,7 +483,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick ear color:","Ear Color", overlay_colors["Ears"]) as null|color + var/new_color = tgui_color_picker(src, "Pick ear color:","Ear Color", overlay_colors["Ears"]) if(!new_color) return 0 ears = choice @@ -496,7 +496,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick mane color:","Mane Color", overlay_colors["Mane"]) as null|color + var/new_color = tgui_color_picker(src, "Pick mane color:","Mane Color", overlay_colors["Mane"]) if(!new_color) return 0 mane = choice @@ -509,7 +509,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick horn color:","Horn Color", overlay_colors["Horns"]) as null|color + var/new_color = tgui_color_picker(src, "Pick horn color:","Horn Color", overlay_colors["Horns"]) if(!new_color) return 0 horns = choice @@ -522,7 +522,7 @@ I think I covered everything. choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick eye color:","Eye Color", overlay_colors["Eyes"]) as null|color + var/new_color = tgui_color_picker(src, "Pick eye color:","Eye Color", overlay_colors["Eyes"]) if(!new_color) return 0 eyes = choice diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities_ch.dm b/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities_ch.dm index 843fa40136..91e13c6fc9 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities_ch.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/demon/demon_abilities_ch.dm @@ -82,9 +82,8 @@ set desc = "Changes the amount you grow/shrink people." set category = "Abilities.Demon" - var/size_select = input("Put the desired size (25-200%)", "Set Size", size_amount * 100) as num //Stolen from sizegun code - if(size_select > 200 || size_select < 25) - to_chat(usr, span_notice("Invalid size.")) + var/size_select = tgui_input_number(src, "Put the desired size ([RESIZE_MINIMUM * 100]-[RESIZE_MAXIMUM * 100]%)", "Set Size", size_amount * 100, RESIZE_MAXIMUM * 100, RESIZE_MINIMUM * 100) //Stolen from sizegun code + if(!size_select) return size_amount = (size_select/100) to_chat(src,span_notice("Size spell set to [size_select]%")) //Telling the user the new amount diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/goia_ch.dm b/code/modules/mob/living/simple_mob/subtypes/vore/goia_ch.dm index b95d5866ca..538eff5af0 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/goia_ch.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/goia_ch.dm @@ -118,7 +118,7 @@ set name = "Change Color" set desc = "Change your main color." set category = "Abilities.General" - var/new_color = input("Pick new colors:","Color", goia_overlays["zorgoia_main"]) as null|color + var/new_color = tgui_color_picker(src, "Pick new colors:","Color", goia_overlays["zorgoia_main"]) if(!new_color) return 0 goia_overlays["zorgoia_main"] = new_color @@ -146,7 +146,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick ears spike color:","Ears Color", goia_overlays["zorgoia_ears"]) as null|color + var/new_color = tgui_color_picker(src, "Pick ears spike color:","Ears Color", goia_overlays["zorgoia_ears"]) if(!new_color) return 0 goia_overlays["ears"] = choice @@ -161,7 +161,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick spot colors:","Spots Color", goia_overlays["zorgoia_spots"]) as null|color + var/new_color = tgui_color_picker(src, "Pick spot colors:","Spots Color", goia_overlays["zorgoia_spots"]) if(!new_color) return 0 goia_overlays["spots"] = choice @@ -176,7 +176,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick claw colors:","Claws Color", goia_overlays["zorgoia_claws"]) as null|color + var/new_color = tgui_color_picker(src, "Pick claw colors:","Claws Color", goia_overlays["zorgoia_claws"]) if(!new_color) return 0 goia_overlays["claws"] = choice @@ -191,7 +191,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick spines colors:","Spines Color", goia_overlays["zorgoia_spines"]) as null|color + var/new_color = tgui_color_picker(src, "Pick spines colors:","Spines Color", goia_overlays["zorgoia_spines"]) if(!new_color) return 0 goia_overlays["spines"] = choice @@ -206,7 +206,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick fluff colors:","Fluff Color", goia_overlays["zorgoia_fluff"]) as null|color + var/new_color = tgui_color_picker(src, "Pick fluff colors:","Fluff Color", goia_overlays["zorgoia_fluff"]) if(!new_color) return 0 goia_overlays["fluff"] = choice @@ -221,7 +221,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick underbelly colors:","Underbelly Color", goia_overlays["zorgoia_underbelly"]) as null|color + var/new_color = tgui_color_picker(src, "Pick underbelly colors:","Underbelly Color", goia_overlays["zorgoia_underbelly"]) if(!new_color) return 0 goia_overlays["underbelly"] = choice @@ -236,7 +236,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick eye color:","Eye Color", goia_overlays["zorgoia_eyes"]) as null|color + var/new_color = tgui_color_picker(src, "Pick eye color:","Eye Color", goia_overlays["zorgoia_eyes"]) if(!new_color) return 0 goia_overlays["eyes"] = choice @@ -251,7 +251,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick tail spike color:","Tail Color", goia_overlays["zorgoia_spike"]) as null|color //This is overlay 10, not 2, swapped with main body, im not rewriting this array + var/new_color = tgui_color_picker(src, "Pick tail spike color:","Tail Color", goia_overlays["zorgoia_spike"]) //This is overlay 10, not 2, swapped with main body, im not rewriting this array if(!new_color) return 0 goia_overlays["spike"] = choice @@ -266,7 +266,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick belly color:","Belly Color", goia_overlays["zorgoia_belly"]) as null|color + var/new_color = tgui_color_picker(src, "Pick belly color:","Belly Color", goia_overlays["zorgoia_belly"]) if(!new_color) return 0 goia_overlays["belly"] = choice @@ -504,7 +504,7 @@ set desc = "Import a string of text that was made using the import style verb to get back that style" set category = "Abilities.Settings" var/input_style - input_style = sanitizeSafe(input(src,"Paste the style string you exported with Export Style.", "Style loading","") as text, MAX_MESSAGE_LEN) + input_style = sanitizeSafe(tgui_input_text(src,"Paste the style string you exported with Export Style.", "Style loading","", 250)) if(input_style) var/list/input_style_list = splittext(input_style, ";") if((LAZYLEN(input_style_list) == 20) /* && (input_style_list[2] in main_styles) */ \ diff --git a/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm b/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm index d3b0feb67f..b1a6578f03 100644 --- a/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm +++ b/code/modules/modular_computers/file_system/programs/generic/ntnrc_client.dm @@ -101,7 +101,7 @@ if("PRG_savelog") if(!channel) return - var/logname = stripped_input(params["log_name"]) + var/logname = sanitize(params["log_name"]) if(!logname) return var/datum/computer_file/data/logfile = new /datum/computer_file/data/logfile() diff --git a/code/modules/organs/internal/eyes.dm b/code/modules/organs/internal/eyes.dm index 19e8e996d2..31e29c0704 100644 --- a/code/modules/organs/internal/eyes.dm +++ b/code/modules/organs/internal/eyes.dm @@ -40,7 +40,7 @@ set src in usr var/current_color = rgb(eye_colour[1],eye_colour[2],eye_colour[3]) - var/new_color = input(src, "Pick a new color for your eyes.","Eye Color", current_color) as null|color + var/new_color = tgui_color_picker(src, "Pick a new color for your eyes.","Eye Color", current_color) if(new_color && owner) // input() supplies us with a hex color, which we can't use, so we convert it to rbg values. var/list/new_color_rgb_list = hex2rgb(new_color) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 50cfdf1973..105f702c47 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -450,7 +450,7 @@ if(href_list["write"]) var/id = href_list["write"] - //var/t = strip_html_simple(input(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null),8192) as message + //var/t = strip_html_simple(tgui_input_text(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null, multiline=TRUE),8192) if(free_space <= 0) to_chat(usr, span_info("There isn't enough space left on \the [src] to write anything.")) diff --git a/code/modules/pda/cart_apps.dm b/code/modules/pda/cart_apps.dm index 57a5cd4358..5b052a0a6f 100644 --- a/code/modules/pda/cart_apps.dm +++ b/code/modules/pda/cart_apps.dm @@ -23,9 +23,9 @@ if("alert") post_status("alert", params["alert"]) if("setmsg1") - message1 = clean_input("Line 1", "Enter Message Text", message1) + message1 = tgui_input_text(ui.user,"Line 1", "Enter Message Text", message1, encode=TRUE) if("setmsg2") - message2 = clean_input("Line 2", "Enter Message Text", message2) + message2 = tgui_input_text(ui.user, "Line 2", "Enter Message Text", message2, encode=TRUE) else post_status(params["statdisp"]) return TRUE diff --git a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm index 5c97db64fd..9514f59622 100644 --- a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm +++ b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm @@ -56,8 +56,8 @@ GLOBAL_LIST_EMPTY(fuel_injectors) return //CHOMPEdit Begin if(istype(W,/obj/item/fuel_assembly/blitz)) - var/secondchance = alert("Are you sure you want to put the blitz rod in the fuel injector? This definitely wasn't meant to be used like this, and could only end badly.","Confirm","Yes","No") - if(secondchance=="No") + var/secondchance = tgui_alert(user, "Are you sure you want to put the blitz rod in the fuel injector? This definitely wasn't meant to be used like this, and could only end badly.","Confirm",list("Yes","No")) + if(!secondchance || secondchance=="No") return //CHOMPEdit End if(cur_assembly) diff --git a/code/modules/power/fusion/gyrotron/gyrotron_control.dm b/code/modules/power/fusion/gyrotron/gyrotron_control.dm index eff9634137..ffd9c479b2 100644 --- a/code/modules/power/fusion/gyrotron/gyrotron_control.dm +++ b/code/modules/power/fusion/gyrotron/gyrotron_control.dm @@ -90,7 +90,7 @@ return if(href_list["modifypower"]) - var/new_val = input(usr, "Enter new emission power level (1 - 50)", "Modifying power level", G.mega_energy) as num + var/new_val = tgui_input_number(usr, "Enter new emission power level (1 - 50)", "Modifying power level", G.mega_energy, 50, 1) if(!new_val) to_chat(usr, span_warning("That's not a valid number.")) return 1 @@ -100,7 +100,7 @@ return 1 if(href_list["modifyrate"]) - var/new_val = input(usr, "Enter new emission delay between 1 and 10 seconds.", "Modifying emission rate", G.rate) as num + var/new_val = tgui_input_number(usr, "Enter new emission delay between 1 and 10 seconds.", "Modifying emission rate", G.rate, 10, 1) if(!new_val) to_chat(usr, span_warning("That's not a valid number.")) return 1 diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm index dbbeec0cd3..e82d16cadc 100644 --- a/code/modules/projectiles/guns/energy/stun.dm +++ b/code/modules/projectiles/guns/energy/stun.dm @@ -156,7 +156,7 @@ to_chat(M, span_notice("You don't feel cool enough to name this gun, chump.")) return 0 - var/input = sanitizeSafe(input("What do you want to name the gun?", ,""), MAX_NAME_LEN) + var/input = sanitizeSafe(tgui_input_text(M,"What do you want to name the gun?","Rename Gun" ,"",MAX_NAME_LEN)) if(src && input && !M.stat && in_range(M,src)) name = input @@ -177,7 +177,7 @@ options["Lawson Arms LTX1020 (Stainless)"] = "stainstunrevolver" options["Lawson Arms LTX1020 (Ace)"] = "snubstunrevolver" options["Lawson Arms LTX1020 (Gold)"] = "goldstunrevolver" - var/choice = input(M,"Choose your sprite!","Resprite Gun") in options + var/choice = tgui_input_list(M,"Choose your sprite!","Resprite Gun", options) if(src && choice && !M.stat && in_range(M,src)) icon_state = options[choice] unique_reskin = options[choice] diff --git a/code/modules/projectiles/guns/projectile/pistol.dm b/code/modules/projectiles/guns/projectile/pistol.dm index 030d0e3ccd..e613dc746a 100644 --- a/code/modules/projectiles/guns/projectile/pistol.dm +++ b/code/modules/projectiles/guns/projectile/pistol.dm @@ -45,7 +45,7 @@ to_chat(M, span_notice("You don't feel cool enough to name this gun, chump.")) return 0 - var/input = sanitizeSafe(input(M, "What do you want to name the gun?", ,""), MAX_NAME_LEN) + var/input = sanitizeSafe(tgui_input_text(M, "What do you want to name the gun?","Rename Gun" ,"",MAX_NAME_LEN)) if(src && input && !M.stat && in_range(M,src)) name = input diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm index c447ec5a14..e150ada4d6 100644 --- a/code/modules/projectiles/guns/projectile/revolver.dm +++ b/code/modules/projectiles/guns/projectile/revolver.dm @@ -68,7 +68,7 @@ to_chat(M, span_notice("You don't feel cool enough to name this gun, chump.")) return 0 - var/input = sanitizeSafe(input(M, "What do you want to name the gun?", ,""), MAX_NAME_LEN) + var/input = sanitizeSafe(tgui_input_text(M, "What do you want to name the gun?","Rename Revolver" ,"",MAX_NAME_LEN)) if(src && input && !M.stat && in_range(M,src)) name = input @@ -96,7 +96,7 @@ to_chat(M, span_notice("You don't feel cool enough to name this gun, chump.")) return 0 - var/input = sanitizeSafe(input(M, "What do you want to name the gun?", ,""), MAX_NAME_LEN) + var/input = sanitizeSafe(tgui_input_text(M, "What do you want to name the gun?","Rename Revolver" ,"", MAX_NAME_LEN), MAX_NAME_LEN) if(src && input && !M.stat && in_range(M,src)) name = input diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index afab30094e..47843c82de 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -146,7 +146,7 @@ set category = "Object" set desc = "Rename your gun." - var/input = sanitizeSafe(input(usr, "What do you want to name the gun?", ,""), MAX_NAME_LEN) + var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name the gun?","Rename Shotgun" ,"",MAX_NAME_LEN)) var/mob/M = usr if(src && input && !M.stat && in_range(M,src)) diff --git a/code/modules/spells/general/rune_write.dm b/code/modules/spells/general/rune_write.dm index 71f9ca8c46..6f09c9ed2e 100644 --- a/code/modules/spells/general/rune_write.dm +++ b/code/modules/spells/general/rune_write.dm @@ -20,7 +20,7 @@ if(!cultwords["travel"]) runerandom() var/list/runes = list("Teleport", "Teleport Other", "Spawn a Tome", "Change Construct Type", "Convert", "EMP", "Drain Blood", "See Invisible", "Resurrect", "Hide Runes", "Reveal Runes", "Astral Journey", "Manifest a Ghost", "Imbue Talisman", "Sacrifice", "Wall", "Free Cultist", "Summon Cultist", "Deafen", "Blind", "BloodBoil", "Communicate", "Stun") - var/r = input(user, "Choose a rune to scribe", "Rune Scribing") in runes //not cancellable. + var/r = tgui_input_list(user, "Choose a rune to scribe", "Rune Scribing", runes, timeout=30 SECONDS) var/obj/effect/rune/R = new /obj/effect/rune(user.loc) if(istype(user.loc,/turf)) var/area/A = get_area(user) @@ -30,7 +30,7 @@ if(cast_check(1)) var/beacon if(user) - beacon = input(user, "Select the last rune", "Rune Scribing") in rnwords + beacon = tgui_input_list(user, "Select the last rune", "Rune Scribing", rnwords, timeout=30 SECONDS) R.word1=cultwords["travel"] R.word2=cultwords["self"] R.word3=beacon @@ -39,7 +39,7 @@ if(cast_check(1)) var/beacon if(user) - beacon = input(user, "Select the last rune", "Rune Scribing") in rnwords + beacon = tgui_input_list(user, "Select the last rune", "Rune Scribing", rnwords, timeout=30 SECONDS) R.word1=cultwords["travel"] R.word2=cultwords["other"] R.word3=beacon @@ -171,5 +171,5 @@ R.word3=cultwords["technology"] R.check_icon() else - to_chat(user, span_warning(" You do not have enough space to write a proper rune.")) + to_chat(user, span_warning("You do not have enough space to write a proper rune.")) return diff --git a/code/modules/tgui/modules/admin/player_notes.dm b/code/modules/tgui/modules/admin/player_notes.dm index 2632585d5d..d7e9ccb90e 100644 --- a/code/modules/tgui/modules/admin/player_notes.dm +++ b/code/modules/tgui/modules/admin/player_notes.dm @@ -191,7 +191,7 @@ if (!istype(src,/datum/admins)) to_chat(usr, "Error: you are not an admin!") return - var/filter = input(usr, "Filter string (case-insensitive regex)", "Player notes filter") + var/filter = tgui_input_text(usr, "Filter string (case-insensitive regex)", "Player notes filter") PlayerNotesPageLegacy(1, filter) /datum/admins/proc/PlayerNotesPageLegacy(page, filter) @@ -296,7 +296,7 @@ if(href_list["add_player_info_legacy"]) var/key = href_list["add_player_info_legacy"] - var/add = sanitize(input(usr, "Add Player Info (Legacy)")) + var/add = sanitize(tgui_input_text(usr, "Add Player Info (Legacy)", multiline=TRUE)) if(!add) return notes_add(key,add,usr) diff --git a/code/modules/tgui/modules/rcon.dm b/code/modules/tgui/modules/rcon.dm index 0cecc4c5ee..fe1f57349b 100644 --- a/code/modules/tgui/modules/rcon.dm +++ b/code/modules/tgui/modules/rcon.dm @@ -78,15 +78,21 @@ var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes"]) if(SMES) SMES.tgui_set_io(SMES_TGUI_INPUT, params["target"], text2num(params["adjust"])) - // var/inputset = (input(ui.user, "Enter new input level (0-[SMES.input_level_max/1000] kW)", "SMES Input Power Control", SMES.input_level/1000) as num) * 1000 - // SMES.set_input(inputset) + /* var/inputset = (tgui_input_number(ui.user, "Enter new input level (0-[SMES.input_level_max/1000] kW)", "SMES Input Power Control", SMES.input_level/1000)) + if(inputset) + inputset *= 1000 + SMES.set_input(inputset) + */ . = TRUE if("smes_out_set") var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(params["smes"]) if(SMES) SMES.tgui_set_io(SMES_TGUI_OUTPUT, params["target"], text2num(params["adjust"])) - // var/outputset = (input(ui.user, "Enter new output level (0-[SMES.output_level_max/1000] kW)", "SMES Output Power Control", SMES.output_level/1000) as num) * 1000 - // SMES.set_output(outputset) + /* var/outputset = (tgui_input_number(ui.user, "Enter new output level (0-[SMES.output_level_max/1000] kW)", "SMES Output Power Control", SMES.output_level/1000)) + if(outputset) + outputset *= 1000 + SMES.set_input(outputset) + SMES.set_output(outputset) */ . = TRUE if("toggle_breaker") var/obj/machinery/power/breakerbox/toggle = null diff --git a/code/modules/vore/eating/living_ch.dm b/code/modules/vore/eating/living_ch.dm index a7b7199213..3180eedbe5 100644 --- a/code/modules/vore/eating/living_ch.dm +++ b/code/modules/vore/eating/living_ch.dm @@ -79,7 +79,7 @@ set category = "Abilities.Vore" set desc = "Check the amount of liquid in your belly." - var/obj/belly/RTB = input("Choose which vore belly to check") as null|anything in src.vore_organs + var/obj/belly/RTB = tgui_input_list(src, "Choose which vore belly to check", "Select Belly", vore_organs) if(!RTB) return FALSE @@ -94,16 +94,16 @@ if(!checkClickCooldown() || incapacitated(INCAPACITATION_KNOCKOUT)) return FALSE - var/mob/living/user = usr + var/mob/living/user = src - var/mob/living/TG = input("Choose who to transfer from") as null| mob in view(1,user.loc) + var/mob/living/TG = tgui_input_list(user, "Choose who to transfer from", "Transfer From", mobs_in_view(1,user)) if(!TG) return FALSE if(TG.give_reagents == FALSE && user != TG) //User isnt forced to allow giving in prefs if they are the one doing it to_chat(user, span_vwarning("This person's prefs dont allow that!")) return FALSE - var/obj/belly/RTB = input("Choose which vore belly to transfer from") as null|anything in TG.vore_organs //First they choose the belly to transfer from. + var/obj/belly/RTB = tgui_input_list(user, "Choose which vore belly to transfer from", "Select Belly", vore_organs) if(!RTB) return FALSE @@ -115,11 +115,11 @@ if("Cancel") return FALSE if("Vore belly") - var/mob/living/TR = input(user,"Choose who to transfer to","Select Target") as null|mob in view(1,user.loc) + var/mob/living/TR = tgui_input_list(user,"Choose who to transfer to","Select Target", mobs_in_view(1,user)) if(!TR) return FALSE if(TR == user) //Proceed, we dont need to have prefs enabled for transfer within user - var/obj/belly/TB = input("Choose which organ to transfer to") as null|anything in user.vore_organs + var/obj/belly/TB = tgui_input_list(user, "Choose which organ to transfer to", "Select Belly", user.vore_organs) if(!TB) return FALSE if(!Adjacent(TR) || !Adjacent(TG)) @@ -142,7 +142,7 @@ return FALSE else - var/obj/belly/TB = input("Choose which organ to transfer to") as null|anything in TR.vore_organs + var/obj/belly/TB = tgui_input_list(user, "Choose which organ to transfer to", "Select Belly", TR.vore_organs) if(!TB) return FALSE if(!Adjacent(TR) || !Adjacent(TG)) @@ -165,7 +165,7 @@ if("Stomach") - var/mob/living/TR = input(user,"Choose who to transfer to","Select Target") as null|mob in view(1,user.loc) + var/mob/living/TR = tgui_input_list(user,"Choose who to transfer to","Select Target", mobs_in_view(1,user)) if(!TR) return if(!Adjacent(TR) || !Adjacent(TG)) return //No long distance transfer @@ -201,7 +201,7 @@ var/list/choices = list() for(var/obj/item/reagent_containers/rc in view(1,user.loc)) choices += rc - var/obj/item/reagent_containers/T = input(user,"Choose what to transfer to","Select Target") as null|anything in choices + var/obj/item/reagent_containers/T = tgui_input_list(user,"Choose what to transfer to","Select Target", choices) if(!T) return FALSE if(!Adjacent(T) || !Adjacent(TG)) @@ -255,7 +255,7 @@ set desc = "Provide bellyrubs to either yourself or another mob with a belly." if(!T) - T = input("Choose whose belly to rub") as null| mob in view(1,src) + T = tgui_input_list(src, "Choose whose belly to rub", "Rub Belly?", mobs_in_view(1,src)) if(!T) return FALSE if(!(T in view(1,src))) diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 5748abfb45..d12f2e133f 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -973,7 +973,7 @@ //Again, no real need for a check on this. I'm unsure how it could be somehow abused. //Even if they open the box 900 times, who cares, they get the wrong color and do it again. - var/new_color = input(src,"Select a new color","Body Glow",glow_color) as color + var/new_color = tgui_color_picker(src,"Select a new color","Body Glow",glow_color) if(new_color) glow_color = new_color diff --git a/code/modules/vore/eating/simple_animal_vr.dm b/code/modules/vore/eating/simple_animal_vr.dm index 0edab44b63..78c893761a 100644 --- a/code/modules/vore/eating/simple_animal_vr.dm +++ b/code/modules/vore/eating/simple_animal_vr.dm @@ -129,7 +129,7 @@ if(nutrition < 10) to_chat(src, span_warning("You are too hungry to regenerate health.")) return - var/heal_amount = input(src, "Input the amount of health to regenerate at the rate of 10 nutrition per second per hitpoint. Current health: [health] / [maxHealth]", "Regenerate health.") as num|null + var/heal_amount = tgui_input_number(src, "Input the amount of health to regenerate at the rate of 10 nutrition per second per hitpoint. Current health: [health] / [maxHealth]", "Regenerate health.", 1, min_value=1) if(!heal_amount) return heal_amount = CLAMP(heal_amount, 1, maxHealth - health) diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 7cb0c22aaf..db6af4ea2d 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -2925,7 +2925,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", //CHOMPedit start: liquid belly procs /datum/vore_look/proc/liq_set_attr(mob/user, params) if(!host.vore_selected) - alert("No belly selected to modify.") + tgui_alert("No belly selected to modify.") return FALSE var/attr = params["liq_attribute"] @@ -2959,7 +2959,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", var/new_name = html_encode(tgui_input_text(user,"New name for liquid shown when transfering and dumping on floor (The actual liquid's name is still the same):","New Name",host.vore_selected.reagent_name)) if(length(new_name) > BELLIES_NAME_MAX || length(new_name) < BELLIES_NAME_MIN) - alert("Entered name length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") + tgui_alert("Entered name length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") return FALSE host.vore_selected.reagent_name = new_name @@ -2968,7 +2968,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", var/new_verb = html_encode(tgui_input_text(user,"New verb when liquid is transfered from this belly:","New Verb", host.vore_selected.reagent_transfer_verb)) if(length(new_verb) > BELLIES_NAME_MAX || length(new_verb) < BELLIES_NAME_MIN) - alert("Entered verb length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") + tgui_alert("Entered verb length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") return FALSE host.vore_selected.reagent_transfer_verb = new_verb @@ -3140,8 +3140,8 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", host.vore_selected.update_internal_overlay() . = TRUE if("b_liq_purge") - var/alert = alert("Are you sure you want to delete the liquids in your [lowertext(host.vore_selected.name)]?","Confirmation","Delete","Cancel") - if(!(alert == "Delete")) + var/alert = tgui_alert("Are you sure you want to delete the liquids in your [lowertext(host.vore_selected.name)]?","Confirmation",list("Delete","Cancel")) + if(alert != "Delete") return FALSE else host.vore_selected.reagents.clear_reagents() @@ -3151,7 +3151,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", /datum/vore_look/proc/liq_set_msg(mob/user, params) if(!host.vore_selected) - alert("No belly selected to modify.") + tgui_alert(user, "No belly selected to modify.") return FALSE var/attr = params["liq_messages"] @@ -3180,7 +3180,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", host.vore_selected.liquid_fullness5_messages = !host.vore_selected.liquid_fullness5_messages . = TRUE if("b_liq_msg1") - alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") + tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 0 to 20% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (0 - 20%)",host.vore_selected.get_reagent_messages("full1")) @@ -3188,7 +3188,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", host.vore_selected.set_reagent_messages(new_message,"full1") . = TRUE if("b_liq_msg2") - alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") + tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 20 to 40% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (20 - 40%)",host.vore_selected.get_reagent_messages("full2")) @@ -3196,7 +3196,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", host.vore_selected.set_reagent_messages(new_message,"full2") . = TRUE if("b_liq_msg3") - alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") + tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 40 to 60% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (40 - 60%)",host.vore_selected.get_reagent_messages("full3")) @@ -3204,7 +3204,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", host.vore_selected.set_reagent_messages(new_message,"full3") . = TRUE if("b_liq_msg4") - alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") + tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 60 to 80% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (60 - 80%)",host.vore_selected.get_reagent_messages("full4")) @@ -3212,7 +3212,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", host.vore_selected.set_reagent_messages(new_message,"full4") . = TRUE if("b_liq_msg5") - alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") + tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 80 to 100% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (80 - 100%)",host.vore_selected.get_reagent_messages("full5")) diff --git a/code/modules/vote/vote_verb.dm b/code/modules/vote/vote_verb.dm index 12f8ae7d7f..6e18b9f89d 100644 --- a/code/modules/vote/vote_verb.dm +++ b/code/modules/vote/vote_verb.dm @@ -48,7 +48,7 @@ choices |= option var/c2 = tgui_alert(usr, "Show counts while vote is happening?", "Counts", list("Yes", "No")) - var/c3 = input(usr, "Select a result calculation type", "Vote", VOTE_RESULT_TYPE_MAJORITY) as anything in list(VOTE_RESULT_TYPE_MAJORITY) + var/c3 = tgui_input_list(usr, "Select a result calculation type", "Vote", list(VOTE_RESULT_TYPE_MAJORITY)) var/datum/vote/V = new /datum/vote(usr.ckey, question, choices, TRUE) V.show_counts = (c2 == "Yes") diff --git a/code/modules/xenoarcheaology/effect_master.dm b/code/modules/xenoarcheaology/effect_master.dm index 1416cf77e9..169ec50081 100644 --- a/code/modules/xenoarcheaology/effect_master.dm +++ b/code/modules/xenoarcheaology/effect_master.dm @@ -125,7 +125,7 @@ var/list/toxic_reagents = list(TOXIN_PATH) return effects /datum/component/artifact_master/proc/add_effect() - var/effect_type = input(usr, "What type do you want?", "Effect Type") as null|anything in subtypesof(/datum/artifact_effect) + var/effect_type = tgui_input_list(usr, "What type do you want?", "Effect Type", subtypesof(/datum/artifact_effect)) if(effect_type) var/datum/artifact_effect/my_effect = new effect_type(src) if(istype(holder, my_effect.req_type)) @@ -136,7 +136,7 @@ var/list/toxic_reagents = list(TOXIN_PATH) qdel(my_effect) /datum/component/artifact_master/proc/remove_effect() - var/to_remove_effect = input(usr, "What effect do you want to remove?", "Remove Effect") as null|anything in my_effects + var/to_remove_effect = tgui_input_list(usr, "What effect do you want to remove?", "Remove Effect", my_effects) if(to_remove_effect) var/datum/artifact_effect/AE = to_remove_effect diff --git a/maps/tether_better/tether_things.dm b/maps/tether_better/tether_things.dm index 92fd570c5c..6ea91f72a4 100644 --- a/maps/tether_better/tether_things.dm +++ b/maps/tether_better/tether_things.dm @@ -251,7 +251,7 @@ var/mob/living/carbon/human/user = AM - var/choice = alert("Do you want to depart via the tram? Your character will leave the round.","Departure","Yes","No") + var/choice = tgui_alert(user, "Do you want to depart via the tram? Your character will leave the round.","Departure",list("Yes","No")) if(user && Adjacent(user) && choice == "Yes") var/mob/observer/dead/newghost = user.ghostize() newghost.timeofdeath = world.time diff --git a/maps/yw/cryogaia_things.dm b/maps/yw/cryogaia_things.dm index f80db2938d..1231592db9 100644 --- a/maps/yw/cryogaia_things.dm +++ b/maps/yw/cryogaia_things.dm @@ -191,7 +191,7 @@ var/mob/living/carbon/human/user = AM - var/choice = alert("Do you want to depart via the tram? Your character will leave the round.","Departure","Yes","No") + var/choice = tgui_alert(user, "Do you want to depart via the tram? Your character will leave the round.","Departure",list("Yes","No")) if(user && Adjacent(user) && choice == "Yes") var/mob/observer/dead/newghost = user.ghostize() newghost.timeofdeath = world.time diff --git a/modular_chomp/code/modules/admin/functions/modify_traits.dm b/modular_chomp/code/modules/admin/functions/modify_traits.dm index 72cc82f567..e844c6c2b6 100644 --- a/modular_chomp/code/modules/admin/functions/modify_traits.dm +++ b/modular_chomp/code/modules/admin/functions/modify_traits.dm @@ -3,7 +3,7 @@ if(!D) return - var/add_or_remove = input("Remove/Add?", "Trait Remove/Add") as null|anything in list("Add","Remove") + var/add_or_remove = tgui_input_list(usr, "Remove/Add?", "Trait Remove/Add", list("Add","Remove")) if(!add_or_remove) return var/list/availible_traits = list() @@ -20,7 +20,7 @@ var/name = GLOB.trait_name_map[trait] || trait availible_traits[name] = trait - var/chosen_trait = input("Select trait to modify", "Trait") as null|anything in availible_traits + var/chosen_trait = tgui_input_list(usr, "Select trait to modify", "Trait", availible_traits) if(!chosen_trait) return chosen_trait = availible_traits[chosen_trait] @@ -30,14 +30,14 @@ if("Add") //Not doing source choosing here intentionally to make this bit faster to use, you can always vv it. ADD_TRAIT(D,chosen_trait,source) if("Remove") - var/specific = input("All or specific source ?", "Trait Remove/Add") as null|anything in list("All","Specific") + var/specific = tgui_input_list(usr, "All or specific source ?", "Trait Remove/Add", list("All","Specific")) if(!specific) return switch(specific) if("All") source = null if("Specific") - source = input("Source to be removed","Trait Remove/Add") as null|anything in D.status_traits[chosen_trait] + source = tgui_input_list(usr, "Source to be removed","Trait Remove/Add", D.status_traits[chosen_trait]) if(!source) return - REMOVE_TRAIT(D,chosen_trait,source) \ No newline at end of file + REMOVE_TRAIT(D,chosen_trait,source) diff --git a/modular_chomp/code/modules/mob/living/simple_animal/aliens/synx.dm b/modular_chomp/code/modules/mob/living/simple_animal/aliens/synx.dm index ab15fe8e5d..e9c7d69ca2 100644 --- a/modular_chomp/code/modules/mob/living/simple_animal/aliens/synx.dm +++ b/modular_chomp/code/modules/mob/living/simple_animal/aliens/synx.dm @@ -685,7 +685,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick body color:","Body Color", overlay_colors["Body"]) as null|color + var/new_color = tgui_color_picker(src, "Pick body color:","Body Color", overlay_colors["Body"]) if(!new_color) return 0 body = choice @@ -698,7 +698,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick horn color:","Horn Color", overlay_colors["Horns"]) as null|color + var/new_color = tgui_color_picker(src, "Pick horn color:","Horn Color", overlay_colors["Horns"]) if(!new_color) return 0 horns = choice @@ -711,7 +711,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick marking color:","Marking Color", overlay_colors["Marks"]) as null|color + var/new_color = tgui_color_picker(src, "Pick marking color:","Marking Color", overlay_colors["Marks"]) if(!new_color) return 0 markings = choice @@ -724,7 +724,7 @@ choice = show_radial_menu(src, src, options, radius = 90) if(!choice || QDELETED(src) || src.incapacitated()) return 0 - var/new_color = input("Pick eye color:","Eye Color", overlay_colors["Eyes"]) as null|color + var/new_color = tgui_color_picker(src, "Pick eye color:","Eye Color", overlay_colors["Eyes"]) if(!new_color) return 0 eyes = choice diff --git a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon.dm b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon.dm index 25ba38fdf2..4bb15ee40d 100644 --- a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon.dm +++ b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/bigdragon.dm @@ -27,7 +27,7 @@ set desc = "Import a string of text that was made using the import style verb to get back that style" set category = "Abilities.Settings" var/input_style - input_style = sanitizeSafe(input(src,"Paste the style string you exported with Export Style.", "Style loading","") as text, MAX_MESSAGE_LEN) + input_style = sanitizeSafe(tgui_input_text(src,"Paste the style string you exported with Export Style.", "Style loading")) if(input_style) var/list/input_style_list = splittext(input_style, ";") if((LAZYLEN(input_style_list) == 12) && (input_style_list[2] in underbelly_styles) && (input_style_list[4] in body_styles) && (input_style_list[6] in ear_styles) && (input_style_list[8] in mane_styles) && (input_style_list[10] in horn_styles) && (input_style_list[12] in ear_styles)) diff --git a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/swoopie.dm b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/swoopie.dm index c2388cd279..b2abda3555 100644 --- a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/swoopie.dm +++ b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/swoopie.dm @@ -292,7 +292,7 @@ if(usr != src) usr.put_in_active_hand(Vac) else - var/mob/living/L = input("Borrow Vac-Pack for") as null| mob in view(1,usr.loc) + var/mob/living/L = tgui_input_list(usr, "Borrow Vac-Pack for", "Swoopie", mobs_in_view(1, usr)) if(!L || L == usr) return L.put_in_active_hand(Vac) diff --git a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/vore.dm b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/vore.dm index 4e22288f9d..985af8d0a5 100644 --- a/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/vore.dm +++ b/modular_chomp/code/modules/mob/living/simple_mob/subtypes/vore/vore.dm @@ -17,8 +17,8 @@ to_chat(src, span_warning("You are immune to resizing!")) return - var/nagmessage = "Pick a size between 25 to 200%. (Only usable once!)" - var/new_size = input(nagmessage, "Pick a Size") as num|null + var/nagmessage = "Pick a size between [RESIZE_MINIMUM * 100] to [RESIZE_MAXIMUM * 100]%. (Only usable once!)" + var/new_size = tgui_input_number(src, nagmessage, "Pick a Size", size_multiplier*100, RESIZE_MAXIMUM * 100, RESIZE_MINIMUM * 100) if(size_range_check(new_size)) resize(new_size/100, uncapped = has_large_resize_bounds(), ignore_prefs = TRUE) picked_size = TRUE diff --git a/modular_chomp/code/modules/overmap/dynamic_sector.dm b/modular_chomp/code/modules/overmap/dynamic_sector.dm index c25db3893e..aecdda137d 100644 --- a/modular_chomp/code/modules/overmap/dynamic_sector.dm +++ b/modular_chomp/code/modules/overmap/dynamic_sector.dm @@ -186,14 +186,14 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null) desc = initial(desc) if(loaded) - var/confirm = alert(user, "Sever bluespace link? This location will become permanently inaccessible.", "Are you sure?", "No", "Yes") + var/confirm = tgui_alert(user, "Sever bluespace link? This location will become permanently inaccessible.", "Are you sure?", list("No", "Yes")) if(confirm == "Yes") if(is_empty(1)) // Dynamic POI's should only ever have 1 entry in map_z destroy_poi(user) // Delete POI from dynamic z-level else to_chat(user, "Unable to sever link. Location likely contains living realspace entities.") else - var/confirm = alert(user, "Transient subspace anomaly detected. Tether object to realspace?", "Stabilize anomaly?", "Yes", "No") + var/confirm = tgui_alert(user, "Transient subspace anomaly detected. Tether object to realspace?", "Stabilize anomaly?", list("Yes", "No")) if(confirm == "Yes") create_poi(user) // Load POI to dynamic z-level @@ -224,17 +224,16 @@ GLOBAL_VAR_INIT(dynamic_sector_master, null) map_sectors["[parent.map_z[i]]"] = src // Pass ownership of z-level to child, probably hacky and terribad, also mandatory for using forceMove() on shuttle landmarks break // Terminate loop if(!my_index) // No z-levels available - var/confirm = alert(user, "\[REDACTED\] matrix at capacity; a bluespace link must be permanently severed to stabilize this anomaly. Continue?", "Are you sure?", "No", "Yes") - if(confirm == "Yes") - my_index = parent.cull_child(user) - if(my_index) - parent.active_pois[my_index] = src - map_z[1] = parent.map_z[my_index] - map_sectors["[parent.map_z[my_index]]"] = src - else // Something went wrong, ideally due to all relevant z-levels containing players. - to_chat(user, "Unable to sever any bluespace link. All links likely contain living realspace entities.") - return - else + var/confirm = tgui_alert(user, "\[REDACTED\] matrix at capacity; a bluespace link must be permanently severed to stabilize this anomaly. Continue?", "Are you sure?", list("No", "Yes")) + if(confirm != "Yes") + return + my_index = parent.cull_child(user) + if(my_index) + parent.active_pois[my_index] = src + map_z[1] = parent.map_z[my_index] + map_sectors["[parent.map_z[my_index]]"] = src + else // Something went wrong, ideally due to all relevant z-levels containing players. + to_chat(user, "Unable to sever any bluespace link. All links likely contain living realspace entities.") return var/turf/T = locate(round(world.maxx/2), round(world.maxy/2), map_z[1]) // Find center turf, or near center for even-dimension maps. diff --git a/modular_chomp/code/modules/reagents/machinery/dispenser/chem_synthesizer_ch.dm b/modular_chomp/code/modules/reagents/machinery/dispenser/chem_synthesizer_ch.dm index 4054bb63e2..c3306c3762 100644 --- a/modular_chomp/code/modules/reagents/machinery/dispenser/chem_synthesizer_ch.dm +++ b/modular_chomp/code/modules/reagents/machinery/dispenser/chem_synthesizer_ch.dm @@ -341,7 +341,7 @@ queue -= queue[index] if("clear_queue") // Remove all entries from the queue except the currently processing recipe. - var/confirm = alert(usr, "Are you sure you want to clear the running queue?", "Confirm", "No", "Yes") + var/confirm = tgui_alert(usr, "Are you sure you want to clear the running queue?", "Confirm", list("No", "Yes")) if(confirm == "Yes") if(busy) // Oh no, I've broken code convention to remove all entries but the first. @@ -362,7 +362,7 @@ if("emergency_stop") // Stops everything if that's desirable for some reason. if(busy) - var/confirm = alert(usr, "Are you sure you want to stall the machine?", "Confirm", "Yes", "No") + var/confirm = tgui_alert(usr, "Are you sure you want to stall the machine?", "Confirm", list("Yes", "No")) if(confirm == "Yes") stalled = TRUE if("bottle_product") @@ -388,7 +388,7 @@ if("rem_recipe") // Allows the user to remove recipes while the machine is idle. if(!busy) - var/confirm = alert(usr, "Are you sure you want to remove this recipe?", "Confirm", "No", "Yes") + var/confirm = tgui_alert(usr, "Are you sure you want to remove this recipe?", "Confirm", list("No", "Yes")) if(confirm == "Yes") var/index = params["rm_index"] if(index in recipes) @@ -479,12 +479,12 @@ // This proc is lets users create recipes step-by-step and exports a comma delineated list to chat. It's intended to teach how to use the machine. /obj/machinery/chemical_synthesizer/proc/babystep_recipe(mob/user) - var/rec_name = sanitizeSafe(input(user, "Name your recipe. Consider including the output volume.", "Recipe naming", null) as text, MAX_NAME_LEN) + var/rec_name = sanitizeSafe(tgui_input_text(user, "Name your recipe. Consider including the output volume.", "Recipe naming")) if(!rec_name || (rec_name in recipes)) // Code requires each recipe to have a unique name. to_chat(user, "Please provide a unique recipe name!") return - var/steps = 2 * CLAMP(round(input(user, "How many steps does your recipe contain (16 max)?", "Steps", null) as num), 0, RECIPE_MAX_STEPS) // Round to get a whole integer, clamp to ensure proper range. + var/steps = 2 * tgui_input_number(user, "How many steps does your recipe contain (16 max)?", "Steps", 1, RECIPE_MAX_STEPS, 1) // Round to get a whole integer, clamp to ensure proper range. if(!steps) to_chat(user, "Please input a valid number of steps!") return @@ -496,7 +496,7 @@ to_chat(user, "Please select a chemical!") return new_rec[++new_rec.len] = label // Add the reagent ID. - var/amount = CLAMP(round(input(user, "How much of the chemical would you like to add?", "Volume", null) as num), 0, src.reagents.maximum_volume) + var/amount = tgui_input_number(user, "How much of the chemical would you like to add?", "Volume", 1, src.reagents.maximum_volume, 1) if(!amount) to_chat(user, "Please select a volume!") return @@ -509,12 +509,12 @@ // This proc allows users to copy-paste a comma delineated list to create a recipe. The recipe will cause a stall() if formatted incorrectly. /obj/machinery/chemical_synthesizer/proc/import_recipe(mob/user) - var/rec_name = sanitizeSafe(input(user, "Name your recipe. Consider including the output volume.", "Recipe naming", null) as text, MAX_NAME_LEN) + var/rec_name = sanitizeSafe(tgui_input_text(user, "Name your recipe. Consider including the output volume.", "Recipe naming", max_length=MAX_NAME_LEN), MAX_NAME_LEN) if(!rec_name || (rec_name in recipes)) // Code requires each recipe to have a unique name. to_chat(user, "Please provide a unique recipe name!") return - var/rec_input = input(user, "Input your recipe as 'Chem1,vol1,Chem2,vol2,...'", "Import recipe", null) + var/rec_input = tgui_input_text(user, "Input your recipe as 'Chem1,vol1,Chem2,vol2,...'", "Import recipe") if(!rec_input || (length(rec_input) > RECIPE_MAX_STRING) || !findtext(rec_input, ",")) // The smallest possible recipe will contain 1 comma. to_chat(user, "Invalid input or recipe max length exceeded!") return diff --git a/tools/IconSplitter/IconSplitter.dm b/tools/IconSplitter/IconSplitter.dm index cf7389aacd..dd2d5c6bce 100644 --- a/tools/IconSplitter/IconSplitter.dm +++ b/tools/IconSplitter/IconSplitter.dm @@ -32,7 +32,7 @@ obj var/user_input while(!user_input) - user_input = input(usr, "Enter the criteria for the icon_states you wish to be split. For example, doing _d_s will remove all rolled down jumpsuits.","Split Criteria", "") + user_input = tgui_input_text(usr, "Enter the criteria for the icon_states you wish to be split. For example, doing _d_s will remove all rolled down jumpsuits.","Split Criteria", "") to_world("Your split criteria is [user_input]") for(var/OriginalState in icon_states(DMIToSplit)) @@ -46,4 +46,4 @@ obj RunningOutput.Insert(ToAdd, OriginalState) usr << ftp(RunningOutput,"CutUpDmi.dmi") - usr << ftp(RunningOutputCut, "CutUpDmiWithCriteria.dmi") \ No newline at end of file + usr << ftp(RunningOutputCut, "CutUpDmiWithCriteria.dmi")