diff --git a/code/__HELPERS/hallucinations.dm b/code/__HELPERS/hallucinations.dm index 00fee61e2b1..d3d4a2630ed 100644 --- a/code/__HELPERS/hallucinations.dm +++ b/code/__HELPERS/hallucinations.dm @@ -250,7 +250,7 @@ ADMIN_VERB(debug_hallucination_weighted_list_per_type, R_DEBUG, "Show Hallucinat if(!custom_icon_state) return - var/custom_name = tgui_input_text(user, "What name should it show up as? (Can be empty)", "Custom Delusion: Name") + var/custom_name = tgui_input_text(user, "What name should it show up as? (Can be empty)", "Custom Delusion: Name", max_length = MAX_NAME_LEN) delusion_args += list( custom_icon_file = custom_icon_file, diff --git a/code/__HELPERS/hearted.dm b/code/__HELPERS/hearted.dm index adae298516e..d8f7832cbc0 100644 --- a/code/__HELPERS/hearted.dm +++ b/code/__HELPERS/hearted.dm @@ -45,11 +45,11 @@ var/heart_nominee switch(attempt) if(1) - heart_nominee = tgui_input_text(src, "What was their name? Just a first or last name may be enough.", "<3?") + heart_nominee = tgui_input_text(src, "What was their name? Just a first or last name may be enough.", "<3?", max_length = MAX_NAME_LEN) if(2) - heart_nominee = tgui_input_text(src, "Try again, what was their name? Just a first or last name may be enough.", "<3?") + heart_nominee = tgui_input_text(src, "Try again, what was their name? Just a first or last name may be enough.", "<3?", max_length = MAX_NAME_LEN) if(3) - heart_nominee = tgui_input_text(src, "One more try, what was their name? Just a first or last name may be enough.", "<3?") + heart_nominee = tgui_input_text(src, "One more try, what was their name? Just a first or last name may be enough.", "<3?", max_length = MAX_NAME_LEN) if(!heart_nominee) return diff --git a/code/datums/actions/mobs/personality_commune.dm b/code/datums/actions/mobs/personality_commune.dm index 26cf4834492..8481d451fb1 100644 --- a/code/datums/actions/mobs/personality_commune.dm +++ b/code/datums/actions/mobs/personality_commune.dm @@ -31,7 +31,7 @@ var/mob/living/split_personality/non_controller = usr var/client/non_controller_client = non_controller.client - var/to_send = tgui_input_text(non_controller, "What would you like to tell your other self?", "Commune") + var/to_send = tgui_input_text(non_controller, "What would you like to tell your other self?", "Commune", max_length = MAX_MESSAGE_LEN) if(QDELETED(src) || QDELETED(trauma) || !to_send) return FALSE diff --git a/code/datums/components/gps.dm b/code/datums/components/gps.dm index 7e52f00def7..0b3751856b8 100644 --- a/code/datums/components/gps.dm +++ b/code/datums/components/gps.dm @@ -162,7 +162,7 @@ GLOBAL_LIST_EMPTY(GPS_list) switch(action) if("rename") var/atom/parentasatom = parent - var/a = tgui_input_text(usr, "Enter the desired tag", "GPS Tag", gpstag, 20) + var/a = tgui_input_text(usr, "Enter the desired tag", "GPS Tag", gpstag, max_length = 20) if (QDELETED(ui) || ui.status != UI_INTERACTIVE) return if (!a) diff --git a/code/datums/components/mind_linker.dm b/code/datums/components/mind_linker.dm index 4449a8fe36e..f6b2af53297 100644 --- a/code/datums/components/mind_linker.dm +++ b/code/datums/components/mind_linker.dm @@ -242,7 +242,7 @@ var/datum/component/mind_linker/linker = target var/mob/living/linker_parent = linker.parent - var/message = tgui_input_text(owner, "Enter a message to transmit.", "[linker.network_name] Telepathy") + var/message = tgui_input_text(owner, "Enter a message to transmit.", "[linker.network_name] Telepathy", max_length = MAX_MESSAGE_LEN) if(!message || QDELETED(src) || QDELETED(owner) || owner.stat == DEAD) return diff --git a/code/game/machinery/camera/camera_construction.dm b/code/game/machinery/camera/camera_construction.dm index 15f22d02cbe..d6988617e1f 100644 --- a/code/game/machinery/camera/camera_construction.dm +++ b/code/game/machinery/camera/camera_construction.dm @@ -30,7 +30,7 @@ switch(camera_construction_state) if(CAMERA_STATE_WIRED) tool.play_tool_sound(src) - var/input = tgui_input_text(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret", "Set Network", "SS13") + var/input = tgui_input_text(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret", "Set Network", "SS13", max_length = MAX_NAME_LEN) if(isnull(input)) return ITEM_INTERACT_BLOCKING var/list/tempnetwork = splittext(input, ",") diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index d48b6297789..d7b9ac03dae 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -721,7 +721,7 @@ if(!GLOB.communications_controller.can_announce(user, is_ai)) to_chat(user, span_alert("Intercomms recharging. Please stand by.")) return - var/input = tgui_input_text(user, "Message to announce to the station crew", "Announcement") + var/input = tgui_input_text(user, "Message to announce to the station crew", "Announcement", max_length = MAX_MESSAGE_LEN) if(!input || !user.can_perform_action(src, ALLOW_SILICON_REACH)) return if(user.try_speak(input)) diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index e1612ae7ef2..da00fc35421 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -683,7 +683,7 @@ var/datum/mutation/human/target_mutation = get_mut_by_ref(bref, search_flags) // Prompt for modifier string - var/new_sequence_input = tgui_input_text(usr, "Enter a replacement sequence", "Inherent Gene Replacement", 32, encode = FALSE) + var/new_sequence_input = tgui_input_text(usr, "Enter a replacement sequence", "Inherent Gene Replacement", max_length = 32, encode = FALSE) // Drop out if the string is the wrong length if(length(new_sequence_input) != 32) return diff --git a/code/game/machinery/computer/records/records.dm b/code/game/machinery/computer/records/records.dm index d5389530043..7fd47887bc7 100644 --- a/code/game/machinery/computer/records/records.dm +++ b/code/game/machinery/computer/records/records.dm @@ -148,7 +148,7 @@ return FALSE var/trimmed = copytext(mugshot.name, 9, MAX_NAME_LEN) // Remove "photo - " - var/name = tgui_input_text(user, "Enter the name of the new record.", "New Record", trimmed, MAX_NAME_LEN) + var/name = tgui_input_text(user, "Enter the name of the new record.", "New Record", trimmed, max_length = MAX_NAME_LEN) if(!name || !is_operational || !user.can_perform_action(src, ALLOW_SILICON_REACH) || !mugshot || QDELETED(mugshot) || QDELETED(src)) return FALSE diff --git a/code/game/machinery/doors/passworddoor.dm b/code/game/machinery/doors/passworddoor.dm index bccc243381b..bf27dfcffc2 100644 --- a/code/game/machinery/doors/passworddoor.dm +++ b/code/game/machinery/doors/passworddoor.dm @@ -103,7 +103,7 @@ playsound(src, door_deny, 30, TRUE) /obj/machinery/door/password/proc/ask_for_pass(mob/user) - var/guess = tgui_input_text(user, "Enter the password", "Password") + var/guess = tgui_input_text(user, "Enter the password", "Password", max_length = MAX_MESSAGE_LEN) if(guess == password) return TRUE return FALSE diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index f6f4270835c..98149a82322 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -211,7 +211,7 @@ toggle_code(NAVBEACON_DELIVERY_MODE) return TRUE if("set_location") - var/input_text = tgui_input_text(user, "Enter the beacon's location tag", "Beacon Location", location, 20) + var/input_text = tgui_input_text(user, "Enter the beacon's location tag", "Beacon Location", location, max_length = 20) if (!input_text || location == input_text) return glob_lists_deregister() @@ -220,7 +220,7 @@ return TRUE if("set_patrol_next") var/next_patrol = codes[NAVBEACON_PATROL_NEXT] - var/input_text = tgui_input_text(user, "Enter the tag of the next patrol location", "Beacon Location", next_patrol, 20) + var/input_text = tgui_input_text(user, "Enter the tag of the next patrol location", "Beacon Location", next_patrol, max_length = 20) if (!input_text || location == input_text) return codes[NAVBEACON_PATROL_NEXT] = input_text diff --git a/code/game/machinery/newscaster/newscaster_machine.dm b/code/game/machinery/newscaster/newscaster_machine.dm index 3186d2081e5..aced87bfe58 100644 --- a/code/game/machinery/newscaster/newscaster_machine.dm +++ b/code/game/machinery/newscaster/newscaster_machine.dm @@ -405,14 +405,14 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/newscaster, 30) return TRUE if("setCriminalName") - var/temp_name = tgui_input_text(usr, "Write the Criminal's Name", "Warrent Alert Handler", "John Doe", MAX_NAME_LEN, multiline = FALSE) + var/temp_name = tgui_input_text(usr, "Write the Criminal's Name", "Warrent Alert Handler", "John Doe", max_length = MAX_NAME_LEN, multiline = FALSE) if(!temp_name) return TRUE criminal_name = temp_name return TRUE if("setCrimeData") - var/temp_desc = tgui_input_text(usr, "Write the Criminal's Crimes", "Warrent Alert Handler", "Unknown", MAX_BROADCAST_LEN, multiline = TRUE) + var/temp_desc = tgui_input_text(usr, "Write the Criminal's Crimes", "Warrent Alert Handler", "Unknown", max_length = MAX_BROADCAST_LEN, multiline = TRUE) if(!temp_desc) return TRUE crime_description = temp_desc @@ -703,7 +703,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/newscaster, 30) if(channel_name == potential_channel.channel_ID) current_channel = potential_channel break - var/temp_message = tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", feed_channel_message, multiline = TRUE) + var/temp_message = tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", feed_channel_message, max_length = MAX_BROADCAST_LEN, multiline = TRUE) if(length(temp_message) <= 1) return TRUE if(temp_message) diff --git a/code/game/machinery/newscaster/newspaper.dm b/code/game/machinery/newscaster/newspaper.dm index c381f2f5063..6bc1e6c77ff 100644 --- a/code/game/machinery/newscaster/newspaper.dm +++ b/code/game/machinery/newscaster/newspaper.dm @@ -84,7 +84,7 @@ if(scribble_page == current_page) user.balloon_alert(user, "already scribbled!") return - var/new_scribble_text = tgui_input_text(user, "What do you want to scribble?", "Write something") + var/new_scribble_text = tgui_input_text(user, "What do you want to scribble?", "Write something", max_length = MAX_MESSAGE_LEN) if(isnull(new_scribble_text)) return add_fingerprint(user) diff --git a/code/game/machinery/porta_turret/portable_turret_construct.dm b/code/game/machinery/porta_turret/portable_turret_construct.dm index a8fa4e67b2b..0ae7d9699ee 100644 --- a/code/game/machinery/porta_turret/portable_turret_construct.dm +++ b/code/game/machinery/porta_turret/portable_turret_construct.dm @@ -182,7 +182,7 @@ return if(used.get_writing_implement_details()?["interaction_mode"] == MODE_WRITING) //you can rename turrets like bots! - var/choice = tgui_input_text(user, "Enter a new turret name", "Turret Classification", finish_name, MAX_NAME_LEN) + var/choice = tgui_input_text(user, "Enter a new turret name", "Turret Classification", finish_name, max_length = MAX_NAME_LEN) if(!choice) return if(!user.can_perform_action(src)) diff --git a/code/game/machinery/roulette_machine.dm b/code/game/machinery/roulette_machine.dm index bb43b7a46db..3ef023ccb64 100644 --- a/code/game/machinery/roulette_machine.dm +++ b/code/game/machinery/roulette_machine.dm @@ -187,7 +187,7 @@ addtimer(CALLBACK(src, PROC_REF(play), user, player_card, chosen_bet_type, chosen_bet_amount, potential_payout), 4) //Animation first return TRUE else - var/msg = tgui_input_text(user, "Name of your roulette wheel", "Roulette Customization", "Roulette Machine", MAX_NAME_LEN) + var/msg = tgui_input_text(user, "Name of your roulette wheel", "Roulette Customization", "Roulette Machine", max_length = MAX_NAME_LEN) if(!msg) return name = msg @@ -456,7 +456,7 @@ "path" = /obj/structure/closet/supplypod/centcompod, "spawn" = /obj/machinery/roulette )) - + qdel(src) #undef ROULETTE_DOZ_COL_PAYOUT diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 3232dc524ab..9ff9c562aa0 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -711,12 +711,12 @@ var/name_set = FALSE var/desc_set = FALSE - var/str = tgui_input_text(user, "Personal Unit Name", "Unit Name") + var/str = tgui_input_text(user, "Personal Unit Name", "Unit Name", max_length = MAX_NAME_LEN) if(!isnull(str)) name = str name_set = TRUE - str = tgui_input_text(user, "Personal Unit Description", "Unit Description") + str = tgui_input_text(user, "Personal Unit Description", "Unit Description", max_length = MAX_DESC_LEN) if(!isnull(str)) desc = str desc_set = TRUE diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm index 4cbc3515713..1b3197e702d 100644 --- a/code/game/machinery/telecomms/computers/message.dm +++ b/code/game/machinery/telecomms/computers/message.dm @@ -180,10 +180,10 @@ notice_message = "NOTICE: Logs cleared." return TRUE if("set_key") - var/dkey = tgui_input_text(usr, "Please enter the decryption key", "Telecomms Decryption") + var/dkey = tgui_input_text(usr, "Please enter the decryption key", "Telecomms Decryption", max_length = 16) if(dkey && dkey != "") if(linkedServer.decryptkey == dkey) - var/newkey = tgui_input_text(usr, "Please enter the new key (3 - 16 characters max)", "New Key") + var/newkey = tgui_input_text(usr, "Please enter the new key (3 - 16 characters max)", "New Key", max_length = 16) if(length(newkey) <= 3) notice_message = "NOTICE: Decryption key too short!" else if(newkey && newkey != "") @@ -210,8 +210,8 @@ break return TRUE if("send_fake_message") - var/sender = tgui_input_text(usr, "What is the sender's name?", "Sender") - var/job = tgui_input_text(usr, "What is the sender's job?", "Job") + var/sender = tgui_input_text(usr, "What is the sender's name?", "Sender", max_length = MAX_NAME_LEN) + var/job = tgui_input_text(usr, "What is the sender's job?", "Job", max_length = 60) var/recipient var/list/tablet_to_messenger = list() @@ -229,7 +229,7 @@ else recipient = null - var/message = tgui_input_text(usr, "Please enter your message", "Message") + var/message = tgui_input_text(usr, "Please enter your message", "Message", max_length = MAX_MESSAGE_LEN) if(isnull(sender) || sender == "") sender = "UNKNOWN" diff --git a/code/game/objects/items/AI_modules/freeform.dm b/code/game/objects/items/AI_modules/freeform.dm index a0a91f7185e..05ef00c9467 100644 --- a/code/game/objects/items/AI_modules/freeform.dm +++ b/code/game/objects/items/AI_modules/freeform.dm @@ -8,7 +8,7 @@ laws = list("") /obj/item/ai_module/core/freeformcore/attack_self(mob/user) - var/targName = tgui_input_text(user, "Enter a new core law for the AI.", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len), TRUE) + var/targName = tgui_input_text(user, "Enter a new core law for the AI.", "Freeform Law Entry", laws[1], max_length = CONFIG_GET(number/max_law_len), multiline = TRUE) if(!targName || !user.is_holding(src)) return if(is_ic_filtered(targName)) @@ -37,7 +37,7 @@ if(!newpos || !user.is_holding(src) || !usr.can_perform_action(src, FORBID_TELEKINESIS_REACH)) return lawpos = newpos - var/targName = tgui_input_text(user, "Enter a new law for the AI.", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len), TRUE) + var/targName = tgui_input_text(user, "Enter a new law for the AI.", "Freeform Law Entry", laws[1], max_length = CONFIG_GET(number/max_law_len), multiline = TRUE) if(!targName || !user.is_holding(src)) return if(is_ic_filtered(targName)) diff --git a/code/game/objects/items/AI_modules/full_lawsets.dm b/code/game/objects/items/AI_modules/full_lawsets.dm index 30e904d45ac..593bc43f2dc 100644 --- a/code/game/objects/items/AI_modules/full_lawsets.dm +++ b/code/game/objects/items/AI_modules/full_lawsets.dm @@ -58,7 +58,7 @@ var/subject = "human being" /obj/item/ai_module/core/full/asimov/attack_self(mob/user as mob) - var/targName = tgui_input_text(user, "Enter a new subject that Asimov is concerned with.", "Asimov", subject, MAX_NAME_LEN) + var/targName = tgui_input_text(user, "Enter a new subject that Asimov is concerned with.", "Asimov", subject, max_length = MAX_NAME_LEN) if(!targName || !user.is_holding(src)) return subject = targName @@ -73,7 +73,7 @@ var/subject = "human being" /obj/item/ai_module/core/full/asimovpp/attack_self(mob/user) - var/target_name = tgui_input_text(user, "Enter a new subject that Asimov++ is concerned with.", "Asimov++", subject, MAX_NAME_LEN) + var/target_name = tgui_input_text(user, "Enter a new subject that Asimov++ is concerned with.", "Asimov++", subject, max_length = MAX_NAME_LEN) if(!target_name || !user.is_holding(src)) return laws.Cut() diff --git a/code/game/objects/items/AI_modules/hacked.dm b/code/game/objects/items/AI_modules/hacked.dm index fafde17acb5..41a1f38ba89 100644 --- a/code/game/objects/items/AI_modules/hacked.dm +++ b/code/game/objects/items/AI_modules/hacked.dm @@ -4,7 +4,7 @@ laws = list("") /obj/item/ai_module/syndicate/attack_self(mob/user) - var/targName = tgui_input_text(user, "Enter a new law for the AI", "Freeform Law Entry", laws[1], CONFIG_GET(number/max_law_len), TRUE) + var/targName = tgui_input_text(user, "Enter a new law for the AI", "Freeform Law Entry", laws[1], max_length = CONFIG_GET(number/max_law_len), multiline = TRUE) if(!targName || !user.is_holding(src)) return if(is_ic_filtered(targName)) // not even the syndicate can uwu diff --git a/code/game/objects/items/AI_modules/supplied.dm b/code/game/objects/items/AI_modules/supplied.dm index b53e16a86b0..76f47157306 100644 --- a/code/game/objects/items/AI_modules/supplied.dm +++ b/code/game/objects/items/AI_modules/supplied.dm @@ -27,7 +27,7 @@ lawpos = 4 /obj/item/ai_module/supplied/safeguard/attack_self(mob/user) - var/targName = tgui_input_text(user, "Subject to safeguard.", "Safeguard", user.name, MAX_NAME_LEN) + var/targName = tgui_input_text(user, "Subject to safeguard.", "Safeguard", user.name, max_length = MAX_NAME_LEN) if(!targName || !user.is_holding(src)) return targetName = targName diff --git a/code/game/objects/items/AI_modules/zeroth.dm b/code/game/objects/items/AI_modules/zeroth.dm index 74fc7ab8232..480735bfe2f 100644 --- a/code/game/objects/items/AI_modules/zeroth.dm +++ b/code/game/objects/items/AI_modules/zeroth.dm @@ -25,7 +25,7 @@ laws = list("Only SUBJECT is human.") /obj/item/ai_module/zeroth/onehuman/attack_self(mob/user) - var/targName = tgui_input_text(user, "Enter the subject who is the only human.", "One Human", user.real_name, MAX_NAME_LEN) + var/targName = tgui_input_text(user, "Enter the subject who is the only human.", "One Human", user.real_name, max_length = MAX_NAME_LEN) if(!targName || !user.is_holding(src)) return targetName = targName diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index d1742eeeeb2..b28acce35d4 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -1699,8 +1699,9 @@ to_chat(user, span_notice("You successfully reset the ID card.")) return - ///forge the ID if not forged. - var/input_name = tgui_input_text(user, "What name would you like to put on this card? Leave blank to randomise.", "Agent card name", registered_name ? registered_name : (ishuman(user) ? user.real_name : user.name), MAX_NAME_LEN, encode = FALSE) + ///forge the ID if not forged.s + var/input_name = tgui_input_text(user, "What name would you like to put on this card? Leave blank to randomise.", "Agent card name", registered_name ? registered_name : (ishuman(user) ? user.real_name : user.name), max_length = MAX_NAME_LEN, encode = FALSE) + if(!after_input_check(user)) return TRUE if(input_name) @@ -1730,7 +1731,7 @@ if(!after_input_check(user)) return TRUE - var/target_occupation = tgui_input_text(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels.", "Agent card job assignment", assignment ? assignment : "Assistant", MAX_NAME_LEN) + var/target_occupation = tgui_input_text(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels.", "Agent card job assignment", assignment ? assignment : "Assistant", max_length = MAX_NAME_LEN) if(!after_input_check(user)) return TRUE @@ -1884,15 +1885,15 @@ return switch(popup_input) if("Name") - var/input_name = tgui_input_text(user, "What name would you like to put on this card?", "Cardboard card name", scribbled_name || (ishuman(user) ? user.real_name : user.name), MAX_NAME_LEN) - input_name = sanitize_name(input_name, allow_numbers = TRUE) + var/raw_input = tgui_input_text(user, "What name would you like to put on this card?", "Cardboard card name", scribbled_name || (ishuman(user) ? user.real_name : user.name), max_length = MAX_NAME_LEN) + var/input_name = sanitize_name(raw_input, allow_numbers = TRUE) if(!after_input_check(user, item, input_name, scribbled_name)) return scribbled_name = input_name var/list/details = item.get_writing_implement_details() details_colors[INDEX_NAME_COLOR] = details["color"] || COLOR_BLACK if("Assignment") - var/input_assignment = tgui_input_text(user, "What assignment would you like to put on this card?", "Cardboard card job ssignment", scribbled_assignment || "Assistant", MAX_NAME_LEN) + var/input_assignment = tgui_input_text(user, "What assignment would you like to put on this card?", "Cardboard card job ssignment", scribbled_assignment || "Assistant", max_length = MAX_NAME_LEN) if(!after_input_check(user, item, input_assignment, scribbled_assignment)) return scribbled_assignment = sanitize(input_assignment) diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 484cb54b0e3..03c79049b30 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -402,7 +402,7 @@ set_painting_tool_color(paint_color) . = TRUE if("enter_text") - var/txt = tgui_input_text(usr, "Choose what to write", "Scribbles", text_buffer) + var/txt = tgui_input_text(usr, "Choose what to write", "Scribbles", text_buffer, max_length = MAX_MESSAGE_LEN) if(isnull(txt)) return txt = crayon_text_strip(txt) diff --git a/code/game/objects/items/eightball.dm b/code/game/objects/items/eightball.dm index 4445cdd1b72..40f08e78ffc 100644 --- a/code/game/objects/items/eightball.dm +++ b/code/game/objects/items/eightball.dm @@ -153,7 +153,7 @@ /obj/item/toy/eightball/haunted/start_shaking(mob/user) // notify ghosts that someone's shaking a haunted eightball // and inform them of the message, (hopefully a yes/no question) - selected_message = tgui_input_text(user, "What is your question?", "Eightball") || initial(selected_message) + selected_message = tgui_input_text(user, "What is your question?", "Eightball", max_length = MAX_MESSAGE_LEN) || initial(selected_message) if (!(src in user.held_items)) return FALSE notify_ghosts( diff --git a/code/game/objects/items/implants/security/implant_track.dm b/code/game/objects/items/implants/security/implant_track.dm index b95c0afa7d8..9b8050d7dad 100644 --- a/code/game/objects/items/implants/security/implant_track.dm +++ b/code/game/objects/items/implants/security/implant_track.dm @@ -48,7 +48,7 @@ return if(params["implant_action"] == "warn") - var/warning = tgui_input_text(user, "What warning do you want to send to [imp_in.name]?", "Messaging") + var/warning = tgui_input_text(user, "What warning do you want to send to [imp_in.name]?", "Messaging", max_length = MAX_MESSAGE_LEN) if(!warning || QDELETED(src) || QDELETED(user) || QDELETED(console) || isnull(imp_in)) return TRUE if(!console.is_operational || !user.can_perform_action(console, NEED_DEXTERITY|ALLOW_SILICON_REACH)) diff --git a/code/game/objects/items/mail.dm b/code/game/objects/items/mail.dm index 2aec4781624..26cefd6eeed 100644 --- a/code/game/objects/items/mail.dm +++ b/code/game/objects/items/mail.dm @@ -548,10 +548,10 @@ shady_mail.made_by_cached_name = user.mind.name if(index == 1) - var/mail_name = tgui_input_text(user, "Enter mail title, or leave it blank", "Mail Counterfeiting") + var/mail_name = tgui_input_text(user, "Enter mail title, or leave it blank", "Mail Counterfeiting", max_length = MAX_LABEL_LEN) if(!(src in user.contents)) return FALSE - if(reject_bad_text(mail_name, ascii_only = FALSE)) + if(reject_bad_text(mail_name, max_length = MAX_LABEL_LEN, ascii_only = FALSE)) shady_mail.name = mail_name else shady_mail.name = mail_type diff --git a/code/game/objects/items/tcg/tcg_machines.dm b/code/game/objects/items/tcg/tcg_machines.dm index 77b6891e4c1..7a55e2e9554 100644 --- a/code/game/objects/items/tcg/tcg_machines.dm +++ b/code/game/objects/items/tcg/tcg_machines.dm @@ -90,7 +90,7 @@ GLOBAL_LIST_EMPTY(tcgcard_machine_radial_choices) /obj/machinery/trading_card_holder/attack_hand_secondary(mob/user) if(isnull(current_summon)) - var/card_name = tgui_input_text(user, "Insert card name", "Blank Card Naming", "blank card", MAX_NAME_LEN) + var/card_name = tgui_input_text(user, "Insert card name", "Blank Card Naming", "blank card", max_length = MAX_NAME_LEN) if(isnull(card_name) || !user.can_perform_action(src)) return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN current_summon = new /obj/structure/trading_card_summon/blank(locate(x + summon_offset_x, y + summon_offset_y, z)) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 097fa6d0c3e..139a3fcb216 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -1404,7 +1404,7 @@ //Add changing looks when i feel suicidal about making 20 inhands for these. /obj/item/toy/dummy/attack_self(mob/user) - var/new_name = tgui_input_text(usr, "What would you like to name the dummy?", "Doll Name", doll_name, MAX_NAME_LEN) + var/new_name = tgui_input_text(usr, "What would you like to name the dummy?", "Doll Name", doll_name, max_length = MAX_NAME_LEN) if(!new_name || !user.is_holding(src)) return doll_name = new_name diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 902eef6da17..c4740398d82 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -830,14 +830,17 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets) var/name_set = FALSE var/desc_set = FALSE - var/str = tgui_input_text(user, "Locker Name", "Locker Name") - if(!isnull(str)) - name = str + + var/input_name = tgui_input_text(user, "Locker Name", "Locker Name", max_length = MAX_NAME_LEN) + + if(!isnull(input_name)) + name = input_name name_set = TRUE - str = tgui_input_text(user, "Locker Description", "Locker Description") - if(!isnull(str)) - desc = str + var/input_desc = tgui_input_text(user, "Locker Description", "Locker Description", max_length = MAX_DESC_LEN) + + if(!isnull(input_desc)) + desc = input_desc desc_set = TRUE var/bit_flag = NONE diff --git a/code/game/objects/structures/detectiveboard.dm b/code/game/objects/structures/detectiveboard.dm index f9d0560dfde..27c11cda5a0 100644 --- a/code/game/objects/structures/detectiveboard.dm +++ b/code/game/objects/structures/detectiveboard.dm @@ -50,11 +50,11 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/detectiveboard, 32) to_chat(user, "You already attaching evidence!") return attaching_evidence = TRUE - var/name = tgui_input_text(user, "Please enter the evidence name", "Detective's Board") + var/name = tgui_input_text(user, "Please enter the evidence name", "Detective's Board", max_length = MAX_NAME_LEN) if(!name) attaching_evidence = FALSE return - var/desc = tgui_input_text(user, "Please enter the evidence description", "Detective's Board") + var/desc = tgui_input_text(user, "Please enter the evidence description", "Detective's Board", max_length = MAX_DESC_LEN) if(!desc) attaching_evidence = FALSE return @@ -146,7 +146,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/detectiveboard, 32) if("add_case") if(cases.len == MAX_CASES) return FALSE - var/new_case = tgui_input_text(user, "Please enter the case name", "Detective's Board") + var/new_case = tgui_input_text(user, "Please enter the case name", "Detective's Board", max_length = MAX_NAME_LEN) if(!new_case) return FALSE var/case_color = tgui_input_list(user, "Please choose case color", "Detective's Board", case_colors) @@ -173,7 +173,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/detectiveboard, 32) update_appearance(UPDATE_ICON) return TRUE if("rename_case") - var/new_name = tgui_input_text(user, "Please ender the case new name", "Detective's Board") + var/new_name = tgui_input_text(user, "Please enter the new name for the case", "Detective's Board", max_length = MAX_NAME_LEN) if(new_name) var/datum/case/case = locate(params["case_ref"]) in cases case.name = new_name diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 239af48c202..03957e2708b 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -426,7 +426,7 @@ return if("change_message") if(showpiece && !holographic_showpiece) - var/new_trophy_message = tgui_input_text(usr, "Let's make history!", "Trophy Message", trophy_message, MAX_PLAQUE_LEN) + var/new_trophy_message = tgui_input_text(usr, "Let's make history!", "Trophy Message", trophy_message, max_length = MAX_PLAQUE_LEN) if(!new_trophy_message) return trophy_message = new_trophy_message diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 9493a7c9414..c2d67e62901 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -83,7 +83,7 @@ /obj/structure/door_assembly/attackby(obj/item/W, mob/living/user, params) if(IS_WRITING_UTENSIL(W) && !user.combat_mode) - var/t = tgui_input_text(user, "Enter the name for the door", "Airlock Renaming", created_name, MAX_NAME_LEN) + var/t = tgui_input_text(user, "Enter the name for the door", "Airlock Renaming", created_name, max_length = MAX_NAME_LEN) if(!t) return if(!in_range(src, usr) && loc != usr) diff --git a/code/game/objects/structures/plaques/_plaques.dm b/code/game/objects/structures/plaques/_plaques.dm index 1277869dbf6..951a538e724 100644 --- a/code/game/objects/structures/plaques/_plaques.dm +++ b/code/game/objects/structures/plaques/_plaques.dm @@ -88,7 +88,7 @@ var/namechoice = tgui_input_text(user, "Title this plaque. (e.g. 'Best HoP Award', 'Great Ashwalker War Memorial')", "Plaque Customization", max_length = MAX_NAME_LEN) if(!namechoice) return - var/descriptionchoice = tgui_input_text(user, "Engrave this plaque's text", "Plaque Customization") + var/descriptionchoice = tgui_input_text(user, "Engrave this plaque's text", "Plaque Customization", max_length = MAX_PLAQUE_LEN) if(!descriptionchoice) return if(!Adjacent(user)) //Make sure user is adjacent still @@ -161,7 +161,7 @@ var/namechoice = tgui_input_text(user, "Title this plaque. (e.g. 'Best HoP Award', 'Great Ashwalker War Memorial')", "Plaque Customization", max_length = MAX_NAME_LEN) if(!namechoice) return - var/descriptionchoice = tgui_input_text(user, "Engrave this plaque's text", "Plaque Customization") + var/descriptionchoice = tgui_input_text(user, "Engrave this plaque's text", "Plaque Customization", max_length = MAX_PLAQUE_LEN) if(!descriptionchoice) return if(!Adjacent(user)) //Make sure user is adjacent still diff --git a/code/game/objects/structures/votingbox.dm b/code/game/objects/structures/votingbox.dm index 42ccd625093..55909978fe2 100644 --- a/code/game/objects/structures/votingbox.dm +++ b/code/game/objects/structures/votingbox.dm @@ -94,7 +94,7 @@ ui_interact(user) /obj/structure/votebox/proc/set_description(mob/user) - var/new_description = tgui_input_text(user, "Enter a new description", "Vote Description", vote_description, multiline = TRUE) + var/new_description = tgui_input_text(user, "Enter a new description", "Vote Description", vote_description, multiline = TRUE, max_length = MAX_DESC_LEN) if(new_description) vote_description = new_description diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 4c22cbf01b2..4ff29eb606e 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -252,7 +252,7 @@ ae.forceMove(drop_location()) else if(IS_WRITING_UTENSIL(W)) - var/t = tgui_input_text(user, "Enter the name for the door", "Windoor Renaming", created_name, MAX_NAME_LEN) + var/t = tgui_input_text(user, "Enter the name for the door", "Windoor Renaming", created_name, max_length = MAX_NAME_LEN) if(!t) return if(!in_range(src, usr) && loc != usr) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index adb737612df..1510783fc7c 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -320,7 +320,7 @@ ADMIN_VERB(give_mob_action, R_FUN, "Give Mob Action", ADMIN_VERB_NO_DESCRIPTION, if(isnull(ability_melee_cooldown) || ability_melee_cooldown < 0) ability_melee_cooldown = 2 add_ability.melee_cooldown_time = ability_melee_cooldown * 1 SECONDS - add_ability.name = tgui_input_text(user, "Choose ability name", "Ability name", "Generic Ability") + add_ability.name = tgui_input_text(user, "Choose ability name", "Ability name", "Generic Ability", max_length = MAX_NAME_LEN) add_ability.create_sequence_actions() else add_ability = new ability_type(ability_recipient) diff --git a/code/modules/admin/outfit_editor.dm b/code/modules/admin/outfit_editor.dm index 67196c54bd4..a3bd433f52e 100644 --- a/code/modules/admin/outfit_editor.dm +++ b/code/modules/admin/outfit_editor.dm @@ -100,7 +100,7 @@ drip.vars[slot] = null if("rename") - var/newname = tgui_input_text(owner, "What do you want to name this outfit?", OUTFIT_EDITOR_NAME) + var/newname = tgui_input_text(owner, "What do you want to name this outfit?", OUTFIT_EDITOR_NAME, max_length = MAX_NAME_LEN) if(newname) drip.name = newname if("save") diff --git a/code/modules/admin/painting_manager.dm b/code/modules/admin/painting_manager.dm index 7a8bd7127a4..5ebcdef0059 100644 --- a/code/modules/admin/painting_manager.dm +++ b/code/modules/admin/painting_manager.dm @@ -55,7 +55,7 @@ ADMIN_VERB(painting_manager, R_ADMIN, "Paintings Manager", "View and redact pain if("rename") //Modify the metadata var/old_title = chosen_painting.title - var/new_title = tgui_input_text(user, "New painting title?", "Painting Rename", chosen_painting.title) + var/new_title = tgui_input_text(user, "New painting title?", "Painting Rename", chosen_painting.title, max_length = MAX_NAME_LEN) if(!new_title) return chosen_painting.title = new_title @@ -63,7 +63,7 @@ ADMIN_VERB(painting_manager, R_ADMIN, "Paintings Manager", "View and redact pain return TRUE if("rename_author") var/old_name = chosen_painting.creator_name - var/new_name = tgui_input_text(user, "New painting author name?", "Painting Rename", chosen_painting.creator_name) + var/new_name = tgui_input_text(user, "New painting author name?", "Painting Rename", chosen_painting.creator_name, max_length = MAX_NAME_LEN) if(!new_name) return chosen_painting.creator_name = new_name @@ -83,7 +83,7 @@ ADMIN_VERB(painting_manager, R_ADMIN, "Paintings Manager", "View and redact pain log_admin("[key_name(user)] has removed tag [params["tag"]] from persistent painting made by [chosen_painting.creator_ckey] with id [chosen_painting.md5].") return TRUE if("add_tag") - var/tag_name = tgui_input_text(user, "New tag name?", "Add Tag") + var/tag_name = tgui_input_text(user, "New tag name?", "Add Tag", max_length = MAX_NAME_LEN) if(!tag_name) return if(!chosen_painting.tags) diff --git a/code/modules/admin/sound_emitter.dm b/code/modules/admin/sound_emitter.dm index d697537c6df..c68baa32e4e 100644 --- a/code/modules/admin/sound_emitter.dm +++ b/code/modules/admin/sound_emitter.dm @@ -81,7 +81,7 @@ return var/mob/user = usr if(href_list["edit_label"]) - var/new_label = tgui_input_text(user, "Choose a new label", "Sound Emitter") + var/new_label = tgui_input_text(user, "Choose a new label", "Sound Emitter", max_length = MAX_NAME_LEN) if(!new_label) return maptext = MAPTEXT(new_label) diff --git a/code/modules/admin/verbs/admin_newscaster.dm b/code/modules/admin/verbs/admin_newscaster.dm index 4cb7b5c3344..b1be5560d69 100644 --- a/code/modules/admin/verbs/admin_newscaster.dm +++ b/code/modules/admin/verbs/admin_newscaster.dm @@ -234,14 +234,14 @@ ADMIN_VERB(access_news_network, R_ADMIN, "Access Newscaster Network", "Allows yo return TRUE if("setCriminalName") - var/temp_name = tgui_input_text(usr, "Write the Criminal's Name", "Warrent Alert Handler", "John Doe", MAX_NAME_LEN, multiline = FALSE) + var/temp_name = tgui_input_text(usr, "Write the Criminal's Name", "Warrent Alert Handler", "John Doe", max_length = MAX_NAME_LEN, multiline = FALSE) if(!temp_name) return TRUE criminal_name = temp_name return TRUE if("setCrimeData") - var/temp_desc = tgui_input_text(usr, "Write the Criminal's Crimes", "Warrent Alert Handler", "Unknown", MAX_BROADCAST_LEN, multiline = TRUE) + var/temp_desc = tgui_input_text(usr, "Write the Criminal's Crimes", "Warrent Alert Handler", "Unknown", max_length = MAX_BROADCAST_LEN, multiline = TRUE) if(!temp_desc) return TRUE crime_description = temp_desc @@ -339,7 +339,7 @@ ADMIN_VERB(access_news_network, R_ADMIN, "Access Newscaster Network", "Allows yo if(channel_name == potential_channel.channel_ID) current_channel = potential_channel break - var/temp_message = tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", feed_channel_message, multiline = TRUE) + var/temp_message = tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", feed_channel_message, max_length = MAX_BROADCAST_LEN, multiline = TRUE) if(length(temp_message) <= 1) return TRUE if(temp_message) diff --git a/code/modules/admin/verbs/adminevents.dm b/code/modules/admin/verbs/adminevents.dm index 214cf653d4e..d2eeba90262 100644 --- a/code/modules/admin/verbs/adminevents.dm +++ b/code/modules/admin/verbs/adminevents.dm @@ -269,13 +269,21 @@ ADMIN_VERB(command_report_footnote, R_ADMIN, "Command Report Footnote", "Adds a var/datum/command_footnote/command_report_footnote = new /datum/command_footnote() GLOB.communications_controller.block_command_report += 1 //Add a blocking condition to the counter until the inputs are done. - command_report_footnote.message = tgui_input_text(user, "This message will be attached to the bottom of the roundstart threat report. Be sure to delay the roundstart report if you need extra time.", "P.S.") + command_report_footnote.message = tgui_input_text( + user, + "This message will be attached to the bottom of the roundstart threat report. Be sure to delay the roundstart report if you need extra time.", + "P.S.", + ) if(!command_report_footnote.message) GLOB.communications_controller.block_command_report -= 1 qdel(command_report_footnote) return - command_report_footnote.signature = tgui_input_text(user, "Whose signature will appear on this footnote?", "Also sign here, here, aaand here.") + command_report_footnote.signature = tgui_input_text( + user, + "Whose signature will appear on this footnote?", + "Also sign here, here, aaand here.", + ) if(!command_report_footnote.signature) command_report_footnote.signature = "Classified" diff --git a/code/modules/admin/verbs/lawpanel.dm b/code/modules/admin/verbs/lawpanel.dm index f1daaf17576..6de3ff70182 100644 --- a/code/modules/admin/verbs/lawpanel.dm +++ b/code/modules/admin/verbs/lawpanel.dm @@ -24,7 +24,7 @@ ADMIN_VERB(law_panel, R_ADMIN, "Law Panel", "View the AI laws.", ADMIN_CATEGORY_ var/lawtype = tgui_input_list(user, "Select law type", "Law type", lawtypes) if(isnull(lawtype)) return FALSE - var/lawtext = tgui_input_text(user, "Input law text", "Law text") + var/lawtext = tgui_input_text(user, "Input law text", "Law text") // admin verb so no max length and also any user-level input is config based already so ehhhh if(!lawtext) return FALSE if(QDELETED(src) || QDELETED(borgo)) diff --git a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm index 5a8f699832e..ab1636b4ded 100644 --- a/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm +++ b/code/modules/antagonists/abductor/equipment/gear/abductor_items.dm @@ -189,8 +189,12 @@ to_chat(user, span_warning("Your target is already under a mind-controlling influence!")) return - var/command = tgui_input_text(user, "Enter the command for your target to follow.\ - Uses Left: [target_gland.mind_control_uses], Duration: [DisplayTimeText(target_gland.mind_control_duration)]", "Enter command") + var/command = tgui_input_text( + user, + "Enter the command for your target to follow. Uses Left: [target_gland.mind_control_uses], Duration: [DisplayTimeText(target_gland.mind_control_duration)]", + "Enter command", + max_length = MAX_MESSAGE_LEN, + ) if(!command) return @@ -215,7 +219,7 @@ if(living_target.stat == DEAD) to_chat(user, span_warning("Your target is dead!")) return - var/message = tgui_input_text(user, "Message to send to your target's brain", "Enter message") + var/message = tgui_input_text(user, "Message to send to your target's brain", "Enter message", max_length = MAX_MESSAGE_LEN) if(!message) return if(QDELETED(living_target) || living_target.stat == DEAD) diff --git a/code/modules/antagonists/brainwashing/brainwashing.dm b/code/modules/antagonists/brainwashing/brainwashing.dm index 57707688f4d..5d5cca3cb6d 100644 --- a/code/modules/antagonists/brainwashing/brainwashing.dm +++ b/code/modules/antagonists/brainwashing/brainwashing.dm @@ -61,7 +61,7 @@ return var/list/objectives = list() do - var/objective = tgui_input_text(admin, "Add an objective", "Brainwashing") + var/objective = tgui_input_text(admin, "Add an objective", "Brainwashing", max_length = MAX_MESSAGE_LEN) if(objective) objectives += objective while(tgui_alert(admin, "Add another objective?", "More Brainwashing", list("Yes","No")) == "Yes") diff --git a/code/modules/antagonists/cult/cult_comms.dm b/code/modules/antagonists/cult/cult_comms.dm index 3d567799650..45c3aee6955 100644 --- a/code/modules/antagonists/cult/cult_comms.dm +++ b/code/modules/antagonists/cult/cult_comms.dm @@ -27,7 +27,7 @@ return ..() /datum/action/innate/cult/comm/Activate() - var/input = tgui_input_text(usr, "Message to tell to the other acolytes", "Voice of Blood") + var/input = tgui_input_text(usr, "Message to tell to the other acolytes", "Voice of Blood", max_length = MAX_MESSAGE_LEN) if(!input || !IsAvailable(feedback = TRUE)) return diff --git a/code/modules/antagonists/nukeop/datums/operative_leader.dm b/code/modules/antagonists/nukeop/datums/operative_leader.dm index c2995e55753..1af9f1d28c4 100644 --- a/code/modules/antagonists/nukeop/datums/operative_leader.dm +++ b/code/modules/antagonists/nukeop/datums/operative_leader.dm @@ -44,7 +44,13 @@ /datum/antagonist/nukeop/leader/proc/ask_name() var/randomname = pick(GLOB.last_names) - var/newname = tgui_input_text(owner.current, "You are the nuclear operative [title]. Please choose a last name for your family.", "Name change", randomname, MAX_NAME_LEN) + var/newname = tgui_input_text( + owner.current, + "You are the nuclear operative [title]. Please choose a last name for your family.", + "Name change", + randomname, + max_length = MAX_NAME_LEN, + ) if (!newname) newname = randomname else diff --git a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm index 0160fbd8914..b59d984238e 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm @@ -43,7 +43,7 @@ GLOBAL_LIST_EMPTY(jam_on_wardec) if(custom_threat == "Yes") declaring_war = TRUE - war_declaration = tgui_input_text(user, "Insert your custom declaration", "Declaration", multiline = TRUE, encode = FALSE) + war_declaration = tgui_input_text(user, "Insert your custom declaration", "Declaration", max_length = MAX_MESSAGE_LEN, multiline = TRUE, encode = FALSE) declaring_war = FALSE if(!check_allowed(user) || !war_declaration) @@ -63,7 +63,7 @@ GLOBAL_LIST_EMPTY(jam_on_wardec) var/custom_threat = tgui_alert(usr, "Do you want to customize the declaration?", "Customize?", list("Yes", "No")) if(custom_threat == "Yes") - war_declaration = tgui_input_text(usr, "Insert your custom declaration", "Declaration", multiline = TRUE, encode = FALSE) + war_declaration = tgui_input_text(usr, "Insert your custom declaration", "Declaration", max_length = MAX_MESSAGE_LEN, multiline = TRUE, encode = FALSE) if(!war_declaration) tgui_alert(usr, "Invalid war declaration.", "Poor Choice of Words") diff --git a/code/modules/antagonists/wizard/equipment/spellbook_entries/summons.dm b/code/modules/antagonists/wizard/equipment/spellbook_entries/summons.dm index fe5f69fd9fa..b8bf9a8e3cf 100644 --- a/code/modules/antagonists/wizard/equipment/spellbook_entries/summons.dm +++ b/code/modules/antagonists/wizard/equipment/spellbook_entries/summons.dm @@ -74,7 +74,7 @@ cost = 4 /datum/spellbook_entry/summon/curse_of_madness/buy_spell(mob/living/carbon/human/user, obj/item/spellbook/book, log_buy = TRUE) - var/message = tgui_input_text(user, "Whisper a secret truth to drive your victims to madness", "Whispers of Madness") + var/message = tgui_input_text(user, "Whisper a secret truth to drive your victims to madness", "Whispers of Madness", max_length = MAX_MESSAGE_LEN) if(!message || QDELETED(user) || QDELETED(book) || !can_buy(user, book)) return FALSE curse_of_madness(user, message) diff --git a/code/modules/art/paintings.dm b/code/modules/art/paintings.dm index 2e330d31185..1c11e0f8086 100644 --- a/code/modules/art/paintings.dm +++ b/code/modules/art/paintings.dm @@ -417,7 +417,7 @@ /obj/item/canvas/proc/try_rename(mob/user) if(painting_metadata.loaded_from_json) // No renaming old paintings return TRUE - var/new_name = tgui_input_text(user, "What do you want to name the painting?", "Title Your Masterpiece", null, MAX_NAME_LEN) + var/new_name = tgui_input_text(user, "What do you want to name the painting?", "Title Your Masterpiece", max_length = MAX_NAME_LEN) new_name = reject_bad_name(new_name, allow_numbers = TRUE, ascii_only = FALSE, strict = TRUE, cap_after_symbols = FALSE) if(isnull(new_name)) return FALSE diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index cd867615876..179ca701adc 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -343,10 +343,10 @@ ADMIN_VERB(centcom_podlauncher, R_ADMIN, "Config/Launch Supplypod", "Configure a temp_pod.adminNamed = FALSE temp_pod.setStyle(temp_pod.style) //This resets the name of the pod based on its current style (see supplypod/setStyle() proc) return - var/nameInput= tgui_input_text(usr, "Enter a custom name", "Custom name", temp_pod.style::name, MAX_NAME_LEN) //Gather input for name and desc + var/nameInput= tgui_input_text(usr, "Enter a custom name", "Custom name", temp_pod.style::name, max_length = MAX_NAME_LEN) if (isnull(nameInput)) return - var/descInput = tgui_input_text(usr, "Enter a custom desc", "Custom description", temp_pod.style::desc) + var/descInput = tgui_input_text(usr, "Enter a custom desc", "Custom description", temp_pod.style::desc, max_length = MAX_DESC_LEN) if (isnull(descInput)) return temp_pod.name = nameInput diff --git a/code/modules/cargo/orderconsole.dm b/code/modules/cargo/orderconsole.dm index 7b37ab00d80..ac37511f789 100644 --- a/code/modules/cargo/orderconsole.dm +++ b/code/modules/cargo/orderconsole.dm @@ -235,7 +235,7 @@ var/reason = "" if(requestonly && !self_paid) working_list = SSshuttle.request_list - reason = tgui_input_text(user, "Reason", name) + reason = tgui_input_text(user, "Reason", name, max_length = MAX_MESSAGE_LEN) if(isnull(reason)) return diff --git a/code/modules/clothing/under/accessories/badges.dm b/code/modules/clothing/under/accessories/badges.dm index cc66e9d406a..b43196c1628 100644 --- a/code/modules/clothing/under/accessories/badges.dm +++ b/code/modules/clothing/under/accessories/badges.dm @@ -264,9 +264,9 @@ /obj/item/clothing/accessory/press_badge/attack_self(mob/user, modifiers) . = ..() if(!journalist_name) - journalist_name = tgui_input_text(user, "What is your name?", "Journalist Name", "[user.name]", MAX_NAME_LEN) + journalist_name = tgui_input_text(user, "What is your name?", "Journalist Name", "[user.name]", max_length = MAX_NAME_LEN) if(!press_name) - press_name = tgui_input_text(user, "For what organization you work?", "Press Name", "Nanotrasen", MAX_CHARTER_LEN) + press_name = tgui_input_text(user, "For what organization you work?", "Press Name", "Nanotrasen", max_length = MAX_CHARTER_LEN) /obj/item/clothing/accessory/press_badge/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers) . = ..() diff --git a/code/modules/emote_panel/emote_panel.dm b/code/modules/emote_panel/emote_panel.dm index 72caf05e92b..d064161c232 100644 --- a/code/modules/emote_panel/emote_panel.dm +++ b/code/modules/emote_panel/emote_panel.dm @@ -42,7 +42,7 @@ var/datum/emote/emote = GLOB.emote_list[emote_key][1] var/emote_param if(emote.message_param && use_params) - emote_param = tgui_input_text(ui.user, "Add params to the emote...", emote.message_param) + emote_param = tgui_input_text(ui.user, "Add params to the emote...", emote.message_param, max_length = MAX_MESSAGE_LEN) ui.user.emote(emote_key, message = emote_param, intentional = TRUE) /datum/emote_panel/ui_interact(mob/user, datum/tgui/ui) diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 18197c006b5..86847f01173 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -470,7 +470,7 @@ return switch(choice) if("Plant Name") - var/newplantname = reject_bad_text(tgui_input_text(user, "Write a new plant name", "Plant Name", plantname, 20)) + var/newplantname = reject_bad_text(tgui_input_text(user, "Write a new plant name", "Plant Name", plantname, max_length = MAX_NAME_LEN)) if(isnull(newplantname)) return if(!user.can_perform_action(src)) @@ -478,7 +478,7 @@ name = "[LOWER_TEXT(newplantname)]" plantname = newplantname if("Seed Description") - var/newdesc = tgui_input_text(user, "Write a new seed description", "Seed Description", desc, 180) + var/newdesc = tgui_input_text(user, "Write a new seed description", "Seed Description", desc, max_length = MAX_DESC_LEN) if(isnull(newdesc)) return if(!user.can_perform_action(src)) @@ -487,7 +487,7 @@ if("Product Description") if(product && !productdesc) productdesc = initial(product.desc) - var/newproductdesc = tgui_input_text(user, "Write a new product description", "Product Description", productdesc, 180) + var/newproductdesc = tgui_input_text(user, "Write a new product description", "Product Description", productdesc, max_length = MAX_DESC_LEN) if(isnull(newproductdesc)) return if(!user.can_perform_action(src)) diff --git a/code/modules/instruments/songs/editor.dm b/code/modules/instruments/songs/editor.dm index 651b3d6f3b6..4029e5c3954 100644 --- a/code/modules/instruments/songs/editor.dm +++ b/code/modules/instruments/songs/editor.dm @@ -111,7 +111,7 @@ tempo = sanitize_tempo(5) // default 120 BPM return TRUE if("add_new_line") - var/newline = tgui_input_text(user, "Enter your line", parent.name) + var/newline = tgui_input_text(user, "Enter your line", parent.name, max_length = MUSIC_MAXLINECHARS) if(!newline || !in_range(parent, user)) return if(lines.len > MUSIC_MAXLINES) @@ -129,7 +129,7 @@ var/line_to_edit = params["line_editing"] if(line_to_edit > lines.len || line_to_edit < 1) return FALSE - var/new_line_text = tgui_input_text(user, "Enter your line ", parent.name, lines[line_to_edit], MUSIC_MAXLINECHARS) + var/new_line_text = tgui_input_text(user, "Enter your line ", parent.name, lines[line_to_edit], max_length = MUSIC_MAXLINECHARS) if(isnull(new_line_text) || !in_range(parent, user)) return FALSE lines[line_to_edit] = new_line_text diff --git a/code/modules/library/book.dm b/code/modules/library/book.dm index 5ae9afcdcbe..7f5f010563a 100644 --- a/code/modules/library/book.dm +++ b/code/modules/library/book.dm @@ -133,7 +133,7 @@ name = newtitle book_data.set_title(html_decode(newtitle)) //Don't want to double encode here if("Contents") - var/content = tgui_input_text(user, "Write your book's contents (HTML NOT allowed)", "Book Contents", multiline = TRUE) + var/content = tgui_input_text(user, "Write your book's contents (HTML NOT allowed)", "Book Contents", max_length = MAX_PAPER_LENGTH, multiline = TRUE) if(!user.can_perform_action(src) || !user.can_write(attacking_item)) return if(!content) @@ -141,7 +141,7 @@ return book_data.set_content(html_decode(content)) if("Author") - var/author = tgui_input_text(user, "Write the author's name", "Author Name") + var/author = tgui_input_text(user, "Write the author's name", "Author Name", max_length = MAX_NAME_LEN) if(!user.can_perform_action(src) || !user.can_write(attacking_item)) return if(!author) diff --git a/code/modules/mob/living/basic/guardian/guardian_verbs.dm b/code/modules/mob/living/basic/guardian/guardian_verbs.dm index 80a2af7db7a..b69fac87820 100644 --- a/code/modules/mob/living/basic/guardian/guardian_verbs.dm +++ b/code/modules/mob/living/basic/guardian/guardian_verbs.dm @@ -57,7 +57,7 @@ if (isnull(summoner)) return var/sender_key = key - var/input = tgui_input_text(src, "Enter a message to tell your summoner", "Guardian") + var/input = tgui_input_text(src, "Enter a message to tell your summoner", "Guardian", max_length = MAX_MESSAGE_LEN) if (sender_key != key || !input) //guardian got reset, or did not enter anything return @@ -91,7 +91,7 @@ /datum/action/cooldown/mob_cooldown/guardian_comms/Activate(atom/target) StartCooldown(360 SECONDS) - var/input = tgui_input_text(owner, "Enter a message to tell your guardian", "Message") + var/input = tgui_input_text(owner, "Enter a message to tell your guardian", "Message", max_length = MAX_MESSAGE_LEN) StartCooldown() if (!input) return FALSE diff --git a/code/modules/mob/living/basic/space_fauna/spider/spider_abilities/hivemind.dm b/code/modules/mob/living/basic/space_fauna/spider/spider_abilities/hivemind.dm index 790879b0de2..8fc79080cac 100644 --- a/code/modules/mob/living/basic/space_fauna/spider/spider_abilities/hivemind.dm +++ b/code/modules/mob/living/basic/space_fauna/spider/spider_abilities/hivemind.dm @@ -18,7 +18,7 @@ var/current_directive = "" /datum/action/cooldown/mob_cooldown/set_spider_directive/Activate(atom/target) - var/new_directive = tgui_input_text(owner, "Enter the new directive", "Create directive", "[current_directive]") + var/new_directive = tgui_input_text(owner, "Enter the new directive", "Create directive", "[current_directive]", max_length = MAX_MESSAGE_LEN) if(isnull(new_directive) || QDELETED(src) || QDELETED(owner) || !IsAvailable(feedback = TRUE)) return @@ -44,7 +44,7 @@ click_to_activate = FALSE /datum/action/cooldown/mob_cooldown/command_spiders/Activate(trigger_flags) - var/input = tgui_input_text(owner, "Input a command for your legions to follow.", "Command") + var/input = tgui_input_text(owner, "Input a command for your legions to follow.", "Command", max_length = MAX_MESSAGE_LEN) if(!input || QDELETED(src) || QDELETED(owner) || !IsAvailable(feedback = TRUE)) return spider_command(owner, input) diff --git a/code/modules/mob/living/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm index 04967c76731..d883cbc6359 100644 --- a/code/modules/mob/living/brain/posibrain.dm +++ b/code/modules/mob/living/brain/posibrain.dm @@ -76,7 +76,7 @@ GLOBAL_VAR(posibrain_notify_cooldown) addtimer(CALLBACK(src, PROC_REF(check_success)), ask_delay) /obj/item/mmi/posibrain/click_alt(mob/living/user) - var/input_seed = tgui_input_text(user, "Enter a personality seed", "Enter seed", ask_role, MAX_NAME_LEN) + var/input_seed = tgui_input_text(user, "Enter a personality seed", "Enter seed", ask_role, max_length = MAX_NAME_LEN) if(isnull(input_seed)) return CLICK_ACTION_BLOCKING if(!user.can_perform_action(src)) diff --git a/code/modules/mob/living/carbon/alien/adult/alien_powers.dm b/code/modules/mob/living/carbon/alien/adult/alien_powers.dm index 999ec07f41a..21a09d82a69 100644 --- a/code/modules/mob/living/carbon/alien/adult/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/adult/alien_powers.dm @@ -135,7 +135,7 @@ Doesn't work on other aliens/AI.*/ if(!chosen_recipient) return FALSE - var/to_whisper = tgui_input_text(owner, title = "Alien Whisper") + var/to_whisper = tgui_input_text(owner, title = "Alien Whisper", max_length = MAX_MESSAGE_LEN) if(QDELETED(chosen_recipient) || QDELETED(src) || QDELETED(owner) || !IsAvailable(feedback = TRUE) || !to_whisper) return FALSE if(chosen_recipient.can_block_magic(MAGIC_RESISTANCE_MIND, charge_cost = 0)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1dcd708b3e7..903d489846a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -322,7 +322,7 @@ var/mob/living/carbon/human/human_user = human_or_ghost_user if(href_list["add_citation"]) var/max_fine = CONFIG_GET(number/maxfine) - var/citation_name = tgui_input_text(human_user, "Citation crime", "Security HUD") + var/citation_name = tgui_input_text(human_user, "Citation crime", "Security HUD", max_length = MAX_MESSAGE_LEN) var/fine = tgui_input_number(human_user, "Citation fine", "Security HUD", 50, max_fine, 5) if(!fine || !target_record || !citation_name || !allowed_access || !isnum(fine) || fine > max_fine || fine <= 0 || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD)) return @@ -337,7 +337,7 @@ return if(href_list["add_crime"]) - var/crime_name = tgui_input_text(human_user, "Crime name", "Security HUD") + var/crime_name = tgui_input_text(human_user, "Crime name", "Security HUD", max_length = MAX_MESSAGE_LEN) if(!target_record || !crime_name || !allowed_access || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD)) return @@ -350,7 +350,7 @@ return if(href_list["add_note"]) - var/new_note = tgui_input_text(human_user, "Security note", "Security Records", multiline = TRUE) + var/new_note = tgui_input_text(human_user, "Security note", "Security Records", max_length = MAX_MESSAGE_LEN, multiline = TRUE) if(!target_record || !new_note || !allowed_access || !human_user.canUseHUD() || !HAS_TRAIT(human_user, TRAIT_SECURITY_HUD)) return diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 811ae45ea8c..bcf0e1c0de2 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -724,7 +724,7 @@ var/mob/living/recipient = tgui_input_list(telepath, "Choose a telepathic message recipient", "Telepathy", sort_names(recipient_options)) if(isnull(recipient) || telepath.stat == DEAD || !is_species(telepath, /datum/species/jelly/stargazer)) return - var/msg = tgui_input_text(telepath, title = "Telepathy") + var/msg = tgui_input_text(telepath, title = "Telepathy", max_length = MAX_MESSAGE_LEN) if(isnull(msg) || telepath.stat == DEAD || !is_species(telepath, /datum/species/jelly/stargazer)) return if(!(recipient in oview(telepath))) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7c21fd8b875..fc494befd90 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -2742,7 +2742,7 @@ GLOBAL_LIST_EMPTY(fire_appearances) var/picked_theme = tgui_input_list(admin, "Pick the guardian theme.", "Guardian Controller", list(GUARDIAN_THEME_TECH, GUARDIAN_THEME_MAGIC, GUARDIAN_THEME_CARP, GUARDIAN_THEME_MINER, "Random")) if(picked_theme == "Random") picked_theme = null //holopara code handles not having a theme by giving a random one - var/picked_name = tgui_input_text(admin, "Name the guardian, leave empty to let player name it.", "Guardian Controller") + var/picked_name = tgui_input_text(admin, "Name the guardian, leave empty to let player name it.", "Guardian Controller", max_length = MAX_NAME_LEN) var/picked_color = input(admin, "Set the guardian's color, cancel to let player set it.", "Guardian Controller", "#ffffff") as color|null if(tgui_alert(admin, "Confirm creation.", "Guardian Controller", list("Yes", "No")) != "Yes") return diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index d53d1ddda4d..fc488471861 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -345,7 +345,12 @@ to_chat(usr, span_alert("[can_evac_or_fail_reason]")) return - var/reason = tgui_input_text(src, "What is the nature of your emergency? ([CALL_SHUTTLE_REASON_LENGTH] characters required.)", "Confirm Shuttle Call") + var/reason = tgui_input_text( + src, + "What is the nature of your emergency? ([CALL_SHUTTLE_REASON_LENGTH] characters required.)", + "Confirm Shuttle Call", + max_length = MAX_MESSAGE_LEN, + ) if(incapacitated) return diff --git a/code/modules/mob/living/silicon/ai/ai_say.dm b/code/modules/mob/living/silicon/ai/ai_say.dm index a71074f9a01..efb2366ca12 100644 --- a/code/modules/mob/living/silicon/ai/ai_say.dm +++ b/code/modules/mob/living/silicon/ai/ai_say.dm @@ -99,7 +99,13 @@ to_chat(src, span_notice("Please wait [DisplayTimeText(announcing_vox - world.time)].")) return - var/message = tgui_input_text(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", src.last_announcement) + var/message = tgui_input_text( + src, + "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", + "Announcement", + src.last_announcement, + max_length = MAX_MESSAGE_LEN, + ) if(!message || announcing_vox > world.time) return diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index dbfe987cac5..68579730e8d 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -335,7 +335,7 @@ if(new_dest) set_destination(new_dest) if("setid") - var/new_id = tgui_input_text(user, "Enter ID", "ID Assignment", id, MAX_NAME_LEN) + var/new_id = tgui_input_text(user, "Enter ID", "ID Assignment", id, max_length = MAX_NAME_LEN) if(new_id) set_id(new_id) name = "\improper MULEbot [new_id]" diff --git a/code/modules/modular_computers/file_system/programs/borg_monitor.dm b/code/modules/modular_computers/file_system/programs/borg_monitor.dm index 6f5b116a930..48966f2f261 100644 --- a/code/modules/modular_computers/file_system/programs/borg_monitor.dm +++ b/code/modules/modular_computers/file_system/programs/borg_monitor.dm @@ -122,7 +122,7 @@ if(robot.stat == DEAD) //Dead borgs will listen to you no longer to_chat(user, span_warning("Error -- Could not open a connection to unit:[robot]")) return FALSE - var/message = tgui_input_text(user, "Message to be sent to remote cyborg", "Send Message") + var/message = tgui_input_text(user, "Message to be sent to remote cyborg", "Send Message", max_length = MAX_MESSAGE_LEN) if(!message) return FALSE send_message(message, robot, user) diff --git a/code/modules/modular_computers/file_system/programs/budgetordering.dm b/code/modules/modular_computers/file_system/programs/budgetordering.dm index 4c1a60a0c86..d1ce57bda61 100644 --- a/code/modules/modular_computers/file_system/programs/budgetordering.dm +++ b/code/modules/modular_computers/file_system/programs/budgetordering.dm @@ -240,7 +240,7 @@ var/reason = "" if((requestonly && !self_paid) || !(computer.computer_id_slot?.GetID())) - reason = tgui_input_text(usr, "Reason", name) + reason = tgui_input_text(usr, "Reason", name, max_length = MAX_MESSAGE_LEN) if(isnull(reason) || ..()) return diff --git a/code/modules/modular_computers/file_system/programs/messenger/messenger_program.dm b/code/modules/modular_computers/file_system/programs/messenger/messenger_program.dm index 6436e6be2b8..3d7c735e466 100644 --- a/code/modules/modular_computers/file_system/programs/messenger/messenger_program.dm +++ b/code/modules/modular_computers/file_system/programs/messenger/messenger_program.dm @@ -165,7 +165,7 @@ switch(action) if("PDA_ringSet") var/mob/living/user = usr - var/new_ringtone = tgui_input_text(user, "Enter a new ringtone", "Ringtone", ringtone, encode = FALSE) + var/new_ringtone = tgui_input_text(user, "Enter a new ringtone", "Ringtone", ringtone, max_length = MAX_MESSAGE_LEN, encode = FALSE) if(!computer.can_interact(user)) computer.balloon_alert(user, "can't reach!") return FALSE @@ -401,7 +401,7 @@ chat.can_reply = FALSE return var/target_name = target.computer.saved_identification - var/input_message = tgui_input_text(user, "Enter [mime_mode ? "emojis":"a message"]", "NT Messaging[target_name ? " ([target_name])" : ""]", encode = FALSE) + var/input_message = tgui_input_text(user, "Enter [mime_mode ? "emojis":"a message"]", "NT Messaging[target_name ? " ([target_name])" : ""]", max_length = MAX_MESSAGE_LEN, encode = FALSE) send_message(user, input_message, list(chat)) /// Helper proc that sends a message to everyone diff --git a/code/modules/pai/pai.dm b/code/modules/pai/pai.dm index 43e45881903..066a1146fd4 100644 --- a/code/modules/pai/pai.dm +++ b/code/modules/pai/pai.dm @@ -407,7 +407,13 @@ if(!master_ref) balloon_alert(user, "access denied: no master") return FALSE - var/new_laws = tgui_input_text(user, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", laws.supplied[1], 300) + var/new_laws = tgui_input_text( + user, + "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", + "pAI Directive Configuration", + laws.supplied[1], + max_length = 300, + ) if(!new_laws || !master_ref) return FALSE add_supplied_law(0, new_laws) diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index fc1b986ce6d..09858d8375b 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -170,7 +170,7 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department /obj/machinery/fax/multitool_act(mob/living/user, obj/item/I) if (panel_open) return - var/new_fax_name = tgui_input_text(user, "Enter a new name for the fax machine.", "New Fax Name", , 128) + var/new_fax_name = tgui_input_text(user, "Enter a new name for the fax machine.", "New Fax Name", max_length = 128) if (!new_fax_name) return ITEM_INTERACT_SUCCESS if (new_fax_name != fax_name) diff --git a/code/modules/reagents/chemistry/chem_wiki_render.dm b/code/modules/reagents/chemistry/chem_wiki_render.dm index 2bb6bd7175b..34bc1e1a6f1 100644 --- a/code/modules/reagents/chemistry/chem_wiki_render.dm +++ b/code/modules/reagents/chemistry/chem_wiki_render.dm @@ -9,7 +9,12 @@ ADMIN_VERB(generate_wikichem_list, R_DEBUG, "Parse Wikichems", "Parse and genera |- "} - var/input_text = tgui_input_text(user, "Input a name of a reagent, or a series of reagents split with a comma (no spaces) to get its wiki table entry", "Recipe") //95% of the time, the reagent type is a lowercase, no spaces / underscored version of the name + var/input_text = tgui_input_text( + user, + "Input a name of a reagent, or a series of reagents split with a comma (no spaces) to get its wiki table entry", + "Recipe", + max_length = MAX_MESSAGE_LEN, + ) //95% of the time, the reagent type is a lowercase, no spaces / underscored version of the name if(!input_text) to_chat(user, "Input was blank!") return diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 5f665d876af..b7266ca0fe3 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -346,7 +346,7 @@ if("save_recording") if(!is_operational) return - var/name = tgui_input_text(ui.user, "What do you want to name this recipe?", "Recipe Name", MAX_NAME_LEN) + var/name = tgui_input_text(ui.user, "What do you want to name this recipe?", "Recipe Name", max_length = MAX_NAME_LEN) if(!ui.user.can_perform_action(src, ALLOW_SILICON_REACH)) return if(saved_recipes[name] && tgui_alert(ui.user, "\"[name]\" already exists, do you want to overwrite it?",, list("Yes", "No")) == "No") diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 237dcb862af..87ba535a149 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -474,11 +474,13 @@ item_name_default = "[master_reagent.name] [item_name_default]" if(!(initial(selected_container.reagent_flags) & OPENCONTAINER)) // Closed containers get both reagent name and units in the name item_name_default = "[master_reagent.name] [item_name_default] ([volume_in_each]u)" - var/item_name = tgui_input_text(usr, + var/item_name = tgui_input_text( + usr, "Container name", "Name", item_name_default, - MAX_NAME_LEN) + max_length = MAX_NAME_LEN, + ) if(!item_name) return FALSE diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm index 75fc8aef892..15c79e4c150 100644 --- a/code/modules/reagents/reagent_containers/blood_pack.dm +++ b/code/modules/reagents/reagent_containers/blood_pack.dm @@ -103,7 +103,7 @@ if (IS_WRITING_UTENSIL(tool)) if(!user.can_write(tool)) return - var/custom_label = tgui_input_text(user, "What would you like to label the blood pack?", "Blood Pack", name, MAX_NAME_LEN) + var/custom_label = tgui_input_text(user, "What would you like to label the blood pack?", "Blood Pack", name, max_length = MAX_NAME_LEN) if(!user.can_perform_action(src)) return if(user.get_active_held_item() != tool) diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 9a416372a28..72d79b20ec5 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -700,7 +700,7 @@ return CONTEXTUAL_SCREENTIP_SET /obj/item/slimepotion/slime/sentience/click_alt(mob/living/user) - potion_reason = tgui_input_text(user, "Enter reason for offering potion", "Intelligence Potion", potion_reason, multiline = TRUE) + potion_reason = tgui_input_text(user, "Enter reason for offering potion", "Intelligence Potion", potion_reason, max_length = MAX_MESSAGE_LEN, multiline = TRUE) return CLICK_ACTION_SUCCESS /obj/item/slimepotion/slime/sentience/attack(mob/living/dumb_mob, mob/user) diff --git a/code/modules/spells/spell_types/list_target/telepathy.dm b/code/modules/spells/spell_types/list_target/telepathy.dm index 9d512f5a0b9..861fc49732d 100644 --- a/code/modules/spells/spell_types/list_target/telepathy.dm +++ b/code/modules/spells/spell_types/list_target/telepathy.dm @@ -22,7 +22,7 @@ if(. & SPELL_CANCEL_CAST) return - message = tgui_input_text(owner, "What do you wish to whisper to [cast_on]?", "[src]") + message = tgui_input_text(owner, "What do you wish to whisper to [cast_on]?", "[src]", max_length = MAX_MESSAGE_LEN) if(QDELETED(src) || QDELETED(owner) || QDELETED(cast_on) || !can_cast_spell()) return . | SPELL_CANCEL_CAST diff --git a/code/modules/spells/spell_types/self/voice_of_god.dm b/code/modules/spells/spell_types/self/voice_of_god.dm index b1efaabd2a8..e7602a214f1 100644 --- a/code/modules/spells/spell_types/self/voice_of_god.dm +++ b/code/modules/spells/spell_types/self/voice_of_god.dm @@ -25,7 +25,7 @@ if(. & SPELL_CANCEL_CAST) return - command = tgui_input_text(cast_on, "Speak with the Voice of God", "Command") + command = tgui_input_text(cast_on, "Speak with the Voice of God", "Command", max_length = MAX_MESSAGE_LEN) if(QDELETED(src) || QDELETED(cast_on) || !can_cast_spell()) return . | SPELL_CANCEL_CAST if(!command) diff --git a/code/modules/surgery/advanced/brainwashing.dm b/code/modules/surgery/advanced/brainwashing.dm index 21870ae57b8..5509f925cfd 100644 --- a/code/modules/surgery/advanced/brainwashing.dm +++ b/code/modules/surgery/advanced/brainwashing.dm @@ -65,7 +65,7 @@ success_sound = 'sound/items/taperecorder/taperecorder_close.ogg' /datum/surgery_step/brainwash/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - objective = tgui_input_text(user, "Choose the objective to imprint on your victim's brain", "Brainwashing") + objective = tgui_input_text(user, "Choose the objective to imprint on your victim's brain", "Brainwashing", max_length = MAX_MESSAGE_LEN) if(!objective) return SURGERY_STEP_FAIL display_results( diff --git a/code/modules/surgery/organs/internal/vocal_cords/_vocal_cords.dm b/code/modules/surgery/organs/internal/vocal_cords/_vocal_cords.dm index f2d9abae416..4ed51e77e42 100644 --- a/code/modules/surgery/organs/internal/vocal_cords/_vocal_cords.dm +++ b/code/modules/surgery/organs/internal/vocal_cords/_vocal_cords.dm @@ -60,7 +60,7 @@ . = ..() if(!.) return - var/command = tgui_input_text(owner, "Speak with the Voice of God", "Command") + var/command = tgui_input_text(owner, "Speak with the Voice of God", "Command", max_length = MAX_MESSAGE_LEN) if(!command) return if(QDELETED(src) || QDELETED(owner)) @@ -101,7 +101,7 @@ /datum/action/item_action/organ_action/use/adamantine_vocal_cords/Trigger(trigger_flags) if(!IsAvailable(feedback = TRUE)) return - var/message = tgui_input_text(owner, "Resonate a message to all nearby golems", "Resonate") + var/message = tgui_input_text(owner, "Resonate a message to all nearby golems", "Resonate", max_length = MAX_MESSAGE_LEN) if(!message) return if(QDELETED(src) || QDELETED(owner)) diff --git a/code/modules/vehicles/mecha/mecha_control_console.dm b/code/modules/vehicles/mecha/mecha_control_console.dm index d31bd5a5bd2..a9dbca0e07d 100644 --- a/code/modules/vehicles/mecha/mecha_control_console.dm +++ b/code/modules/vehicles/mecha/mecha_control_console.dm @@ -55,7 +55,7 @@ var/obj/item/mecha_parts/mecha_tracking/MT = locate(params["tracker_ref"]) if(!istype(MT)) return - var/message = tgui_input_text(usr, "Input message", "Transmit message") + var/message = tgui_input_text(usr, "Input message", "Transmit message", max_length = MAX_MESSAGE_LEN) var/obj/vehicle/sealed/mecha/M = MT.chassis if(trim(message) && M) to_chat(M.occupants, message) diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 75d758eec19..7322fc4d6d3 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -1799,9 +1799,9 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) if(compartmentLoadAccessCheck(user)) if(IS_WRITING_UTENSIL(attack_item)) - name = tgui_input_text(user, "Set name", "Name", name, 20) - desc = tgui_input_text(user, "Set description", "Description", desc, 60) - slogan_list += tgui_input_text(user, "Set slogan", "Slogan", "Epic", 60) + name = tgui_input_text(user, "Set name", "Name", name, max_length = 20) + desc = tgui_input_text(user, "Set description", "Description", desc, max_length = 60) + slogan_list += tgui_input_text(user, "Set slogan", "Slogan", "Epic", max_length = 60) last_slogan = world.time + rand(0, slogan_delay) return diff --git a/code/modules/wiremod/components/admin/input_request.dm b/code/modules/wiremod/components/admin/input_request.dm index 13dfacba357..3961003d43a 100644 --- a/code/modules/wiremod/components/admin/input_request.dm +++ b/code/modules/wiremod/components/admin/input_request.dm @@ -59,7 +59,7 @@ var/new_option = input_options.value switch(new_option) if(COMP_INPUT_STRING) - var/player_input = tgui_input_text(player, "Input a value", "Input value") + var/player_input = tgui_input_text(player, "Input a value", "Input value", max_length = MAX_MESSAGE_LEN) if(isnull(player_input)) return input_response.set_output(player_input) diff --git a/code/modules/wiremod/components/bci/thought_listener.dm b/code/modules/wiremod/components/bci/thought_listener.dm index aa788b1a4be..ed6226a4e49 100644 --- a/code/modules/wiremod/components/bci/thought_listener.dm +++ b/code/modules/wiremod/components/bci/thought_listener.dm @@ -56,7 +56,7 @@ ready = FALSE /obj/item/circuit_component/thought_listener/proc/thought_listen(mob/living/owner) - var/message = tgui_input_text(owner, input_desc.value ? input_desc.value : "", input_name.value ? input_name.value : "Thought Listener", "") + var/message = tgui_input_text(owner, input_desc.value ? input_desc.value : "", input_name.value ? input_name.value : "Thought Listener", "", max_length = MAX_MESSAGE_LEN) if(QDELETED(owner) || owner.stat >= SOFT_CRIT) return output.set_output(message) diff --git a/code/modules/wiremod/shell/keyboard.dm b/code/modules/wiremod/shell/keyboard.dm index 86a57d50681..505c89e0dde 100644 --- a/code/modules/wiremod/shell/keyboard.dm +++ b/code/modules/wiremod/shell/keyboard.dm @@ -49,7 +49,7 @@ to_chat(user, span_warning("You start mashing keys at random!")) return - var/message = tgui_input_text(user, "Input your text", "Keyboard") + var/message = tgui_input_text(user, "Input your text", "Keyboard", max_length = MAX_MESSAGE_LEN) entity.set_output(user) output.set_output(message) signal.set_output(COMPONENT_SIGNAL)