Audits tgui_input_text() for length issues (#86741)

Fixes #86784

## About The Pull Request

Although some of the issues found were a direct result from #86692
(c698196766), there was still 40% of
length-related issues that wouldn't be covered anyways that are fixed in
this PR. I.E.:

* Name inputs without `MAX_NAME_LEN`
* Desc inputs without `MAX_DESC_LEN`
* Plaque inputs without `MAX_PLAQUE_LEN`
* Some people just screwed up the arguments so it would prefill
something like "40" in the `default` var because they didn't name their
vars.

To help me audit I added a lot of `max_length` named arguments to help
people understand it better. I think it might be kinder to have a
wrapper that handles adding `MAX_MESSAGE_LEN` in a lot of these cases
but I think there is some reason for a coder to be cognitive about input
texts? Let me know what you think. I didn't update anything
admin-related from what I can recall, let me know if anything needs to
be unlimited again.
## Why It's Good For The Game

The change to `INFINITY` notwithstanding, there were still an abundance
of issues that we needed to check up on. A lot of these are filtered on
down the line but it is clear that there needs to be something to catch
these issues. Maybe we could lint to make `max_length` a mandatory
argument? I don't know if that's necessary at all but I think that the
limit should be set by the invoker due to the wide arrangement of cases
that this proc could be used in.

This could all be a big nothingburger if the aforementioned PR is
reverted but a big chunk of cases fixed in this PR need to be fixed
regardless of that since people could put in 1024 character names for
stuff like guardians (or more now with the change). Consider this
"revert agnostic".
## Changelog
🆑
fix: A lot of instances where you could fill in 1024-character names
(normal limit is 42) have been patched out, along with too-long plaque
names, too-long descriptions, and more.
/🆑
This commit is contained in:
san7890
2024-09-20 22:46:41 +00:00
committed by GitHub
parent 840e73b1a3
commit a4328ae1f9
86 changed files with 183 additions and 137 deletions
+1 -1
View File
@@ -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,
+3 -3
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
@@ -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, ",")
@@ -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))
+1 -1
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
@@ -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)
+1 -1
View File
@@ -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)
@@ -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))
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
@@ -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"
@@ -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))
@@ -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()
+1 -1
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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
+7 -6
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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(
@@ -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))
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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
@@ -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
@@ -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
+1 -1
View File
@@ -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
@@ -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)
@@ -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
+1 -1
View File
@@ -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
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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")
+3 -3
View File
@@ -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)
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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)
+10 -2
View File
@@ -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"
+1 -1
View File
@@ -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))
@@ -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)
@@ -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")
+1 -1
View File
@@ -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
@@ -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
@@ -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")
@@ -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)
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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)
. = ..()
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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))
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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)
@@ -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
@@ -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)
+1 -1
View File
@@ -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))
@@ -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))
@@ -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
@@ -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)))
+1 -1
View File
@@ -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
+6 -1
View File
@@ -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
+7 -1
View File
@@ -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
@@ -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]"
@@ -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)
@@ -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
@@ -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
+7 -1
View File
@@ -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)
+1 -1
View File
@@ -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)
@@ -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
@@ -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")
@@ -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
@@ -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)
@@ -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)
@@ -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
@@ -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)
@@ -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(
@@ -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))
@@ -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)
+3 -3
View File
@@ -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
@@ -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)
@@ -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)
+1 -1
View File
@@ -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)