From 928a321b5f03403066792434b032212ea57c7309 Mon Sep 17 00:00:00 2001 From: Casey Date: Sat, 18 Jun 2022 23:58:15 -0400 Subject: [PATCH] TGUI Input Conversions --- .../components/binary_devices/passive_gate.dm | 4 +- .../components/binary_devices/pump.dm | 2 +- .../components/omni_devices/filter.dm | 2 +- .../components/omni_devices/mixer.dm | 4 +- code/ZAS/Variable Settings.dm | 6 +- code/_helpers/unsorted.dm | 4 +- code/_onclick/hud/movable_screen_objects.dm | 4 +- code/controllers/subsystems/game_master.dm | 4 +- code/controllers/subsystems/media_tracks.dm | 20 +- code/controllers/subsystems/supply.dm | 6 +- code/controllers/subsystems/vote.dm | 4 +- code/datums/datumvars.dm | 2 +- code/datums/managed_browsers/feedback_form.dm | 2 +- .../managed_browsers/feedback_viewer.dm | 14 +- code/datums/mind.dm | 10 +- code/datums/uplink/announcements.dm | 4 +- code/game/antagonist/antagonist_objectives.dm | 4 +- code/game/base_turf.dm | 2 +- .../gamemodes/events/holidays/Holidays.dm | 4 +- code/game/gamemodes/game_mode.dm | 8 +- .../newmalf_ability_trees/tree_networking.dm | 4 +- code/game/gamemodes/nuclear/pinpointer.dm | 6 +- code/game/gamemodes/objective.dm | 2 +- .../gamemodes/technomancer/spells/illusion.dm | 4 +- code/game/machinery/air_alarm.dm | 4 +- code/game/machinery/airconditioner_vr.dm | 2 +- code/game/machinery/atmoalter/canister.dm | 2 +- code/game/machinery/autolathe.dm | 2 +- code/game/machinery/camera/camera_assembly.dm | 4 +- code/game/machinery/computer/arcade.dm | 2 +- code/game/machinery/computer/card.dm | 2 +- code/game/machinery/computer/guestpass.dm | 6 +- code/game/machinery/computer/message.dm | 4 +- code/game/machinery/computer/prisoner.dm | 2 +- code/game/machinery/computer/supply.dm | 12 +- .../machinery/computer3/computers/card.dm | 2 +- code/game/machinery/gear_dispenser.dm | 2 +- code/game/machinery/jukebox.dm | 10 +- code/game/machinery/magnet.dm | 2 +- code/game/machinery/mass_driver.dm | 2 +- code/game/machinery/navbeacon.dm | 10 +- code/game/machinery/pointdefense.dm | 4 +- code/game/machinery/requests_console.dm | 6 +- code/game/machinery/telecomms/logbrowser.dm | 2 +- .../telecomms/machine_interactions.dm | 2 +- code/game/machinery/telecomms/telemonitor.dm | 8 +- .../machinery/telecomms/traffic_control.dm | 2 +- code/game/magic/archived_book.dm | 2 +- code/game/mecha/mecha_control_console.dm | 2 +- .../objects/effects/spawners/bombspawner.dm | 6 +- code/game/objects/explosion_recursive.dm | 2 +- code/game/objects/items/bodybag.dm | 2 +- .../items/devices/communicator/UI_tgui.dm | 6 +- .../items/devices/communicator/messaging.dm | 4 +- code/game/objects/items/devices/gps.dm | 2 +- code/game/objects/items/devices/megaphone.dm | 2 +- code/game/objects/items/devices/paicard.dm | 8 +- .../objects/items/devices/taperecorder.dm | 2 +- .../objects/items/devices/text_to_speech.dm | 2 +- code/game/objects/items/devices/tvcamera.dm | 2 +- code/game/objects/items/devices/whistle.dm | 2 +- code/game/objects/items/robot/robot_parts.dm | 2 +- code/game/objects/items/stacks/stack.dm | 2 +- code/game/objects/items/toys/toys.dm | 2 +- code/game/objects/items/weapons/AI_modules.dm | 10 +- .../circuitboards/computer/camera_monitor.dm | 2 +- code/game/objects/items/weapons/explosives.dm | 2 +- .../objects/items/weapons/implants/implant.dm | 2 +- .../items/weapons/implants/implantcase.dm | 2 +- code/modules/admin/DB ban/functions.dm | 4 +- code/modules/admin/ToRban.dm | 2 +- code/modules/admin/admin.dm | 18 +- code/modules/admin/admin_memo.dm | 2 +- code/modules/admin/admin_report.dm | 4 +- code/modules/admin/admin_verbs.dm | 18 +- code/modules/admin/admin_verbs_vr.dm | 6 +- code/modules/admin/callproc/callproc.dm | 6 +- code/modules/admin/news.dm | 6 +- .../secrets/admin_secrets/jump_shuttle.dm | 2 +- code/modules/admin/topic.dm | 48 +- code/modules/admin/verbs/adminhelp.dm | 2 +- code/modules/admin/verbs/adminjump.dm | 6 +- code/modules/admin/verbs/adminpm.dm | 8 +- code/modules/admin/verbs/buildmode.dm | 12 +- code/modules/admin/verbs/change_appearance.dm | 2 +- code/modules/admin/verbs/cinematic.dm | 2 +- code/modules/admin/verbs/debug.dm | 6 +- code/modules/admin/verbs/diagnostics.dm | 2 +- code/modules/admin/verbs/dice.dm | 4 +- code/modules/admin/verbs/fps.dm | 2 +- code/modules/admin/verbs/mapping.dm | 6 +- code/modules/admin/verbs/randomverbs.dm | 28 +- code/modules/admin/verbs/randomverbs_vr.dm | 4 +- code/modules/admin/verbs/resize.dm | 5 + code/modules/admin/verbs/striketeam.dm | 2 +- .../admin/view_variables/get_variables.dm | 10 +- code/modules/admin/view_variables/topic.dm | 2 +- code/modules/assembly/holder.dm | 2 +- code/modules/casino/casino.dm | 485 ++++++++ .../preference_setup/general/01_basic.dm | 4 +- .../preference_setup/general/02_language.dm | 2 +- .../preference_setup/general/03_body.dm | 2 +- .../preference_setup/general/06_flavor.dm | 10 +- .../client/preference_setup/global/01_ui.dm | 8 +- .../client/preference_setup/global/03_pai.dm | 6 +- .../volume_sliders/01_volume.dm | 2 +- .../volume_sliders/02_media.dm | 2 +- .../client/preference_setup/vore/02_size.dm | 6 +- .../client/preference_setup/vore/09_misc.dm | 2 +- code/modules/client/ui_style.dm | 2 +- .../clothing/under/miscellaneous_vr.dm | 2 +- code/modules/economy/Accounts_DB.dm | 4 +- code/modules/economy/EFTPOS.dm | 14 +- code/modules/economy/cash.dm | 2 +- code/modules/economy/cash_register.dm | 12 +- code/modules/economy/casinocash_ch.dm | 2 +- code/modules/economy/retail_scanner.dm | 12 +- code/modules/economy/vending.dm | 2 +- code/modules/events/event_manager.dm | 6 +- .../food/kitchen/smartfridge/smartfridge.dm | 2 +- code/modules/games/cards.dm | 4 +- code/modules/instruments/songs/editor.dm | 14 +- .../integrated_electronics/core/pins.dm | 2 +- .../core/special_pins/string_pin.dm | 2 +- .../integrated_electronics/core/tools.dm | 2 +- .../integrated_electronics/subtypes/input.dm | 2 +- .../integrated_electronics/subtypes/memory.dm | 4 +- code/modules/library/lib_items.dm | 4 +- code/modules/library/lib_machines.dm | 6 +- code/modules/mining/abandonedcrates.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 1021 +++++++++++++++++ code/modules/mob/living/carbon/human/emote.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 12 +- .../mob/living/carbon/human/human_powers.dm | 4 +- .../human/species/xenomorphs/alien_powers.dm | 2 +- code/modules/mob/living/living_vr.dm | 10 +- code/modules/mob/living/silicon/ai/ai.dm | 4 +- .../modules/mob/living/silicon/pai/recruit.dm | 6 +- code/modules/mob/living/silicon/silicon.dm | 4 +- code/modules/mob/mob_transformation_simple.dm | 2 +- code/modules/mob/say_vr.dm | 6 +- .../programs/generic/file_browser.dm | 2 +- .../programs/generic/news_browser.dm | 2 +- .../programs/generic/nttransfer.dm | 4 +- .../programs/generic/wordprocessor.dm | 6 +- .../programs/research/ntmonitor.dm | 4 +- .../programs/security/digitalwarrant.dm | 4 +- .../modular_computers/laptop_vendor.dm | 2 +- code/modules/news/new_newspaper.dm | 2 +- code/modules/news/newspaper.dm | 2 +- code/modules/nifsoft/nifsoft.dm | 2 +- .../nifsoft/software/13_soulcatcher.dm | 8 +- code/modules/nifsoft/software/15_misc.dm | 2 +- code/modules/overmap/champagne.dm | 2 +- .../overmap/disperser/disperser_console.dm | 6 +- .../overmap/ships/computers/engine_control.dm | 4 +- code/modules/overmap/ships/computers/helm.dm | 14 +- .../overmap/ships/computers/sensors.dm | 2 +- code/modules/paperwork/adminpaper.dm | 2 +- code/modules/paperwork/faxmachine.dm | 2 +- code/modules/paperwork/pen.dm | 2 +- code/modules/pda/core_apps.dm | 2 +- code/modules/pda/messenger.dm | 2 +- code/modules/pda/pda.dm | 2 +- code/modules/power/breaker_box.dm | 2 +- code/modules/power/cable.dm | 2 +- code/modules/power/fusion/core/_core.dm | 2 +- .../modules/power/fusion/core/core_control.dm | 2 +- .../fusion/fuel_assembly/fuel_control.dm | 2 +- .../fusion/fuel_assembly/fuel_injector.dm | 2 +- .../modules/power/fusion/gyrotron/gyrotron.dm | 2 +- .../power/fusion/gyrotron/gyrotron_control.dm | 2 +- code/modules/power/smes_construction.dm | 2 +- code/modules/power/turbine.dm | 4 +- code/modules/random_map/drop/droppod.dm | 2 +- code/modules/random_map/random_map_verbs.dm | 16 +- code/modules/reagents/machinery/distillery.dm | 2 +- code/modules/recycling/conveyor2.dm | 4 +- code/modules/recycling/sortingmachinery.dm | 4 +- code/modules/resleeving/designer.dm | 2 +- code/modules/shieldgen/shield_generator.dm | 4 +- code/modules/shuttles/shuttle_console.dm | 2 +- code/modules/shuttles/shuttles_web.dm | 2 +- code/modules/stockmarket/computer.dm | 4 +- code/modules/surgery/robotics.dm | 4 +- code/modules/telesci/gps_advanced.dm | 2 +- .../tgui/modules/admin/player_notes.dm | 326 ++++++ code/modules/tgui/modules/agentcard.dm | 8 +- code/modules/tgui/modules/communications.dm | 8 +- code/modules/tgui/modules/gyrotron_control.dm | 2 +- code/modules/tgui/modules/overmap.dm | 20 +- code/modules/tgui/modules/rustcore_monitor.dm | 2 +- code/modules/tgui/modules/rustfuel_control.dm | 2 +- code/modules/virus2/admin.dm | 10 +- code/modules/vore/eating/vorepanel_vr.dm | 86 +- code/modules/vore/resizing/resize_vr.dm | 2 +- code/modules/vore/resizing/sizegun_vr.dm | 4 +- code/modules/xenoarcheaology/finds/fossils.dm | 2 +- .../xenoarcheaology/tools/tools_pickaxe.dm | 2 +- .../xenobio2/mob/slime/slime_monkey.dm | 2 +- .../species/station/protean/protean_powers.dm | 2 +- 201 files changed, 2350 insertions(+), 491 deletions(-) create mode 100644 code/modules/casino/casino.dm create mode 100644 code/modules/tgui/modules/admin/player_notes.dm diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 7b8b7155f6..686efa6508 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -261,7 +261,7 @@ if("max") target_pressure = max_pressure_setting if("set") - var/new_pressure = input(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure Control",src.target_pressure) as num + var/new_pressure = tgui_input_number(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure Control",src.target_pressure,max_pressure_setting,0) src.target_pressure = between(0, new_pressure, max_pressure_setting) if("set_flow_rate") @@ -272,7 +272,7 @@ if("max") set_flow_rate = air1.volume if("set") - var/new_flow_rate = input(usr,"Enter new flow rate limit (0-[air1.volume]L/s)","Flow Rate Control",src.set_flow_rate) as num + var/new_flow_rate = tgui_input_number(usr,"Enter new flow rate limit (0-[air1.volume]L/s)","Flow Rate Control",src.set_flow_rate,air1.volume,0) src.set_flow_rate = between(0, new_flow_rate, air1.volume) update_icon() diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 665d912b00..514216e7fa 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -225,7 +225,7 @@ Thus, the two variables affect pump operation are set in New(): if("max") target_pressure = max_pressure_setting if("set") - var/new_pressure = input(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure control",src.target_pressure) as num + var/new_pressure = tgui_input_number(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure control",src.target_pressure,max_pressure_setting,0) src.target_pressure = between(0, new_pressure, max_pressure_setting) . = TRUE diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm index dae4648790..1b51693389 100644 --- a/code/ATMOSPHERICS/components/omni_devices/filter.dm +++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm @@ -170,7 +170,7 @@ if("set_flow_rate") if(!configuring || use_power) return - var/new_flow_rate = input(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate) as num + var/new_flow_rate = tgui_input_number(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate,max_flow_rate,0) set_flow_rate = between(0, new_flow_rate, max_flow_rate) . = TRUE if("switch_mode") diff --git a/code/ATMOSPHERICS/components/omni_devices/mixer.dm b/code/ATMOSPHERICS/components/omni_devices/mixer.dm index 077be63b30..3487482be3 100644 --- a/code/ATMOSPHERICS/components/omni_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/omni_devices/mixer.dm @@ -183,7 +183,7 @@ . = TRUE if(!configuring || use_power) return - var/new_flow_rate = input(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate) as num + var/new_flow_rate = tgui_input_number(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate,max_flow_rate,0) set_flow_rate = between(0, new_flow_rate, max_flow_rate) if("switch_mode") . = TRUE @@ -265,7 +265,7 @@ if(non_locked < 1) return - var/new_con = (input(usr,"Enter a new concentration (0-[round(remain_con * 100, 0.5)])%","Concentration control", min(remain_con, old_con)*100) as num) / 100 + var/new_con = (tgui_input_number(usr,"Enter a new concentration (0-[round(remain_con * 100, 0.5)])%","Concentration control", min(remain_con, old_con)*100, round(remain_con * 100, 0.5), 0)) / 100 //cap it between 0 and the max remaining concentration new_con = between(0, new_con, remain_con) diff --git a/code/ZAS/Variable Settings.dm b/code/ZAS/Variable Settings.dm index 067fc6d1d8..c4643632dc 100644 --- a/code/ZAS/Variable Settings.dm +++ b/code/ZAS/Variable Settings.dm @@ -147,7 +147,7 @@ var/global/vs_control/vsc = new var/newvar = vw switch(how) if("Numeric") - newvar = input(user,"Enter a number:","Settings",newvar) as num + newvar = tgui_input_number(user,"Enter a number:","Settings",newvar) if("Bit Flag") var/flag = tgui_input_list(user,"Toggle which bit?","Settings", bitflags) flag = text2num(flag) @@ -158,9 +158,9 @@ var/global/vs_control/vsc = new if("Toggle") newvar = !newvar if("Text") - newvar = input(user,"Enter a string:","Settings",newvar) as text + newvar = tgui_input_text(user,"Enter a string:","Settings",newvar) if("Long Text") - newvar = input(user,"Enter text:","Settings",newvar) as message + newvar = tgui_input_text(user,"Enter text:","Settings",newvar, multiline = TRUE) vw = newvar if(ch in plc.settings) plc.vars[ch] = vw diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index c8bce2d2f9..c1d5cbcaef 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -344,7 +344,7 @@ Turf and target are seperate in case you want to teleport some distance from a t var/newname for(var/i=1,i<=3,i++) //we get 3 attempts to pick a suitable name. - newname = input(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname) as text + newname = tgui_input_text(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname) 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. @@ -1357,7 +1357,7 @@ var/mob/dview/dview_mob = new /proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) if (value == FALSE) //nothing should be calling us with a number, so this is safe - value = input(usr, "Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text + value = tgui_input_text(usr, "Enter type to find (blank for all, cancel to cancel)", "Search for type") if (isnull(value)) return value = trim(value) diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index 40e5977c83..39d36738aa 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -114,7 +114,7 @@ M.maptext = "Movable" M.maptext_width = 64 - var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") as text + var/screen_l = tgui_input_text(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") if(!screen_l) return @@ -133,7 +133,7 @@ S.maptext = "Snap" S.maptext_width = 64 - var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") as text + var/screen_l = tgui_input_text(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") if(!screen_l) return diff --git a/code/controllers/subsystems/game_master.dm b/code/controllers/subsystems/game_master.dm index 3ac815c5d9..88a0ed6b16 100644 --- a/code/controllers/subsystems/game_master.dm +++ b/code/controllers/subsystems/game_master.dm @@ -352,13 +352,13 @@ SUBSYSTEM_DEF(game_master) choose_game_master(usr) if(href_list["set_staleness"]) - var/amount = input(usr, "How much staleness should there be?", "Game Master") as null|num + var/amount = tgui_input_number(usr, "How much staleness should there be?", "Game Master") if(!isnull(amount)) staleness = amount message_admins("GM staleness was set to [amount] by [usr.key].") if(href_list["set_danger"]) - var/amount = input(usr, "How much danger should there be?", "Game Master") as null|num + var/amount = tgui_input_number(usr, "How much danger should there be?", "Game Master") if(!isnull(amount)) danger = amount message_admins("GM danger was set to [amount] by [usr.key].") diff --git a/code/controllers/subsystems/media_tracks.dm b/code/controllers/subsystems/media_tracks.dm index d85e4baa9e..c1408de08e 100644 --- a/code/controllers/subsystems/media_tracks.dm +++ b/code/controllers/subsystems/media_tracks.dm @@ -88,7 +88,7 @@ SUBSYSTEM_DEF(media_tracks) return // Required - var/url = input(C, "REQUIRED: Provide URL for track, or paste JSON if you know what you're doing. See code comments.", "Track URL") as message|null + var/url = tgui_input_text(C, "REQUIRED: Provide URL for track, or paste JSON if you know what you're doing. See code comments.", "Track URL", multiline = TRUE) if(!url) return @@ -126,21 +126,35 @@ SUBSYSTEM_DEF(media_tracks) report_progress("New media track added by [C]: [T.title]") sort_tracks() return +<<<<<<< HEAD var/title = input(C, "REQUIRED: Provide title for track", "Track Title") as text|null if(!title) return var/duration = input(C, "REQUIRED: Provide duration for track (in deciseconds, aka seconds*10)", "Track Duration") as num|null +======= + + var/title = tgui_input_text(C, "REQUIRED: Provide title for track", "Track Title") + if(!title) + return + + var/duration = tgui_input_number(C, "REQUIRED: Provide duration for track (in deciseconds, aka seconds*10)", "Track Duration") +>>>>>>> b875945450... Merge pull request #13112 from ItsSelis/tgui-input-conversions if(!duration) return // Optional - var/artist = input(C, "Optional: Provide artist for track", "Track Artist") as text|null + var/artist = tgui_input_text(C, "Optional: Provide artist for track", "Track Artist") if(isnull(artist)) // Cancel rather than empty string return +<<<<<<< HEAD var/genre = input(C, "Optional: Provide genre for track (try to match an existing one)", "Track Genre") as text|null +======= + + var/genre = tgui_input_text(C, "Optional: Provide genre for track (try to match an existing one)", "Track Genre") +>>>>>>> b875945450... Merge pull request #13112 from ItsSelis/tgui-input-conversions if(isnull(genre)) // Cancel rather than empty string return @@ -188,7 +202,7 @@ SUBSYSTEM_DEF(media_tracks) if(!check_rights(R_DEBUG|R_FUN)) return - var/track = input(C, "Input track title or URL to remove (must be exact)", "Remove Track") as text|null + var/track = tgui_input_text(C, "Input track title or URL to remove (must be exact)", "Remove Track") if(!track) return diff --git a/code/controllers/subsystems/supply.dm b/code/controllers/subsystems/supply.dm index af096c33a8..c30d559e4b 100644 --- a/code/controllers/subsystems/supply.dm +++ b/code/controllers/subsystems/supply.dm @@ -363,15 +363,15 @@ SUBSYSTEM_DEF(supply) // Will add an item entry to the specified export receipt on the user-side list /datum/controller/subsystem/supply/proc/add_export_item(var/datum/exported_crate/E, var/mob/user) - var/new_name = input(user, "Name", "Please enter the name of the item.") as null|text + var/new_name = tgui_input_text(user, "Name", "Please enter the name of the item.") if(!new_name) return - var/new_quantity = input(user, "Name", "Please enter the quantity of the item.") as null|num + var/new_quantity = tgui_input_number(user, "Name", "Please enter the quantity of the item.") if(!new_quantity) return - var/new_value = input(user, "Name", "Please enter the value of the item.") as null|num + var/new_value = tgui_input_number(user, "Name", "Please enter the value of the item.") if(!new_value) return diff --git a/code/controllers/subsystems/vote.dm b/code/controllers/subsystems/vote.dm index c1e4288869..44076a407b 100644 --- a/code/controllers/subsystems/vote.dm +++ b/code/controllers/subsystems/vote.dm @@ -244,11 +244,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/datumvars.dm b/code/datums/datumvars.dm index 75c3c64c7f..8da8bab272 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -68,7 +68,7 @@ names += componentsubtypes names += "---Elements---" names += sortTim(subtypesof(/datum/element), /proc/cmp_typepaths_asc) - var/result = input(usr, "Choose a component/element to add:", "Add Component/Element", names) + var/result = tgui_input_text(usr, "Choose a component/element to add:", "Add Component/Element", names) if(!usr || !result || result == "---Components---" || result == "---Elements---") return if(QDELETED(src)) diff --git a/code/datums/managed_browsers/feedback_form.dm b/code/datums/managed_browsers/feedback_form.dm index b380018bea..da7a028240 100644 --- a/code/datums/managed_browsers/feedback_form.dm +++ b/code/datums/managed_browsers/feedback_form.dm @@ -99,7 +99,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form) if(href_list["feedback_edit_body"]) // This is deliberately not sanitized here, and is instead checked when hitting the submission button, // as we want to give the user a chance to fix it without needing to rewrite the whole thing. - feedback_body = input(my_client, "Please write your feedback here.", "Feedback Body", feedback_body) as null|message + feedback_body = tgui_input_text(my_client, "Please write your feedback here.", "Feedback Body", feedback_body, multiline = TRUE) display() // Refresh the window with new information. return diff --git a/code/datums/managed_browsers/feedback_viewer.dm b/code/datums/managed_browsers/feedback_viewer.dm index 895bd36fae..0236036338 100644 --- a/code/datums/managed_browsers/feedback_viewer.dm +++ b/code/datums/managed_browsers/feedback_viewer.dm @@ -132,29 +132,29 @@ return if(href_list["filter_id"]) - var/id_to_search = input(my_client, "Write feedback ID here.", "Filter by ID", null) as null|num + var/id_to_search = tgui_input_number(my_client, "Write feedback ID here.", "Filter by ID", null) if(id_to_search) last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_ID, id_to_search, TRUE) if(href_list["filter_author"]) - var/author_to_search = input(my_client, "Write desired key or hash here. Partial keys/hashes are allowed.", "Filter by Author", null) as null|text + var/author_to_search = tgui_input_text(my_client, "Write desired key or hash here. Partial keys/hashes are allowed.", "Filter by Author", null) if(author_to_search) last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_AUTHOR, author_to_search) if(href_list["filter_topic"]) - var/topic_to_search = input(my_client, "Write desired topic here. Partial topics are allowed. \ - \nThe current topics in the config are [english_list(config.sqlite_feedback_topics)].", "Filter by Topic", null) as null|text + var/topic_to_search = tgui_input_text(my_client, "Write desired topic here. Partial topics are allowed. \ + \nThe current topics in the config are [english_list(config.sqlite_feedback_topics)].", "Filter by Topic", null) if(topic_to_search) last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_TOPIC, topic_to_search) if(href_list["filter_content"]) - var/content_to_search = input(my_client, "Write desired content to find here. Partial matches are allowed.", "Filter by Content", null) as null|message + var/content_to_search = tgui_input_text(my_client, "Write desired content to find here. Partial matches are allowed.", "Filter by Content", null, multiline = TRUE) if(content_to_search) last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_CONTENT, content_to_search) if(href_list["filter_datetime"]) - var/datetime_to_search = input(my_client, "Write desired datetime. Partial matches are allowed.\n\ - Format is 'YYYY-MM-DD HH:MM:SS'.", "Filter by Datetime", null) as null|text + var/datetime_to_search = tgui_input_text(my_client, "Write desired datetime. Partial matches are allowed.\n\ + Format is 'YYYY-MM-DD HH:MM:SS'.", "Filter by Datetime", null) if(datetime_to_search) last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_DATETIME, datetime_to_search) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 736fdff021..34b4105e86 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -190,7 +190,7 @@ assigned_role = new_role else if (href_list["memory_edit"]) - var/new_memo = sanitize(input("Write new memory", "Memory", memory) as null|message) + var/new_memo = sanitize(tgui_input_text("Write new memory", "Memory", memory, multiline = TRUE)) if (isnull(new_memo)) return memory = new_memo @@ -198,7 +198,7 @@ var/datum/mind/mind = locate(href_list["amb_edit"]) if(!mind) return - var/new_ambition = input("Enter a new ambition", "Memory", mind.ambitions) as null|message + var/new_ambition = tgui_input_text("Enter a new ambition", "Memory", mind.ambitions, multiline = TRUE) if(isnull(new_ambition)) return if(mind) @@ -296,7 +296,7 @@ if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]")) def_num = objective.target_amount - var/target_number = input("Input target number:", "Objective", def_num) as num|null + var/target_number = tgui_input_number("Input target number:", "Objective", def_num) if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist. return @@ -314,7 +314,7 @@ new_objective.target_amount = target_number if ("custom") - var/expl = sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null) + var/expl = sanitize(tgui_input_text("Custom objective:", "Objective", objective ? objective.explanation_text : "")) if (!expl) return new_objective = new /datum/objective new_objective.owner = src @@ -410,7 +410,7 @@ // var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() No longer needed, uses stored in mind var/crystals crystals = tcrystals - crystals = input("Amount of telecrystals for [key]", crystals) as null|num + crystals = tgui_input_number("Amount of telecrystals for [key]", crystals) if (!isnull(crystals)) tcrystals = crystals diff --git a/code/datums/uplink/announcements.dm b/code/datums/uplink/announcements.dm index f1db67a647..f6742fb815 100644 --- a/code/datums/uplink/announcements.dm +++ b/code/datums/uplink/announcements.dm @@ -16,10 +16,10 @@ item_cost = 20 /datum/uplink_item/abstract/announcements/fake_centcom/extra_args(var/mob/user) - var/title = sanitize(input(usr, "Enter your announcement title.", "Announcement Title") as null|text) + var/title = sanitize(tgui_input_text(usr, "Enter your announcement title.", "Announcement Title")) if(!title) return - var/message = sanitize(input(usr, "Enter your announcement message.", "Announcement Title") as null|text) + var/message = sanitize(tgui_input_text(usr, "Enter your announcement message.", "Announcement Title")) if(!message) return return list("title" = title, "message" = message) diff --git a/code/game/antagonist/antagonist_objectives.dm b/code/game/antagonist/antagonist_objectives.dm index c2c56c7be1..223db7dda8 100644 --- a/code/game/antagonist/antagonist_objectives.dm +++ b/code/game/antagonist/antagonist_objectives.dm @@ -41,9 +41,9 @@ to_chat(src, "While you may perhaps have goals, this verb's meant to only be visible \ to antagonists. Please make a bug report!") return - var/new_ambitions = input(src, "Write a short sentence of what your character hopes to accomplish \ + var/new_ambitions = tgui_input_text(src, "Write a short sentence of what your character hopes to accomplish \ today as an antagonist. Remember that this is purely optional. It will be shown at the end of the \ - round for everybody else.", "Ambitions", mind.ambitions) as null|message + round for everybody else.", "Ambitions", mind.ambitions, multiline = TRUE) if(isnull(new_ambitions)) return new_ambitions = sanitize(new_ambitions) diff --git a/code/game/base_turf.dm b/code/game/base_turf.dm index 3f78c6fba4..238015d6ed 100644 --- a/code/game/base_turf.dm +++ b/code/game/base_turf.dm @@ -19,7 +19,7 @@ if(!holder) return - var/choice = input(usr, "Which Z-level do you wish to set the base turf for?") as num|null + var/choice = tgui_input_number(usr, "Which Z-level do you wish to set the base turf for?") if(!choice) return diff --git a/code/game/gamemodes/events/holidays/Holidays.dm b/code/game/gamemodes/events/holidays/Holidays.dm index 4955aa2559..b5f836e599 100644 --- a/code/game/gamemodes/events/holidays/Holidays.dm +++ b/code/game/gamemodes/events/holidays/Holidays.dm @@ -214,8 +214,8 @@ var/global/list/Holiday = list() //Holidays are lists now, so we can have more t Holiday = list() - var/H = input(src,"What holiday is it today?","Set Holiday") as text - var/B = input(src,"Now explain what the holiday is about","Set Holiday") as message + var/H = tgui_input_text(src,"What holiday is it today?","Set Holiday") + var/B = tgui_input_text(src,"Now explain what the holiday is about","Set Holiday", multiline = TRUE) Holiday[H] = B diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 7201142678..0099cf6ffd 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -59,23 +59,23 @@ var/global/list/additional_antag_types = list() var/choice = "" switch(href_list["set"]) if("shuttle_delay") - choice = input(usr, "Enter a new shuttle delay multiplier") as num + choice = tgui_input_number(usr, "Enter a new shuttle delay multiplier", null, null, 20, 1) if(!choice || choice < 1 || choice > 20) return shuttle_delay = choice if("antag_scaling") - choice = input(usr, "Enter a new antagonist cap scaling coefficient.") as num + choice = tgui_input_number(usr, "Enter a new antagonist cap scaling coefficient.", null, null, 100, 0) if(isnull(choice) || choice < 0 || choice > 100) return antag_scaling_coeff = choice if("event_modifier_moderate") - choice = input(usr, "Enter a new moderate event time modifier.") as num + choice = tgui_input_number(usr, "Enter a new moderate event time modifier.", null, null, 100, 0) if(isnull(choice) || choice < 0 || choice > 100) return event_delay_mod_moderate = choice refresh_event_modifiers() if("event_modifier_severe") - choice = input(usr, "Enter a new moderate event time modifier.") as num + choice = tgui_input_number(usr, "Enter a new moderate event time modifier.", null, null, 100, 0) if(isnull(choice) || choice < 0 || choice > 100) return event_delay_mod_major = choice diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm index d8229e1562..2ee412194e 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm @@ -93,8 +93,8 @@ if(!ability_prechecks(user, price)) return - var/title = input(usr, "Select message title: ") - var/text = input(usr, "Select message text: ") + var/title = tgui_input_text(usr, "Select message title: ") + var/text = tgui_input_text(usr, "Select message text: ") if(!title || !text || !ability_pay(user, price)) to_chat(user, "Hack Aborted") return diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index aec6442f8d..7c51611bf2 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -124,10 +124,10 @@ if("Location") mode = 1 - var/locationx = input(usr, "Please input the x coordinate to search for.", "Location?" , "") as num + var/locationx = tgui_input_number(usr, "Please input the x coordinate to search for.", "Location?" , "") if(!locationx || !(usr in view(1,src))) return - var/locationy = input(usr, "Please input the y coordinate to search for.", "Location?" , "") as num + var/locationy = tgui_input_number(usr, "Please input the y coordinate to search for.", "Location?" , "") if(!locationy || !(usr in view(1,src))) return @@ -160,7 +160,7 @@ to_chat(usr, "You set the pinpointer to locate [targetitem]") if("DNA") - var/DNAstring = input(usr, "Input DNA string to search for." , "Please Enter String." , "") + var/DNAstring = tgui_input_text(usr, "Input DNA string to search for." , "Please Enter String." , "") if(!DNAstring) return for(var/mob/living/carbon/M in mob_list) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 9e4e554426..2ab94983f5 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -481,7 +481,7 @@ var/global/list/all_objectives = list() var/tmp_obj = new custom_target var/custom_name = tmp_obj:name qdel(tmp_obj) - custom_name = sanitize(input(usr, "Enter target name:", "Objective target", custom_name) as text|null) + custom_name = sanitize(tgui_input_text(usr, "Enter target name:", "Objective target", custom_name)) if (!custom_name) return target_name = custom_name steal_target = custom_target diff --git a/code/game/gamemodes/technomancer/spells/illusion.dm b/code/game/gamemodes/technomancer/spells/illusion.dm index dcadf53ffb..ab83319bc5 100644 --- a/code/game/gamemodes/technomancer/spells/illusion.dm +++ b/code/game/gamemodes/technomancer/spells/illusion.dm @@ -49,12 +49,12 @@ if("Cancel") return if("Speak") - var/what_to_say = input(user, "What do you want \the [illusion] to say?","Illusion Speak") as null|text + var/what_to_say = tgui_input_text(user, "What do you want \the [illusion] to say?","Illusion Speak") //what_to_say = sanitize(what_to_say) //Sanitize occurs inside say() already. if(what_to_say) illusion.say(what_to_say) if("Emote") - var/what_to_emote = input(user, "What do you want \the [illusion] to do?","Illusion Emote") as null|text + var/what_to_emote = tgui_input_text(user, "What do you want \the [illusion] to do?","Illusion Emote") if(what_to_emote) illusion.emote(what_to_emote) diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index dd653d746a..ca40f0dc53 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -675,7 +675,7 @@ var/list/selected = TLV["temperature"] var/max_temperature = min(selected[3] - T0C, MAX_TEMPERATURE) var/min_temperature = max(selected[2] - T0C, MIN_TEMPERATURE) - var/input_temperature = input(usr, "What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C) as num|null + var/input_temperature = tgui_input_number(usr, "What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C, max_temperature, min_temperature) if(isnum(input_temperature)) if(input_temperature > max_temperature || input_temperature < min_temperature) to_chat(usr, "Temperature must be between [min_temperature]C and [max_temperature]C") @@ -729,7 +729,7 @@ var/env = params["env"] var/name = params["var"] - var/value = input(usr, "New [name] for [env]:", name, TLV[env][name]) as num|null + var/value = tgui_input_number(usr, "New [name] for [env]:", name, TLV[env][name]) if(!isnull(value) && !..()) if(value < 0) TLV[env][name] = -1 diff --git a/code/game/machinery/airconditioner_vr.dm b/code/game/machinery/airconditioner_vr.dm index f9a1437041..364d4bf377 100644 --- a/code/game/machinery/airconditioner_vr.dm +++ b/code/game/machinery/airconditioner_vr.dm @@ -47,7 +47,7 @@ turn_off() return if(istype(I, /obj/item/device/multitool)) - var/new_temp = input(usr, "Input a new target temperature, in degrees C.","Target Temperature", 20) as num + var/new_temp = tgui_input_number(usr, "Input a new target temperature, in degrees C.","Target Temperature", 20) if(!Adjacent(user) || user.incapacitated()) return new_temp = convert_c2k(new_temp) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 783ee16225..cb11dce0b5 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -332,7 +332,7 @@ update_flag pressure = 10*ONE_ATMOSPHERE . = TRUE else if(pressure == "input") - pressure = input(usr, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure) as num|null + pressure = tgui_input_number(usr, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure, 10*ONE_ATMOSPHERE, ONE_ATMOSPHERE/10) if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index bc8a8081d0..3e8cf00207 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -176,7 +176,7 @@ if(!isnull(materials.get_material_amount(material)) && materials.get_material_amount(material) < round(making.resources[material] * coeff)) max_sheets = 0 //Build list of multipliers for sheets. - multiplier = input(usr, "How many do you want to print? (0-[max_sheets])") as num|null + multiplier = tgui_input_number(usr, "How many do you want to print? (0-[max_sheets])", null, null, max_sheets, 0) if(!multiplier || multiplier <= 0 || multiplier > max_sheets || tgui_status(usr, state) != STATUS_INTERACTIVE) return FALSE diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 0660bff759..a73eb6fe91 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -80,7 +80,7 @@ if(W.is_screwdriver()) playsound(src, W.usesound, 50, 1) - var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT)) + var/input = sanitize(tgui_input_text(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT)) if(!input) to_chat(usr, "No input found please hang up and try your call again.") return @@ -92,7 +92,7 @@ var/area/camera_area = get_area(src) var/temptag = "[sanitize(camera_area.name)] ([rand(1, 999)])" - input = sanitizeSafe(input(usr, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag), MAX_NAME_LEN) + input = sanitizeSafe(tgui_input_text(usr, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag), MAX_NAME_LEN) state = 4 var/obj/machinery/camera/C = new(src.loc) diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 7836b0bdf7..7def7f8b8e 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -1182,7 +1182,7 @@ // Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is // empty at high security levels if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) - var/attempt_pin = input(usr, "Enter pin code", "Vendor transaction") as num + var/attempt_pin = tgui_input_number(usr, "Enter pin code", "Vendor transaction") customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2) if(!customer_account) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index c15a9d1524..75b860330d 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -205,7 +205,7 @@ if(is_authenticated() && modify) var/t1 = params["assign_target"] if(t1 == "Custom") - var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment"), 45) + var/temp_t = sanitize(tgui_input_text(usr, "Enter a custom job assignment.","Assignment"), 45) //let custom jobs function as an impromptu alt title, mainly for sechuds if(temp_t && modify) modify.assignment = temp_t diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm index ed37a18c41..dd2644f794 100644 --- a/code/game/machinery/computer/guestpass.dm +++ b/code/game/machinery/computer/guestpass.dm @@ -170,15 +170,15 @@ mode = params["mode"] if("giv_name") - var/nam = sanitizeName(input(usr, "Person pass is issued to", "Name", giv_name) as text|null) + var/nam = sanitizeName(tgui_input_text(usr, "Person pass is issued to", "Name", giv_name)) if(nam) giv_name = nam if("reason") - var/reas = sanitize(input(usr, "Reason why pass is issued", "Reason", reason) as text|null) + var/reas = sanitize(tgui_input_text(usr, "Reason why pass is issued", "Reason", reason)) if(reas) reason = reas if("duration") - var/dur = input(usr, "Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration") as num|null //VOREStation Edit + var/dur = tgui_input_number(usr, "Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration", null, 360, 0) if(dur) if(dur > 0 && dur <= 360) //VOREStation Edit duration = dur diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 5962f9aa8f..ec5a1f5fcd 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -243,7 +243,7 @@ . = TRUE //Change the password - KEY REQUIRED if("pass") - var/dkey = trim(input(usr, "Please enter the current decryption key.") as text|null) + var/dkey = trim(tgui_input_text(usr, "Please enter the current decryption key.")) if(dkey && dkey != "") if(linkedServer.decryptkey == dkey) var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):")) @@ -325,7 +325,7 @@ . = TRUE if("addtoken") - linkedServer.spamfilter += input(usr,"Enter text you want to be filtered out","Token creation") as text|null + linkedServer.spamfilter += tgui_input_text(usr,"Enter text you want to be filtered out","Token creation") . = TRUE if("deltoken") diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index ac4868bc17..ceae88e54d 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -82,7 +82,7 @@ to_chat(usr, "Unauthorized Access.") . = TRUE if("warn") - var/warning = sanitize(input(usr, "Message:", "Enter your message here!", "")) + var/warning = sanitize(tgui_input_text(usr, "Message:", "Enter your message here!", "")) if(!warning) return var/obj/item/weapon/implant/I = locate(params["imp"]) diff --git a/code/game/machinery/computer/supply.dm b/code/game/machinery/computer/supply.dm index e805e151bd..ce345e429e 100644 --- a/code/game/machinery/computer/supply.dm +++ b/code/game/machinery/computer/supply.dm @@ -221,12 +221,12 @@ visible_message("[src]'s monitor flashes, \"[reqtime - world.time] seconds remaining until another requisition form may be printed.\"") return FALSE - var/amount = clamp(input(usr, "How many crates? (0 to 20)") as num|null, 0, 20) + var/amount = clamp(tgui_input_number(usr, "How many crates? (0 to 20)", null, null, 20, 0), 0, 20) if(!amount) return FALSE var/timeout = world.time + 600 - var/reason = sanitize(input(usr, "Reason:","Why do you require this item?","") as null|text) + var/reason = sanitize(tgui_input_text(usr, "Reason:","Why do you require this item?","")) if(world.time > timeout) to_chat(usr, "Error. Request timed out.") return FALSE @@ -280,7 +280,7 @@ return FALSE var/timeout = world.time + 600 - var/reason = sanitize(input(usr, "Reason:","Why do you require this item?","") as null|text) + var/reason = sanitize(tgui_input_text(usr, "Reason:","Why do you require this item?","")) if(world.time > timeout) to_chat(usr, "Error. Request timed out.") return FALSE @@ -323,7 +323,7 @@ return FALSE if(!(authorization & SUP_ACCEPT_ORDERS)) return FALSE - var/new_val = sanitize(input(usr, params["edit"], "Enter the new value for this field:", params["default"]) as null|text) + var/new_val = sanitize(tgui_input_text(usr, params["edit"], "Enter the new value for this field:", params["default"])) if(!new_val) return FALSE @@ -396,7 +396,7 @@ var/list/L = E.contents[params["index"]] var/field = tgui_alert(usr, "Select which field to edit", "Field Choice", list("Name", "Quantity", "Value")) - var/new_val = sanitize(input(usr, field, "Enter the new value for this field:", L[lowertext(field)]) as null|text) + var/new_val = sanitize(tgui_input_text(usr, field, "Enter the new value for this field:", L[lowertext(field)])) if(!new_val) return @@ -439,7 +439,7 @@ return FALSE if(!(authorization & SUP_ACCEPT_ORDERS)) return FALSE - var/new_val = sanitize(input(usr, params["edit"], "Enter the new value for this field:", params["default"]) as null|text) + var/new_val = sanitize(tgui_input_text(usr, params["edit"], "Enter the new value for this field:", params["default"])) if(!new_val) return diff --git a/code/game/machinery/computer3/computers/card.dm b/code/game/machinery/computer3/computers/card.dm index d2f6074c78..7412f6b464 100644 --- a/code/game/machinery/computer3/computers/card.dm +++ b/code/game/machinery/computer3/computers/card.dm @@ -305,7 +305,7 @@ if(auth) var/t1 = href_list["assign"] if(t1 == "Custom") - var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment")) + var/temp_t = sanitize(tgui_input_text(usr, "Enter a custom job assignment.","Assignment")) if(temp_t) t1 = temp_t set_default_access(t1) diff --git a/code/game/machinery/gear_dispenser.dm b/code/game/machinery/gear_dispenser.dm index 1a11c26023..d08bb9c774 100644 --- a/code/game/machinery/gear_dispenser.dm +++ b/code/game/machinery/gear_dispenser.dm @@ -693,7 +693,7 @@ var/list/dispenser_presets = list() * "gearlist" = array of types (yes the types are not valid json, byond parses them into real types.) * "req_one_access" = array of numbers (accesses) */ - var/input = input(usr, "Paste new gear pack JSON below. See example/code comments.", "Admin-load Dispenser", example) as null|message + var/input = tgui_input_text(usr, "Paste new gear pack JSON below. See example/code comments.", "Admin-load Dispenser", example, multiline = TRUE) if(!input) return diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm index 955b99009a..0e184683ec 100644 --- a/code/game/machinery/jukebox.dm +++ b/code/game/machinery/jukebox.dm @@ -401,20 +401,20 @@ return // Required - var/url = input(C, "REQUIRED: Provide URL for track", "Track URL") as text|null + var/url = tgui_input_text(C, "REQUIRED: Provide URL for track", "Track URL") if(!url) return - var/title = input(C, "REQUIRED: Provide title for track", "Track Title") as text|null + var/title = tgui_input_text(C, "REQUIRED: Provide title for track", "Track Title") if(!title) return - var/duration = input(C, "REQUIRED: Provide duration for track (in deciseconds, aka seconds*10)", "Track Duration") as num|null + var/duration = tgui_input_number(C, "REQUIRED: Provide duration for track (in deciseconds, aka seconds*10)", "Track Duration") if(!duration) return // Optional - var/artist = input(C, "Optional: Provide artist for track", "Track Artist") as text|null + var/artist = tgui_input_text(C, "Optional: Provide artist for track", "Track Artist") if(isnull(artist)) // Cancel rather than empty string return @@ -428,7 +428,7 @@ if(!check_rights(R_FUN|R_ADMIN)) return - var/track = input(C, "Input track title or URL to remove (must be exact)", "Remove Track") as text|null + var/track = tgui_input_text(C, "Input track title or URL to remove (must be exact)", "Remove Track") if(!track) return diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index f713cea2d0..e2b76f3632 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -314,7 +314,7 @@ if(speed <= 0) speed = 1 if("setpath") - var/newpath = sanitize(input(usr, "Please define a new path!",,path) as text|null) + var/newpath = sanitize(tgui_input_text(usr, "Please define a new path!",,path)) if(newpath && newpath != "") moving = 0 // stop moving path = newpath diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm index 7e6721f109..1002e3fa21 100644 --- a/code/game/machinery/mass_driver.dm +++ b/code/game/machinery/mass_driver.dm @@ -28,7 +28,7 @@ if(istype(I, /obj/item/device/multitool)) if(panel_open) - var/input = sanitize(input(usr, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id)) + var/input = sanitize(tgui_input_text(usr, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id)) if(!input) to_chat(usr, "No input found please hang up and try your call again.") return diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 90a623d0b9..1e1fff180e 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -150,7 +150,7 @@ Transponder Codes: