From 2d7b081a55fc2819cee3c6b254557d1e97ff7cf2 Mon Sep 17 00:00:00 2001 From: ItsSelis Date: Sun, 19 Jun 2022 03:40:24 +0200 Subject: [PATCH] Input Conversion Part 2 --- .../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 ++-- .../game/gamemodes/events/holidays/Holidays.dm | 4 ++-- code/game/gamemodes/game_mode.dm | 8 ++++---- code/game/gamemodes/nuclear/pinpointer.dm | 4 ++-- code/game/machinery/atmoalter/canister.dm | 2 +- code/game/machinery/camera/camera_assembly.dm | 4 ++-- code/game/machinery/computer/card.dm | 2 +- .../telecomms/machine_interactions.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 | 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 +- .../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/topic.dm | 4 ++-- code/modules/casino/casino.dm | 2 +- .../preference_setup/general/01_basic.dm | 2 +- .../preference_setup/general/02_language.dm | 2 +- .../client/preference_setup/general/03_body.dm | 2 +- .../preference_setup/general/06_flavor.dm | 8 ++++---- .../client/preference_setup/global/01_ui.dm | 8 ++++---- .../volume_sliders/01_volume.dm | 2 +- .../volume_sliders/02_media.dm | 2 +- .../client/preference_setup/vore/02_size.dm | 6 +++--- 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.dm | 2 +- code/modules/economy/retail_scanner.dm | 12 ++++++------ code/modules/economy/vending.dm | 2 +- code/modules/events/event_manager.dm | 4 ++-- .../food/kitchen/smartfridge/smartfridge.dm | 2 +- code/modules/games/cards.dm | 4 ++-- code/modules/instruments/songs/editor.dm | 10 +++++----- .../core/special_pins/string_pin.dm | 2 +- .../integrated_electronics/subtypes/memory.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/living/carbon/human/emote.dm | 2 +- .../mob/living/carbon/human/human_powers.dm | 4 ++-- .../station/protean_vr/protean_powers.dm | 2 +- .../human/species/xenomorphs/alien_powers.dm | 2 +- code/modules/mob/mob_transformation_simple.dm | 2 +- code/modules/mob/say_vr.dm | 6 +++--- .../programs/generic/file_browser.dm | 2 +- .../file_system/programs/research/ntmonitor.dm | 4 ++-- .../modules/modular_computers/laptop_vendor.dm | 2 +- code/modules/nifsoft/software/15_misc.dm | 2 +- .../overmap/disperser/disperser_console.dm | 6 +++--- .../overmap/ships/computers/engine_control.dm | 4 ++-- code/modules/overmap/ships/computers/helm.dm | 12 ++++++------ .../modules/overmap/ships/computers/sensors.dm | 2 +- code/modules/paperwork/pen.dm | 2 +- code/modules/pda/core_apps.dm | 2 +- code/modules/power/cable.dm | 2 +- code/modules/power/turbine.dm | 4 ++-- code/modules/random_map/drop/droppod.dm | 2 +- code/modules/random_map/random_map_verbs.dm | 14 +++++++------- code/modules/reagents/machinery/distillery.dm | 2 +- code/modules/recycling/conveyor2.dm | 4 ++-- code/modules/resleeving/designer.dm | 2 +- code/modules/shieldgen/shield_generator.dm | 4 ++-- code/modules/stockmarket/computer.dm | 4 ++-- code/modules/surgery/robotics.dm | 4 ++-- code/modules/tgui/modules/agentcard.dm | 8 ++++---- code/modules/tgui/modules/communications.dm | 2 +- code/modules/tgui/modules/gyrotron_control.dm | 2 +- code/modules/tgui/modules/overmap.dm | 18 +++++++++--------- code/modules/virus2/admin.dm | 10 +++++----- code/modules/vore/eating/vorepanel_vr.dm | 2 +- 80 files changed, 160 insertions(+), 160 deletions(-) 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..d0a887d56c 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(comain_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/game/gamemodes/events/holidays/Holidays.dm b/code/game/gamemodes/events/holidays/Holidays.dm index cee83656cb..a95200adb7 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 88efd6154e..7af06d8d33 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/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 3b8f8360d8..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 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/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/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/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index c91881f0c3..41bb3e65fe 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -295,7 +295,7 @@ . = TRUE if("network") - var/newnet = input(usr, "Specify the new network for this machine. This will break all current links.", src, network) as null|text + var/newnet = tgui_input_text(usr, "Specify the new network for this machine. This will break all current links.", src, network) if(newnet && canAccess(usr)) if(length(newnet) > 15) diff --git a/code/game/magic/archived_book.dm b/code/game/magic/archived_book.dm index ed77f3c90b..1aab354815 100644 --- a/code/game/magic/archived_book.dm +++ b/code/game/magic/archived_book.dm @@ -40,7 +40,7 @@ var/global/datum/book_manager/book_mgr = new() to_chat(src, "Only administrators may use this command.") return - var/isbn = input(usr, "ISBN number?", "Delete Book") as num | null + var/isbn = tgui_input_number(usr, "ISBN number?", "Delete Book") if(!isbn) return diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index aa5226c172..1c5003ac95 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -48,7 +48,7 @@ if("send_message") var/obj/item/mecha_parts/mecha_tracking/MT = locate(params["mt"]) if(istype(MT)) - var/message = sanitize(input(usr, "Input message", "Transmit message") as text) + var/message = sanitize(tgui_input_text(usr, "Input message", "Transmit message")) var/obj/mecha/M = MT.in_mecha() if(message && M) M.occupant_message(message) diff --git a/code/game/objects/effects/spawners/bombspawner.dm b/code/game/objects/effects/spawners/bombspawner.dm index b3b22fc082..c7fc6962ba 100644 --- a/code/game/objects/effects/spawners/bombspawner.dm +++ b/code/game/objects/effects/spawners/bombspawner.dm @@ -7,13 +7,13 @@ var/obj/effect/spawner/newbomb/proto = /obj/effect/spawner/newbomb/radio/custom - var/p = input(usr, "Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt)) as num|null + var/p = tgui_input_number(usr, "Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt)) if(p == null) return - var/o = input(usr, "Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt)) as num|null + var/o = tgui_input_number(usr, "Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt)) if(o == null) return - var/c = input(usr, "Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt)) as num|null + var/c = tgui_input_number(usr, "Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt)) if(c == null) return new /obj/effect/spawner/newbomb/radio/custom(get_turf(mob), p, o, c) diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm index 400820f49f..a8067805a2 100644 --- a/code/game/objects/explosion_recursive.dm +++ b/code/game/objects/explosion_recursive.dm @@ -1,5 +1,5 @@ /client/proc/kaboom() - var/power = input(src, "power?", "power?") as num + var/power = tgui_input_number(src, "power?", "power?") var/turf/T = get_turf(src.mob) explosion_rec(T, power) diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index 70f5155b82..862d4e6cda 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -33,7 +33,7 @@ /obj/structure/closet/body_bag/attackby(var/obj/item/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/pen)) - var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text + var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null) if (user.get_active_hand() != W) return if (!in_range(src, user) && src.loc != user) diff --git a/code/game/objects/items/devices/communicator/UI_tgui.dm b/code/game/objects/items/devices/communicator/UI_tgui.dm index c3758d0c89..03048abd6f 100644 --- a/code/game/objects/items/devices/communicator/UI_tgui.dm +++ b/code/game/objects/items/devices/communicator/UI_tgui.dm @@ -322,7 +322,7 @@ . = TRUE switch(action) if("rename") - var/new_name = sanitizeSafe(input(usr,"Please enter your name.","Communicator",usr.name) ) + var/new_name = sanitizeSafe(tgui_input_text(usr,"Please enter your name.","Communicator",usr.name) ) if(new_name) register_device(new_name) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index ff9bbad216..28c89140d0 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -229,7 +229,7 @@ to_chat(user, "The MMI must go in after everything else!") if (istype(W, /obj/item/weapon/pen)) - var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN) + var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN) if (!t) return if (!in_range(src, usr) && src.loc != usr) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index b6ad543e6a..aa3cca9b90 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -399,7 +399,7 @@ /obj/item/stack/attack_hand(mob/user as mob) if (user.get_inactive_hand() == src) - var/N = input(usr, "How many stacks of [src] would you like to split off? There are currently [amount].", "Split stacks", 1) as num|null + var/N = tgui_input_number(usr, "How many stacks of [src] would you like to split off? There are currently [amount].", "Split stacks", 1, amount, 1) if(N) var/obj/item/stack/F = src.split(N) if (F) diff --git a/code/game/objects/items/toys/toys.dm b/code/game/objects/items/toys/toys.dm index 0b1343d63e..2331485fd1 100644 --- a/code/game/objects/items/toys/toys.dm +++ b/code/game/objects/items/toys/toys.dm @@ -843,7 +843,7 @@ if(!M.mind) return 0 - var/input = sanitizeSafe(input(usr, "What do you want to name the plushie?", ,""), MAX_NAME_LEN) + var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name the plushie?", ,""), MAX_NAME_LEN) if(src && input && !M.stat && in_range(M,src)) name = input diff --git a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm index 9d47a962e7..05ef9a7428 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm @@ -74,7 +74,7 @@ to_chat(user, "Circuit controls are locked.") return var/existing_networks = jointext(network,",") - var/input = sanitize(input(usr, "Which networks would you like to connect this camera console circuit to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Multitool-Circuitboard interface", existing_networks)) + var/input = sanitize(tgui_input_text(usr, "Which networks would you like to connect this camera console circuit to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Multitool-Circuitboard interface", existing_networks)) if(!input) to_chat(usr, "No input found please hang up and try your call again.") return diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index d81e6e444e..5e1d700602 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -39,7 +39,7 @@ ..() /obj/item/weapon/plastique/attack_self(mob/user as mob) - var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num + var/newtime = tgui_input_number(usr, "Please set the timer.", "Timer", 10, 60000, 10) if(user.get_active_hand() == src) newtime = CLAMP(newtime, 10, 60000) timer = newtime diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 8de1fb7f80..52ebd29e7c 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -288,7 +288,7 @@ Implant Specifics:
"} /obj/item/weapon/implant/explosive/post_implant(mob/source as mob) elevel = tgui_alert(usr, "What sort of explosion would you prefer?", "Implant Intent", list("Localized Limb", "Destroy Body", "Full Explosion")) - phrase = input(usr, "Choose activation phrase:") as text + phrase = tgui_input_text(usr, "Choose activation phrase:") var/list/replacechars = list("'" = "","\"" = "",">" = "","<" = "","(" = "",")" = "") phrase = replace_characters(phrase, replacechars) usr.mind.store_memory("Explosive implant in [source] can be activated by saying something containing the phrase ''[src.phrase]'', say [src.phrase] to attempt to activate.", 0, 0) diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm index 9162be15eb..1517e2ada3 100644 --- a/code/game/objects/items/weapons/implants/implantcase.dm +++ b/code/game/objects/items/weapons/implants/implantcase.dm @@ -21,7 +21,7 @@ /obj/item/weapon/implantcase/attackby(obj/item/weapon/I as obj, mob/user as mob) ..() if (istype(I, /obj/item/weapon/pen)) - var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text + var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null) if (user.get_active_hand() != I) return if((!in_range(src, usr) && src.loc != user)) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index d23239d4b0..b7d90021ab 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -338,7 +338,7 @@ var/mins = 0 if(minutes > CMinutes) mins = minutes - CMinutes - mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null + mins = tgui_input_number(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) if(!mins) return mins = min(525599,mins) minutes = CMinutes + mins @@ -1867,7 +1867,7 @@ src.access_news_network() else if(href_list["ac_set_wanted_desc"]) - src.admincaster_feed_message.body = sanitize(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", "")) + src.admincaster_feed_message.body = sanitize(tgui_input_text(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", "")) src.access_news_network() else if(href_list["ac_submit_wanted"]) diff --git a/code/modules/casino/casino.dm b/code/modules/casino/casino.dm index ce840ad258..224e457ee9 100644 --- a/code/modules/casino/casino.dm +++ b/code/modules/casino/casino.dm @@ -478,7 +478,7 @@ if(usr.incapacitated()) return if(ishuman(usr) || istype(usr, /mob/living/silicon/robot)) - casinoslave_price = input("Select the desired price (1-1000)", "Set Price") as num + casinoslave_price = tgui_input_number("Select the desired price (1-1000)", "Set Price", null, null, 1000, 1) if(casinoslave_price>1000 || casinoslave_price<1) to_chat(user,"Invalid price. ") return diff --git a/code/modules/client/preference_setup/general/01_basic.dm b/code/modules/client/preference_setup/general/01_basic.dm index ccd0d491e3..1bf1a03bd2 100644 --- a/code/modules/client/preference_setup/general/01_basic.dm +++ b/code/modules/client/preference_setup/general/01_basic.dm @@ -125,7 +125,7 @@ else if(href_list["age"]) var/min_age = get_min_age() var/max_age = get_max_age() - var/new_age = input(user, "Choose your character's age:\n([min_age]-[max_age])", "Character Preference", pref.age) as num|null + var/new_age = tgui_input_number(user, "Choose your character's age:\n([min_age]-[max_age])", "Character Preference", pref.age, max_age, min_age) if(new_age && CanUseTopic(user)) pref.age = max(min(round(text2num(new_age)), max_age), min_age) return TOPIC_REFRESH diff --git a/code/modules/client/preference_setup/general/02_language.dm b/code/modules/client/preference_setup/general/02_language.dm index 2121489535..28e599a2cd 100644 --- a/code/modules/client/preference_setup/general/02_language.dm +++ b/code/modules/client/preference_setup/general/02_language.dm @@ -94,7 +94,7 @@ var/char var/keys[0] do - char = input(usr, "Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining") as null|text + char = tgui_input_text(usr, "Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining") if(char) if(length(char) > 1) tgui_alert_async(user, "Only single characters allowed.", "Error") diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 6cdfa38f13..2e1066dc0b 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -777,7 +777,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O else if(href_list["skin_tone"]) if(!has_flag(mob_species, HAS_SKIN_TONE)) return TOPIC_NOACTION - var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference", (-pref.s_tone) + 35) as num|null + var/new_s_tone = tgui_input_number(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference", (-pref.s_tone) + 35, 220, 1) if(new_s_tone && has_flag(mob_species, HAS_SKIN_TONE) && CanUseTopic(user)) pref.s_tone = 35 - max(min( round(new_s_tone), 220),1) return TOPIC_REFRESH_UPDATE_PREVIEW diff --git a/code/modules/client/preference_setup/general/06_flavor.dm b/code/modules/client/preference_setup/general/06_flavor.dm index ac1c42d5d0..7f5e95f69b 100644 --- a/code/modules/client/preference_setup/general/06_flavor.dm +++ b/code/modules/client/preference_setup/general/06_flavor.dm @@ -59,11 +59,11 @@ switch(href_list["flavor_text"]) if("open") if("general") - var/msg = sanitize(input(usr,"Give a general description of your character. This will be shown regardless of clothings.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]])) as message, extra = 0) //VOREStation Edit: separating out OOC notes + var/msg = sanitize(tgui_input_text(usr,"Give a general description of your character. This will be shown regardless of clothings.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes if(CanUseTopic(user)) pref.flavor_texts[href_list["flavor_text"]] = msg else - var/msg = sanitize(input(usr,"Set the flavor text for your [href_list["flavor_text"]].","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]])) as message, extra = 0) + var/msg = sanitize(tgui_input_text(usr,"Set the flavor text for your [href_list["flavor_text"]].","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE), extra = 0) if(CanUseTopic(user)) pref.flavor_texts[href_list["flavor_text"]] = msg SetFlavorText(user) @@ -73,11 +73,11 @@ switch(href_list["flavour_text_robot"]) if("open") if("Default") - var/msg = sanitize(input(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"])) as message, extra = 0) + var/msg = sanitize(tgui_input_text(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE), extra = 0) if(CanUseTopic(user)) pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg else - var/msg = sanitize(input(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]])) as message, extra = 0) + var/msg = sanitize(tgui_input_text(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE), extra = 0) if(CanUseTopic(user)) pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg SetFlavourTextRobot(user) diff --git a/code/modules/client/preference_setup/global/01_ui.dm b/code/modules/client/preference_setup/global/01_ui.dm index 2875c443b6..fbe54b00cd 100644 --- a/code/modules/client/preference_setup/global/01_ui.dm +++ b/code/modules/client/preference_setup/global/01_ui.dm @@ -82,7 +82,7 @@ return TOPIC_REFRESH else if(href_list["select_alpha"]) - var/UI_style_alpha_new = input(user, "Select UI alpha (transparency) level, between 50 and 255.", "Global Preference", pref.UI_style_alpha) as num|null + var/UI_style_alpha_new = tgui_input_number(user, "Select UI alpha (transparency) level, between 50 and 255.", "Global Preference", pref.UI_style_alpha, 255, 50) if(isnull(UI_style_alpha_new) || (UI_style_alpha_new < 50 || UI_style_alpha_new > 255) || !CanUseTopic(user)) return TOPIC_NOACTION pref.UI_style_alpha = UI_style_alpha_new return TOPIC_REFRESH @@ -100,7 +100,7 @@ return TOPIC_REFRESH else if(href_list["select_client_fps"]) - var/fps_new = input(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps) as null|num + var/fps_new = tgui_input_number(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps, 200, 1) if(isnull(fps_new) || !CanUseTopic(user)) return TOPIC_NOACTION if(fps_new < 0 || fps_new > MAX_CLIENT_FPS) return TOPIC_NOACTION pref.client_fps = fps_new @@ -109,14 +109,14 @@ return TOPIC_REFRESH else if(href_list["select_ambience_freq"]) - var/ambience_new = input(user, "Input how often you wish to hear ambience repeated! (1-60 MINUTES, 0 for disabled)", "Global Preference", pref.ambience_freq) as null|num + var/ambience_new = tgui_input_number(user, "Input how often you wish to hear ambience repeated! (1-60 MINUTES, 0 for disabled)", "Global Preference", pref.ambience_freq, 60, 0) if(isnull(ambience_new) || !CanUseTopic(user)) return TOPIC_NOACTION if(ambience_new < 0 || ambience_new > 60) return TOPIC_NOACTION pref.ambience_freq = ambience_new return TOPIC_REFRESH else if(href_list["select_ambience_chance"]) - var/ambience_chance_new = input(user, "Input the chance you'd like to hear ambience played to you (On area change, or by random ambience). 35 means a 35% chance to play ambience. This is a range from 0-100. 0 disables ambience playing entirely. This is also affected by Ambience Frequency.", "Global Preference", pref.ambience_freq) as null|num + var/ambience_chance_new = tgui_input_number(user, "Input the chance you'd like to hear ambience played to you (On area change, or by random ambience). 35 means a 35% chance to play ambience. This is a range from 0-100. 0 disables ambience playing entirely. This is also affected by Ambience Frequency.", "Global Preference", pref.ambience_freq, 100, 0) if(isnull(ambience_chance_new) || !CanUseTopic(user)) return TOPIC_NOACTION if(ambience_chance_new < 0 || ambience_chance_new > 100) return TOPIC_NOACTION pref.ambience_chance = ambience_chance_new diff --git a/code/modules/client/preference_setup/volume_sliders/01_volume.dm b/code/modules/client/preference_setup/volume_sliders/01_volume.dm index 90c0b227c0..7dea5d2053 100644 --- a/code/modules/client/preference_setup/volume_sliders/01_volume.dm +++ b/code/modules/client/preference_setup/volume_sliders/01_volume.dm @@ -40,7 +40,7 @@ var/channel = href_list["change_volume"] if(!(channel in pref.volume_channels)) pref.volume_channels["[channel]"] = 1 - var/value = input(usr, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100)) + var/value = tgui_input_number(usr, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100), 200, 0) if(isnum(value)) value = CLAMP(value, 0, 200) pref.volume_channels["[channel]"] = (value / 100) diff --git a/code/modules/client/preference_setup/volume_sliders/02_media.dm b/code/modules/client/preference_setup/volume_sliders/02_media.dm index 3fbb972ad2..98f7bb4cfe 100644 --- a/code/modules/client/preference_setup/volume_sliders/02_media.dm +++ b/code/modules/client/preference_setup/volume_sliders/02_media.dm @@ -33,7 +33,7 @@ /datum/category_item/player_setup_item/volume_sliders/media/OnTopic(var/href, var/list/href_list, var/mob/user) if(href_list["change_media_volume"]) if(CanUseTopic(user)) - var/value = input(usr, "Choose your Jukebox volume (0-100%)", "Jukebox volume", round(pref.media_volume * 100)) + var/value = tgui_input_number(usr, "Choose your Jukebox volume (0-100%)", "Jukebox volume", round(pref.media_volume * 100), 100, 0) if(isnum(value)) value = CLAMP(value, 0, 100) pref.media_volume = value/100.0 diff --git a/code/modules/client/preference_setup/vore/02_size.dm b/code/modules/client/preference_setup/vore/02_size.dm index 6624abb1e0..37a71587b1 100644 --- a/code/modules/client/preference_setup/vore/02_size.dm +++ b/code/modules/client/preference_setup/vore/02_size.dm @@ -58,7 +58,7 @@ /datum/category_item/player_setup_item/vore/size/OnTopic(var/href, var/list/href_list, var/mob/user) if(href_list["size_multiplier"]) - var/new_size = input(user, "Choose your character's size, ranging from 25% to 200%", "Set Size") as num|null + var/new_size = tgui_input_number(user, "Choose your character's size, ranging from 25% to 200%", "Set Size", null, 200, 25) if (!ISINRANGE(new_size,25,200)) pref.size_multiplier = 1 to_chat(user, "Invalid size.") @@ -72,11 +72,11 @@ return TOPIC_REFRESH_UPDATE_PREVIEW else if(href_list["weight"]) - var/new_weight = input(user, "Choose your character's relative body weight.\n\ + var/new_weight = tgui_input_number(user, "Choose your character's relative body weight.\n\ This measurement should be set relative to a normal 5'10'' person's body and not the actual size of your character.\n\ If you set your weight to 500 because you're a naga or have metal implants then complain that you're a blob I\n\ swear to god I will find you and I will punch you for not reading these directions!\n\ - ([WEIGHT_MIN]-[WEIGHT_MAX])", "Character Preference") as num|null + ([WEIGHT_MIN]-[WEIGHT_MAX])", "Character Preference", null, WEIGHT_MAX, WEIGHT_MIN) if(new_weight) var/unit_of_measurement = tgui_alert(user, "Is that number in pounds (lb) or kilograms (kg)?", "Confirmation", list("Pounds", "Kilograms")) if(unit_of_measurement == "Pounds") diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm index 237f1206cb..8fa9fe73e4 100644 --- a/code/modules/economy/Accounts_DB.dm +++ b/code/modules/economy/Accounts_DB.dm @@ -127,12 +127,12 @@ creating_new_account = 1 if("add_funds") - var/amount = input(usr, "Enter the amount you wish to add", "Silently add funds") as num + var/amount = tgui_input_number(usr, "Enter the amount you wish to add", "Silently add funds") if(detailed_account_view) detailed_account_view.money = min(detailed_account_view.money + amount, fund_cap) if("remove_funds") - var/amount = input(usr, "Enter the amount you wish to remove", "Silently remove funds") as num + var/amount = tgui_input_number(usr, "Enter the amount you wish to remove", "Silently remove funds") if(detailed_account_view) detailed_account_view.money = max(detailed_account_view.money - amount, -fund_cap) diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm index 1517af0cc0..beae04ee7c 100644 --- a/code/modules/economy/EFTPOS.dm +++ b/code/modules/economy/EFTPOS.dm @@ -145,9 +145,9 @@ if(href_list["choice"]) switch(href_list["choice"]) if("change_code") - var/attempt_code = input(usr, "Re-enter the current EFTPOS access code", "Confirm old EFTPOS code") as num + var/attempt_code = tgui_input_number(usr, "Re-enter the current EFTPOS access code", "Confirm old EFTPOS code") if(attempt_code == access_code) - var/trycode = input(usr, "Enter a new access code for this device (4-6 digits, numbers only)", "Enter new EFTPOS code") as num + var/trycode = tgui_input_number(usr, "Enter a new access code for this device (4-6 digits, numbers only)", "Enter new EFTPOS code", null, 999999, 1000) if(trycode >= 1000 && trycode <= 999999) access_code = trycode else @@ -163,8 +163,8 @@ else to_chat(usr, "[bicon(src)]Incorrect code entered.") if("link_account") - var/attempt_account_num = input(usr, "Enter account number to pay EFTPOS charges into", "New account number") as num - var/attempt_pin = input(usr, "Enter pin code", "Account pin") as num + var/attempt_account_num = tgui_input_number(usr, "Enter account number to pay EFTPOS charges into", "New account number") + var/attempt_pin = tgui_input_number(usr, "Enter pin code", "Account pin") linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1) if(linked_account) if(linked_account.suspended) @@ -176,7 +176,7 @@ var/choice = sanitize(input(usr, "Enter reason for EFTPOS transaction", "Transaction purpose")) if(choice) transaction_purpose = choice if("trans_value") - var/try_num = input(usr, "Enter amount for EFTPOS transaction", "Transaction amount") as num + var/try_num = tgui_input_number(usr, "Enter amount for EFTPOS transaction", "Transaction amount") if(try_num < 0) tgui_alert_async(usr, "That is not a valid amount!") else @@ -187,7 +187,7 @@ transaction_locked = 0 transaction_paid = 0 else - var/attempt_code = input(usr, "Enter EFTPOS access code", "Reset Transaction") as num + var/attempt_code = tgui_input_number(usr, "Enter EFTPOS access code", "Reset Transaction") if(attempt_code == access_code) transaction_locked = 0 transaction_paid = 0 @@ -229,7 +229,7 @@ var/attempt_pin = "" var/datum/money_account/D = get_account(C.associated_account_number) if(D.security_level) - attempt_pin = input(usr, "Enter pin code", "EFTPOS transaction") as num + attempt_pin = tgui_input_number(usr, "Enter pin code", "EFTPOS transaction") D = null D = attempt_account_access(C.associated_account_number, attempt_pin, 2) if(D) diff --git a/code/modules/economy/cash.dm b/code/modules/economy/cash.dm index ec2ad51dca..e5a539f5e8 100644 --- a/code/modules/economy/cash.dm +++ b/code/modules/economy/cash.dm @@ -80,7 +80,7 @@ return worth /obj/item/weapon/spacecash/attack_self() - var/amount = input(usr, "How many [initial_name]s do you want to take? (0 to [src.worth])", "Take Money", 20) as num + var/amount = tgui_input_number(usr, "How many [initial_name]s do you want to take? (0 to [src.worth])", "Take Money", 20) if(!src || QDELETED(src)) return amount = round(CLAMP(amount, 0, src.worth)) diff --git a/code/modules/economy/cash_register.dm b/code/modules/economy/cash_register.dm index 9286401aae..08d4ab66d8 100644 --- a/code/modules/economy/cash_register.dm +++ b/code/modules/economy/cash_register.dm @@ -107,8 +107,8 @@ if("toggle_cash_lock") cash_locked = !cash_locked if("link_account") - var/attempt_account_num = input(usr, "Enter account number", "New account number") as num - var/attempt_pin = input(usr, "Enter PIN", "Account PIN") as num + var/attempt_account_num = tgui_input_number(usr, "Enter account number", "New account number") + var/attempt_pin = tgui_input_number(usr, "Enter PIN", "Account PIN") linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1) if(linked_account) if(linked_account.suspended) @@ -117,11 +117,11 @@ else to_chat(usr, "[bicon(src)]Account not found.") if("custom_order") - var/t_purpose = sanitize(input(usr, "Enter purpose", "New purpose") as text) + var/t_purpose = sanitize(tgui_input_text(usr, "Enter purpose", "New purpose")) if (!t_purpose || !Adjacent(usr)) return transaction_purpose = t_purpose item_list += t_purpose - var/t_amount = round(input(usr, "Enter price", "New price") as num) + var/t_amount = round(tgui_input_number(usr, "Enter price", "New price")) if (!t_amount || !Adjacent(usr) || t_amount < 0) return transaction_amount += t_amount price_list += t_amount @@ -129,7 +129,7 @@ src.visible_message("[bicon(src)][transaction_purpose]: [t_amount] Thaler\s.") if("set_amount") var/item_name = locate(href_list["item"]) - var/n_amount = round(input(usr, "Enter amount", "New amount") as num) + var/n_amount = round(tgui_input_number(usr, "Enter amount", "New amount")) n_amount = CLAMP(n_amount, 0, 20) if (!item_list[item_name] || !Adjacent(usr)) return transaction_amount += (n_amount - item_list[item_name]) * price_list[item_name] @@ -234,7 +234,7 @@ var/datum/money_account/D = get_account(I.associated_account_number) var/attempt_pin = "" if(D && D.security_level) - attempt_pin = input(usr, "Enter PIN", "Transaction") as num + attempt_pin = tgui_input_number(usr, "Enter PIN", "Transaction") D = null D = attempt_account_access(I.associated_account_number, attempt_pin, 2) diff --git a/code/modules/economy/casinocash.dm b/code/modules/economy/casinocash.dm index 25486c33f8..201c6147db 100644 --- a/code/modules/economy/casinocash.dm +++ b/code/modules/economy/casinocash.dm @@ -112,7 +112,7 @@ return worth /obj/item/weapon/spacecasinocash/attack_self() - var/amount = input(usr, "How much credits worth of chips do you want to take? (0 to [src.worth])", "Take chips", 20) as num + var/amount = tgui_input_number(usr, "How much credits worth of chips do you want to take? (0 to [src.worth])", "Take chips", 20) if(!src || QDELETED(src)) return amount = round(CLAMP(amount, 0, src.worth)) diff --git a/code/modules/economy/retail_scanner.dm b/code/modules/economy/retail_scanner.dm index 6e68b644aa..d9755b5041 100644 --- a/code/modules/economy/retail_scanner.dm +++ b/code/modules/economy/retail_scanner.dm @@ -101,8 +101,8 @@ else to_chat(usr, "[bicon(src)]Insufficient access.") if("link_account") - var/attempt_account_num = input(usr, "Enter account number", "New account number") as num - var/attempt_pin = input(usr, "Enter PIN", "Account PIN") as num + var/attempt_account_num = tgui_input_number(usr, "Enter account number", "New account number") + var/attempt_pin = tgui_input_number(usr, "Enter PIN", "Account PIN") linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1) if(linked_account) if(linked_account.suspended) @@ -111,11 +111,11 @@ else to_chat(usr, "[bicon(src)]Account not found.") if("custom_order") - var/t_purpose = sanitize(input(usr, "Enter purpose", "New purpose") as text) + var/t_purpose = sanitize(tgui_input_text(usr, "Enter purpose", "New purpose")) if (!t_purpose || !Adjacent(usr)) return transaction_purpose = t_purpose item_list += t_purpose - var/t_amount = round(input(usr, "Enter price", "New price") as num) + var/t_amount = round(tgui_input_number(usr, "Enter price", "New price")) if (!t_amount || !Adjacent(usr)) return transaction_amount += t_amount price_list += t_amount @@ -123,7 +123,7 @@ src.visible_message("[bicon(src)][transaction_purpose]: [t_amount] Thaler\s.") if("set_amount") var/item_name = locate(href_list["item"]) - var/n_amount = round(input(usr, "Enter amount", "New amount") as num) + var/n_amount = round(tgui_input_number(usr, "Enter amount", "New amount")) n_amount = CLAMP(n_amount, 0, 20) if (!item_list[item_name] || !Adjacent(usr)) return transaction_amount += (n_amount - item_list[item_name]) * price_list[item_name] @@ -211,7 +211,7 @@ var/datum/money_account/D = get_account(I.associated_account_number) var/attempt_pin = "" if(D && D.security_level) - attempt_pin = input(usr, "Enter PIN", "Transaction") as num + attempt_pin = tgui_input_number(usr, "Enter PIN", "Transaction") D = null D = attempt_account_access(I.associated_account_number, attempt_pin, 2) diff --git a/code/modules/economy/vending.dm b/code/modules/economy/vending.dm index f073f3f396..55c726539a 100644 --- a/code/modules/economy/vending.dm +++ b/code/modules/economy/vending.dm @@ -327,7 +327,7 @@ GLOBAL_LIST_EMPTY(vending_products) // 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/modules/events/event_manager.dm b/code/modules/events/event_manager.dm index f5a557835d..f8dca1824b 100644 --- a/code/modules/events/event_manager.dm +++ b/code/modules/events/event_manager.dm @@ -156,7 +156,7 @@ config.allow_random_events = text2num(href_list["pause_all"]) log_and_message_admins("has [config.allow_random_events ? "resumed" : "paused"] countdown for all events.") else if(href_list["interval"]) - var/delay = input(usr, "Enter delay modifier. A value less than one means events fire more often, higher than one less often.", "Set Interval Modifier") as num|null + var/delay = tgui_input_number(usr, "Enter delay modifier. A value less than one means events fire more often, higher than one less often.", "Set Interval Modifier") if(delay && delay > 0) var/datum/event_container/EC = locate(href_list["interval"]) EC.delay_modifier = delay @@ -183,7 +183,7 @@ var/datum/event_meta/EM = locate(href_list["set_type"]) EM.event_type = type else if(href_list["set_weight"]) - var/weight = input(usr, "Enter weight. A higher value means higher chance for the event of being selected.", "Set Weight") as num|null + var/weight = tgui_input_number(usr, "Enter weight. A higher value means higher chance for the event of being selected.", "Set Weight") if(weight && weight > 0) var/datum/event_meta/EM = locate(href_list["set_weight"]) EM.weight = weight diff --git a/code/modules/food/kitchen/smartfridge/smartfridge.dm b/code/modules/food/kitchen/smartfridge/smartfridge.dm index f98da20f8c..11ce0e461e 100644 --- a/code/modules/food/kitchen/smartfridge/smartfridge.dm +++ b/code/modules/food/kitchen/smartfridge/smartfridge.dm @@ -216,7 +216,7 @@ if(params["amount"]) amount = params["amount"] else - amount = input(usr, "How many items?", "How many items would you like to take out?", 1) as num|null + amount = tgui_input_number(usr, "How many items?", "How many items would you like to take out?", 1) if(QDELETED(src) || QDELETED(usr) || !usr.Adjacent(src)) return FALSE diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 8c333aaf10..58df571a49 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -157,7 +157,7 @@ players += player //players -= usr var/maxcards = max(min(cards.len,10),1) - var/dcard = input(usr, "How many card(s) do you wish to deal? You may deal up to [maxcards] cards.") as num + var/dcard = tgui_input_number(usr, "How many card(s) do you wish to deal? You may deal up to [maxcards] cards.", null, null, maxcards) if(dcard > maxcards) return var/mob/living/M = tgui_input_list(usr, "Who do you wish to deal [dcard] card(s)?", "Deal to whom?", players) @@ -321,7 +321,7 @@ var/i var/maxcards = min(cards.len,5) // Maximum of 5 cards at once - var/discards = input(usr, "How many cards do you want to discard? You may discard up to [maxcards] card(s)") as num + var/discards = tgui_input_number(usr, "How many cards do you want to discard? You may discard up to [maxcards] card(s)", null, null, maxcards, 0) if(discards > maxcards) return for (i = 0;i < discards;i++) diff --git a/code/modules/instruments/songs/editor.dm b/code/modules/instruments/songs/editor.dm index f9c454e08a..af884bf2d3 100644 --- a/code/modules/instruments/songs/editor.dm +++ b/code/modules/instruments/songs/editor.dm @@ -191,22 +191,22 @@ stop_playing() else if(href_list["setlinearfalloff"]) - var/amount = input(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration") as null|num + var/amount = tgui_input_number(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration") if(!isnull(amount)) set_linear_falloff_duration(round(amount * 10, world.tick_lag)) else if(href_list["setexpfalloff"]) - var/amount = input(usr, "Set exponential sustain factor", "Exponential sustain factor") as null|num + var/amount = tgui_input_number(usr, "Set exponential sustain factor", "Exponential sustain factor") if(!isnull(amount)) set_exponential_drop_rate(round(amount, 0.00001)) else if(href_list["setvolume"]) - var/amount = input(usr, "Set volume", "Volume") as null|num + var/amount = tgui_input_number(usr, "Set volume", "Volume") if(!isnull(amount)) set_volume(round(amount, 1)) else if(href_list["setdropoffvolume"]) - var/amount = input(usr, "Set dropoff threshold", "Dropoff Threshold Volume") as null|num + var/amount = tgui_input_number(usr, "Set dropoff threshold", "Dropoff Threshold Volume") if(!isnull(amount)) set_dropoff_volume(round(amount, 0.01)) @@ -233,7 +233,7 @@ set_instrument(choice) else if(href_list["setnoteshift"]) - var/amount = input(usr, "Set note shift", "Note Shift") as null|num + var/amount = tgui_input_number(usr, "Set note shift", "Note Shift") if(!isnull(amount)) note_shift = clamp(amount, note_shift_min, note_shift_max) diff --git a/code/modules/integrated_electronics/core/special_pins/string_pin.dm b/code/modules/integrated_electronics/core/special_pins/string_pin.dm index a0428a12de..db9bc31944 100644 --- a/code/modules/integrated_electronics/core/special_pins/string_pin.dm +++ b/code/modules/integrated_electronics/core/special_pins/string_pin.dm @@ -3,7 +3,7 @@ name = "string pin" /datum/integrated_io/string/ask_for_pin_data(mob/user) - var/new_data = input(usr, "Please type in a string.","[src] string writing") as null|text + var/new_data = tgui_input_text(usr, "Please type in a string.","[src] string writing") new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 0, 0) if(new_data && holder.check_interactivity(user) ) diff --git a/code/modules/integrated_electronics/subtypes/memory.dm b/code/modules/integrated_electronics/subtypes/memory.dm index 98c94f2487..0148c01c05 100644 --- a/code/modules/integrated_electronics/subtypes/memory.dm +++ b/code/modules/integrated_electronics/subtypes/memory.dm @@ -102,7 +102,7 @@ to_chat(user, "You set \the [src]'s memory to [O.display_data(O.data)].") if("number") accepting_refs = 0 - new_data = input(usr, "Now type in a number.","[src] number writing") as null|num + new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing") if(isnum(new_data) && CanInteract(user, GLOB.tgui_physical_state)) O.data = new_data to_chat(user, "You set \the [src]'s memory to [O.display_data(O.data)].") diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index f642131278..1a78de6558 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -928,7 +928,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/mob/living/M = tgui_input_list(src, "Select who to whisper to:", "Whisper to?", options) if(!M) return 0 - var/msg = sanitize(input(src, "Message:", "Spectral Whisper") as text|null) + var/msg = sanitize(tgui_input_text(src, "Message:", "Spectral Whisper")) if(msg) log_say("(SPECWHISP to [key_name(M)]): [msg]", src) to_chat(M, " You hear a strange, unidentifiable voice in your head... [msg]") diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 028fc518e2..bac825919a 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -297,7 +297,7 @@ var/list/_simple_mob_default_emotes = list( var/datum/gender/T = gender_datums[get_visible_gender()] - pose = sanitize(input(usr, "This is [src]. [T.he]...", "Pose", null) as text) + pose = sanitize(tgui_input_text(usr, "This is [src]. [T.he]...", "Pose", null)) /mob/living/carbon/human/verb/set_flavor() set name = "Set Flavour Text" diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 74dfba1b36..f8d49b046a 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -94,7 +94,7 @@ if(!target) return - text = input(usr, "What would you like to say?", "Speak to creature", null, null) + text = tgui_input_text(usr, "What would you like to say?", "Speak to creature", null, null) text = sanitize(text) @@ -134,7 +134,7 @@ set desc = "Whisper silently to someone over a distance." set category = "Abilities" - var/msg = sanitize(input(usr, "Message:", "Psychic Whisper") as text|null) + var/msg = sanitize(tgui_input_text(usr, "Message:", "Psychic Whisper")) if(msg) log_say("(PWHISPER to [key_name(M)]) [msg]", src) to_chat(M, "You hear a strange, alien voice in your head... [msg]") 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 c6b353281b..6967b1b5c7 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 @@ -295,7 +295,7 @@ return var/nagmessage = "Adjust your mass to be a size between 25 to 200% (or between 1 to 600% in dorms area). Up-sizing consumes metal, downsizing returns metal." - var/new_size = input(user, nagmessage, "Pick a Size", user.size_multiplier*100) as num|null + var/new_size = tgui_input_number(user, nagmessage, "Pick a Size", user.size_multiplier*100, 600, 1) if(!new_size || !size_range_check(new_size)) return diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm index acd1b8f540..f627a191fe 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm @@ -67,7 +67,7 @@ to_chat(src, "Their plasma vessel is missing.") return - var/amount = input(usr, "Amount:", "Transfer Plasma to [M]") as num + var/amount = tgui_input_number(usr, "Amount:", "Transfer Plasma to [M]") if (amount) amount = abs(round(amount)) if(check_alien_ability(amount,0,O_PLASMA)) diff --git a/code/modules/mob/mob_transformation_simple.dm b/code/modules/mob/mob_transformation_simple.dm index b3a1f39454..2534755873 100644 --- a/code/modules/mob/mob_transformation_simple.dm +++ b/code/modules/mob/mob_transformation_simple.dm @@ -9,7 +9,7 @@ return if(!new_type) - new_type = input(usr, "Mob type path:", "Mob type") as text|null + new_type = tgui_input_text(usr, "Mob type path:", "Mob type") if(istext(new_type)) new_type = text2path(new_type) diff --git a/code/modules/mob/say_vr.dm b/code/modules/mob/say_vr.dm index 703aac2813..f10ce85b86 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -42,7 +42,7 @@ var/input if(!message) - input = sanitize_or_reflect(input(src,"Choose an emote to display.") as text|null, src) + input = sanitize_or_reflect(tgui_input_text(src,"Choose an emote to display."), src) else input = message @@ -123,7 +123,7 @@ to_chat(src, "You cannot speak in IC (muted).") return if (!message) - message = input(usr, "Type a message to say.","Psay") as text|null + message = tgui_input_text(usr, "Type a message to say.","Psay") message = sanitize_or_reflect(message,src) if (!message) return @@ -204,7 +204,7 @@ to_chat(src, "You cannot speak in IC (muted).") return if (!message) - message = input(usr, "Type a message to emote.","Pme") as text|null + message = tgui_input_text(usr, "Type a message to emote.","Pme") message = sanitize_or_reflect(message,src) if (!message) return diff --git a/code/modules/modular_computers/file_system/programs/generic/file_browser.dm b/code/modules/modular_computers/file_system/programs/generic/file_browser.dm index b3827e507c..e37e994f43 100644 --- a/code/modules/modular_computers/file_system/programs/generic/file_browser.dm +++ b/code/modules/modular_computers/file_system/programs/generic/file_browser.dm @@ -28,7 +28,7 @@ if("PRG_newtextfile") if(!HDD) return - var/newname = sanitize(input(usr, "Enter file name or leave blank to cancel:", "File rename")) + var/newname = sanitize(tgui_input_text(usr, "Enter file name or leave blank to cancel:", "File rename")) if(!newname) return var/datum/computer_file/data/F = new/datum/computer_file/data() diff --git a/code/modules/modular_computers/file_system/programs/research/ntmonitor.dm b/code/modules/modular_computers/file_system/programs/research/ntmonitor.dm index d1aa9b7833..8814e2a16b 100644 --- a/code/modules/modular_computers/file_system/programs/research/ntmonitor.dm +++ b/code/modules/modular_computers/file_system/programs/research/ntmonitor.dm @@ -80,14 +80,14 @@ if("ban_nid") if(!ntnet_global) return - var/nid = input(usr,"Enter NID of device which you want to block from the network:", "Enter NID") as null|num + var/nid = tgui_input_number(usr,"Enter NID of device which you want to block from the network:", "Enter NID") if(nid && tgui_status(usr, state) == STATUS_INTERACTIVE) ntnet_global.banned_nids |= nid return TRUE if("unban_nid") if(!ntnet_global) return - var/nid = input(usr,"Enter NID of device which you want to unblock from the network:", "Enter NID") as null|num + var/nid = tgui_input_number(usr,"Enter NID of device which you want to unblock from the network:", "Enter NID") if(nid && tgui_status(usr, state) == STATUS_INTERACTIVE) ntnet_global.banned_nids -= nid return TRUE diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm index f673e060ef..0242ad2a1f 100644 --- a/code/modules/modular_computers/laptop_vendor.dm +++ b/code/modules/modular_computers/laptop_vendor.dm @@ -285,7 +285,7 @@ return 0 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/modules/nifsoft/software/15_misc.dm b/code/modules/nifsoft/software/15_misc.dm index 46db84c235..8e7101395f 100644 --- a/code/modules/nifsoft/software/15_misc.dm +++ b/code/modules/nifsoft/software/15_misc.dm @@ -127,7 +127,7 @@ /datum/nifsoft/sizechange/activate() if((. = ..())) - var/new_size = input(usr, "Put the desired size (25-200%), or (1-600%) in dormitory areas.", "Set Size", 200) as num|null + var/new_size = tgui_input_number(usr, "Put the desired size (25-200%), or (1-600%) in dormitory areas.", "Set Size", 200, 600, 1) if (!nif.human.size_range_check(new_size)) if(new_size) diff --git a/code/modules/overmap/disperser/disperser_console.dm b/code/modules/overmap/disperser/disperser_console.dm index 789d768e6b..d67bb87c5c 100644 --- a/code/modules/overmap/disperser/disperser_console.dm +++ b/code/modules/overmap/disperser/disperser_console.dm @@ -177,7 +177,7 @@ . = TRUE if("calibration") - var/input = input(usr, "0-9", "disperser calibration", 0) as num|null + var/input = tgui_input_number(usr, "0-9", "disperser calibration", 0, 9, 0) if(!isnull(input)) //can be zero so we explicitly check for null var/calnum = sanitize_integer(text2num(params["calibration"]), 0, caldigit)//sanitiiiiize calibration[calnum + 1] = sanitize_integer(input, 0, 9, 0)//must add 1 because js indexes from 0 @@ -189,14 +189,14 @@ . = TRUE if("strength") - var/input = input(usr, "1-5", "disperser strength", 1) as num|null + var/input = tgui_input_number(usr, "1-5", "disperser strength", 1, 5, 1) if(input && tgui_status(usr, state) == STATUS_INTERACTIVE) strength = sanitize_integer(input, 1, 5, 1) middle.update_idle_power_usage(strength * range * 100) . = TRUE if("range") - var/input = input(usr, "1-5", "disperser radius", 1) as num|null + var/input = tgui_input_number(usr, "1-5", "disperser radius", 1, 5, 1) if(input && tgui_status(usr, state) == STATUS_INTERACTIVE) range = sanitize_integer(input, 1, 5, 1) middle.update_idle_power_usage(strength * range * 100) diff --git a/code/modules/overmap/ships/computers/engine_control.dm b/code/modules/overmap/ships/computers/engine_control.dm index 1110f6b246..ab1bb61b74 100644 --- a/code/modules/overmap/ships/computers/engine_control.dm +++ b/code/modules/overmap/ships/computers/engine_control.dm @@ -62,7 +62,7 @@ . = TRUE if("set_global_limit") - var/newlim = input(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num + var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100, 100, 0) if(tgui_status(usr, state) != STATUS_INTERACTIVE) return FALSE linked.thrust_limit = clamp(newlim/100, 0, 1) @@ -78,7 +78,7 @@ if("set_limit") var/datum/ship_engine/E = locate(params["engine"]) - var/newlim = input(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num + var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit(), 100, 0) if(tgui_status(usr, state) != STATUS_INTERACTIVE) return FALSE var/limit = clamp(newlim/100, 0, 1) diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm index a388520ae1..64212fd360 100644 --- a/code/modules/overmap/ships/computers/helm.dm +++ b/code/modules/overmap/ships/computers/helm.dm @@ -171,10 +171,10 @@ GLOBAL_LIST_EMPTY(all_waypoints) R.fields["x"] = linked.x R.fields["y"] = linked.y if("new") - var/newx = input(usr, "Input new entry x coordinate", "Coordinate input", linked.x) as num + var/newx = tgui_input_number(usr, "Input new entry x coordinate", "Coordinate input", linked.x) if(tgui_status(usr, state) != STATUS_INTERACTIVE) return TRUE - var/newy = input(usr, "Input new entry y coordinate", "Coordinate input", linked.y) as num + var/newy = tgui_input_number(usr, "Input new entry y coordinate", "Coordinate input", linked.y) if(tgui_status(usr, state) != STATUS_INTERACTIVE) return FALSE R.fields["x"] = CLAMP(newx, 1, world.maxx) @@ -191,14 +191,14 @@ GLOBAL_LIST_EMPTY(all_waypoints) if("setcoord") if(params["setx"]) - var/newx = input(usr, "Input new destiniation x coordinate", "Coordinate input", dx) as num|null + var/newx = tgui_input_number(usr, "Input new destiniation x coordinate", "Coordinate input", dx) if(tgui_status(usr, state) != STATUS_INTERACTIVE) return if(newx) dx = CLAMP(newx, 1, world.maxx) if(params["sety"]) - var/newy = input(usr, "Input new destiniation y coordinate", "Coordinate input", dy) as num|null + var/newy = tgui_input_number(usr, "Input new destiniation y coordinate", "Coordinate input", dy) if(tgui_status(usr, state) != STATUS_INTERACTIVE) return if(newy) @@ -216,13 +216,13 @@ GLOBAL_LIST_EMPTY(all_waypoints) . = TRUE if("speedlimit") - var/newlimit = input(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null + var/newlimit = tgui_input_number(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) if(newlimit) speedlimit = CLAMP(newlimit/1000, 0, 100) . = TRUE if("accellimit") - var/newlimit = input(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null + var/newlimit = tgui_input_number(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000) if(newlimit) accellimit = max(newlimit/1000, 0) . = TRUE diff --git a/code/modules/overmap/ships/computers/sensors.dm b/code/modules/overmap/ships/computers/sensors.dm index e09678f9b0..21cd9654ee 100644 --- a/code/modules/overmap/ships/computers/sensors.dm +++ b/code/modules/overmap/ships/computers/sensors.dm @@ -106,7 +106,7 @@ if(sensors) switch(action) if("range") - var/nrange = input(usr, "Set new sensors range", "Sensor range", sensors.range) as num|null + var/nrange = tgui_input_number(usr, "Set new sensors range", "Sensor range", sensors.range) if(tgui_status(usr, state) != STATUS_INTERACTIVE) return FALSE if(nrange) diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 9fcf6c33ac..bcc0d0abc4 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -282,7 +282,7 @@ if(new_signature) signature = new_signature */ - signature = sanitize(input(usr, "Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature)) + signature = sanitize(tgui_input_text(usr, "Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature)) /obj/item/weapon/pen/proc/get_signature(var/mob/user) return (user && user.real_name) ? user.real_name : "Anonymous" diff --git a/code/modules/pda/core_apps.dm b/code/modules/pda/core_apps.dm index 141f41a8fb..f15c07bfff 100644 --- a/code/modules/pda/core_apps.dm +++ b/code/modules/pda/core_apps.dm @@ -62,7 +62,7 @@ return TRUE switch(action) if("Edit") - var/n = input(usr, "Please enter message", name, notehtml) as message + var/n = tgui_input_text(usr, "Please enter message", name, notehtml, multiline = TRUE) if(pda.loc == usr) note = adminscrub(n) notehtml = html_decode(note) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index a4efe1336c..c850085bbd 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -978,7 +978,7 @@ var/list/possible_cable_coil_colours = list( /obj/item/stack/cable_coil/alien/attack_hand(mob/user as mob) if (user.get_inactive_hand() == src) - var/N = input(usr, "How many units of wire do you want to take from [src]? You can only take up to [amount] at a time.", "Split stacks", 1) as num|null + var/N = tgui_input_number(usr, "How many units of wire do you want to take from [src]? You can only take up to [amount] at a time.", "Split stacks", 1) if(N && N <= amount) var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc) CC.amount = N diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 297a749aa7..77a5659cdd 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -124,7 +124,7 @@ if(default_deconstruction_crowbar(user, W)) return if(istype(W, /obj/item/device/multitool)) - var/new_ident = input(usr, "Enter a new ident tag.", name, comp_id) as null|text + var/new_ident = tgui_input_text(usr, "Enter a new ident tag.", name, comp_id) if(new_ident && user.Adjacent(src)) comp_id = new_ident return @@ -337,7 +337,7 @@ /obj/machinery/computer/turbine_computer/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/device/multitool)) - var/new_ident = input(usr, "Enter a new ident tag.", name, id) as null|text + var/new_ident = tgui_input_text(usr, "Enter a new ident tag.", name, id) if(new_ident && user.Adjacent(src)) id = new_ident return diff --git a/code/modules/random_map/drop/droppod.dm b/code/modules/random_map/drop/droppod.dm index 2b1cda09a8..e842772f4a 100644 --- a/code/modules/random_map/drop/droppod.dm +++ b/code/modules/random_map/drop/droppod.dm @@ -164,7 +164,7 @@ return if(tgui_alert(usr, "Do you wish the mob to have a player?","Assign Player?",list("No","Yes")) == "No") - var/spawn_count = input(usr, "How many mobs do you wish the pod to contain?", "Drop Pod Selection", null) as num + var/spawn_count = tgui_input_number(usr, "How many mobs do you wish the pod to contain?", "Drop Pod Selection", null) if(spawn_count <= 0) return for(var/i=0;iThis account does not own any shares of [S.name]!") return var/price = S.current_value - var/amt = round(input(user, "How many shares? \n(Have: [avail], unit price: [price])", "Sell shares in [S.name]", 0) as num|null) + var/amt = round(tgui_input_number(user, "How many shares? \n(Have: [avail], unit price: [price])", "Sell shares in [S.name]", 0)) amt = min(amt, S.shareholders[logged_in]) if (!user || (!(user in range(1, src)) && iscarbon(user))) @@ -309,7 +309,7 @@ var/avail = S.available_shares var/price = S.current_value var/canbuy = round(b / price) - var/amt = round(input(user, "How many shares? \n(Available: [avail], unit price: [price], can buy: [canbuy])", "Buy shares in [S.name]", 0) as num|null) + var/amt = round(tgui_input_number(user, "How many shares? \n(Available: [avail], unit price: [price], can buy: [canbuy])", "Buy shares in [S.name]", 0)) if (!user || (!(user in range(1, src)) && iscarbon(user))) return if (li != logged_in) diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index 9c210652c2..b424852ad9 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -470,7 +470,7 @@ var/new_name = target.real_name while(target.client) if(!target) return - var/try_name = input(target,"Pick a name for your new form!", "New Name", target.name) + var/try_name = tgui_input_text(target,"Pick a name for your new form!", "New Name", target.name) var/clean_name = sanitizeName(try_name, allow_numbers = TRUE) if(clean_name) var/okay = tgui_alert(target,"New name will be '[clean_name]', ok?", "Confirmation",list("Cancel","Ok")) @@ -562,7 +562,7 @@ var/new_name = "" while(!new_name) if(!target) return - var/try_name = input(target,"Pick a name for your new form!", "New Name", target.name) + var/try_name = tgui_input_text(target,"Pick a name for your new form!", "New Name", target.name) var/clean_name = sanitizeName(try_name, allow_numbers = TRUE) if(clean_name) var/okay = tgui_alert(target,"New name will be '[clean_name]', ok?", "Confirmation",list("Cancel","Ok")) diff --git a/code/modules/tgui/modules/agentcard.dm b/code/modules/tgui/modules/agentcard.dm index 3046021436..012438dda6 100644 --- a/code/modules/tgui/modules/agentcard.dm +++ b/code/modules/tgui/modules/agentcard.dm @@ -75,7 +75,7 @@ var/mob/living/carbon/human/H = usr if(H.dna) default = H.dna.b_type - var/new_blood_type = sanitize(input(usr,"What blood type would you like to be written on this card?","Agent Card Blood Type",default) as null|text) + var/new_blood_type = sanitize(tgui_input_text(usr,"What blood type would you like to be written on this card?","Agent Card Blood Type",default)) if(!isnull(new_blood_type) && tgui_status(usr, state) == STATUS_INTERACTIVE) S.blood_type = new_blood_type to_chat(usr, "Blood type changed to '[new_blood_type]'.") @@ -86,7 +86,7 @@ var/mob/living/carbon/human/H = usr if(H.dna) default = H.dna.unique_enzymes - var/new_dna_hash = sanitize(input(usr,"What DNA hash would you like to be written on this card?","Agent Card DNA Hash",default) as null|text) + var/new_dna_hash = sanitize(tgui_input_text(usr,"What DNA hash would you like to be written on this card?","Agent Card DNA Hash",default)) if(!isnull(new_dna_hash) && tgui_status(usr, state) == STATUS_INTERACTIVE) S.dna_hash = new_dna_hash to_chat(usr, "DNA hash changed to '[new_dna_hash]'.") @@ -103,7 +103,7 @@ to_chat(usr, "Fingerprint hash changed to '[new_fingerprint_hash]'.") . = TRUE if("name") - var/new_name = sanitizeName(input(usr,"What name would you like to put on this card?","Agent Card Name", S.registered_name) as null|text) + var/new_name = sanitizeName(tgui_input_text(usr,"What name would you like to put on this card?","Agent Card Name", S.registered_name)) if(!isnull(new_name) && tgui_status(usr, state) == STATUS_INTERACTIVE) S.registered_name = new_name S.update_name() @@ -114,7 +114,7 @@ to_chat(usr, "Photo changed.") . = TRUE if("sex") - var/new_sex = sanitize(input(usr,"What sex would you like to put on this card?","Agent Card Sex", S.sex) as null|text) + var/new_sex = sanitize(tgui_input_text(usr,"What sex would you like to put on this card?","Agent Card Sex", S.sex)) if(!isnull(new_sex) && tgui_status(usr, state) == STATUS_INTERACTIVE) S.sex = new_sex to_chat(usr, "Sex changed to '[new_sex]'.") diff --git a/code/modules/tgui/modules/communications.dm b/code/modules/tgui/modules/communications.dm index bb0771fd98..050c366caf 100644 --- a/code/modules/tgui/modules/communications.dm +++ b/code/modules/tgui/modules/communications.dm @@ -260,7 +260,7 @@ if(message_cooldown > world.time) to_chat(usr, "Please allow at least one minute to pass between announcements.") return - var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") as null|message + var/input = tgui_input_text(usr, "Please write a message to announce to the station crew.", "Priority Announcement", multiline = TRUE) if(!input || message_cooldown > world.time || ..() || !(is_authenticated(usr) == COMM_AUTHENTICATION_MAX)) return if(length(input) < COMM_MSGLEN_MINIMUM) diff --git a/code/modules/tgui/modules/gyrotron_control.dm b/code/modules/tgui/modules/gyrotron_control.dm index ee6f5af9b6..e0c4775849 100644 --- a/code/modules/tgui/modules/gyrotron_control.dm +++ b/code/modules/tgui/modules/gyrotron_control.dm @@ -18,7 +18,7 @@ switch(action) if("set_tag") - var/new_ident = sanitize_text(input(usr, "Enter a new ident tag.", "Gyrotron Control", gyro_tag) as null|text) + var/new_ident = sanitize_text(tgui_input_text(usr, "Enter a new ident tag.", "Gyrotron Control", gyro_tag)) if(new_ident) gyro_tag = new_ident return TRUE diff --git a/code/modules/tgui/modules/overmap.dm b/code/modules/tgui/modules/overmap.dm index f1843101c2..a9fff0e6d4 100644 --- a/code/modules/tgui/modules/overmap.dm +++ b/code/modules/tgui/modules/overmap.dm @@ -319,8 +319,8 @@ R.fields["x"] = linked.x R.fields["y"] = linked.y if("new") - var/newx = input(usr, "Input new entry x coordinate", "Coordinate input", linked.x) as num - var/newy = input(usr, "Input new entry y coordinate", "Coordinate input", linked.y) as num + var/newx = tgui_input_number(usr, "Input new entry x coordinate", "Coordinate input", linked.x) + var/newy = tgui_input_number(usr, "Input new entry y coordinate", "Coordinate input", linked.y) R.fields["x"] = CLAMP(newx, 1, world.maxx) R.fields["y"] = CLAMP(newy, 1, world.maxy) known_sectors[sec_name] = R @@ -335,12 +335,12 @@ if("setcoord") if(params["setx"]) - var/newx = input(usr, "Input new destiniation x coordinate", "Coordinate input", dx) as num|null + var/newx = tgui_input_number(usr, "Input new destiniation x coordinate", "Coordinate input", dx) if(newx) dx = CLAMP(newx, 1, world.maxx) if(params["sety"]) - var/newy = input(usr, "Input new destiniation y coordinate", "Coordinate input", dy) as num|null + var/newy = tgui_input_number(usr, "Input new destiniation y coordinate", "Coordinate input", dy) if(newy) dy = CLAMP(newy, 1, world.maxy) . = TRUE @@ -356,13 +356,13 @@ . = TRUE if("speedlimit") - var/newlimit = input(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null + var/newlimit = tgui_input_number(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) if(newlimit) speedlimit = CLAMP(newlimit/1000, 0, 100) . = TRUE if("accellimit") - var/newlimit = input(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null + var/newlimit = tgui_input_number(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000) if(newlimit) accellimit = max(newlimit/1000, 0) . = TRUE @@ -402,7 +402,7 @@ . = TRUE if("set_global_limit") - var/newlim = input(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num + var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100, 100, 0) linked.thrust_limit = clamp(newlim/100, 0, 1) for(var/datum/ship_engine/E in linked.engines) E.set_thrust_limit(linked.thrust_limit) @@ -416,7 +416,7 @@ if("set_limit") var/datum/ship_engine/E = locate(params["engine"]) - var/newlim = input(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num + var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit(), 100, 0) var/limit = clamp(newlim/100, 0, 1) if(istype(E)) E.set_thrust_limit(limit) @@ -437,7 +437,7 @@ /* END ENGINES */ /* SENSORS */ if("range") - var/nrange = input(usr, "Set new sensors range", "Sensor range", sensors.range) as num|null + var/nrange = tgui_input_number(usr, "Set new sensors range", "Sensor range", sensors.range) if(nrange) sensors.set_range(CLAMP(nrange, 1, world.view)) . = TRUE diff --git a/code/modules/virus2/admin.dm b/code/modules/virus2/admin.dm index dd9ae7ead7..5ca289bd2a 100644 --- a/code/modules/virus2/admin.dm +++ b/code/modules/virus2/admin.dm @@ -129,12 +129,12 @@ s_multiplier[stage] = max(1, round(initial(E.maxm)/2)) else if(href_list["chance"]) var/datum/disease2/effect/Eff = s[stage] - var/I = input(usr, "Chance, per tick, of this effect happening (min 0, max [initial(Eff.chance_maxm)])", "Effect Chance", s_chance[stage]) as null|num + var/I = tgui_input_number(usr, "Chance, per tick, of this effect happening (min 0, max [initial(Eff.chance_maxm)])", "Effect Chance", s_chance[stage], initial(Eff.chance_maxm), 0) if(I == null || I < 0 || I > initial(Eff.chance_maxm)) return s_chance[stage] = I else if(href_list["multiplier"]) var/datum/disease2/effect/Eff = s[stage] - var/I = input(usr, "Multiplier for this effect (min 1, max [initial(Eff.maxm)])", "Effect Multiplier", s_multiplier[stage]) as null|num + var/I = tgui_input_number(usr, "Multiplier for this effect (min 1, max [initial(Eff.maxm)])", "Effect Multiplier", s_multiplier[stage], initial(Eff.maxm), 1) if(I == null || I < 1 || I > initial(Eff.maxm)) return s_multiplier[stage] = I if("species") @@ -150,7 +150,7 @@ if(!infectee.species || !(infectee.species.get_bodytype() in species)) infectee = null if("ichance") - var/I = input(usr, "Input infection chance", "Infection Chance", infectionchance) as null|num + var/I = tgui_input_number(usr, "Input infection chance", "Infection Chance", infectionchance) if(!I) return infectionchance = I if("stype") @@ -158,7 +158,7 @@ if(!S) return spreadtype = S if("speed") - var/S = input(usr, "Input speed", "Speed", speed) as null|num + var/S = tgui_input_number(usr, "Input speed", "Speed", speed) if(!S) return speed = S if("antigen") @@ -172,7 +172,7 @@ else if(href_list["reset"]) antigens = list() if("resistance") - var/S = input(usr, "Input % resistance to antibiotics", "Resistance", resistance) as null|num + var/S = tgui_input_number(usr, "Input % resistance to antibiotics", "Resistance", resistance) if(!S) return resistance = S if("infectee") diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 73befbce6e..c8ffea49cf 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -1025,7 +1025,7 @@ host.vore_selected.escapechance = sanitize_integer(escape_chance_input, 0, 100, initial(host.vore_selected.escapechance)) . = TRUE if("b_escapetime") - var/escape_time_input = input(user, "Set number of seconds for prey to escape on resist (1-60)", "Prey Escape Time") as num|null + var/escape_time_input = tgui_input_number(user, "Set number of seconds for prey to escape on resist (1-60)", "Prey Escape Time", null, 60, 1) if(!isnull(escape_time_input)) host.vore_selected.escapetime = sanitize_integer(escape_time_input*10, 10, 600, initial(host.vore_selected.escapetime)) . = TRUE