[MIRROR] Stop removing edge whitespace from Integrated Circuit string input (#11872)

Co-authored-by: NickBelmont <89628295+NickBelmont@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-10-26 11:29:45 -07:00
committed by GitHub
parent 87c0a426f9
commit 6cb0a9531a
6 changed files with 8 additions and 8 deletions

View File

@@ -154,7 +154,7 @@ list[](
var/new_data = null
switch(type_to_use)
if("string")
new_data = tgui_input_text(user, "Now type in a string.","[src] string writing", istext(default) ? default : null, MAX_NAME_LEN)
new_data = sanitizeSafe(tgui_input_text(user, "Now type in a string.","[src] string writing", istext(default) ? default : null, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN, 1, 0)
if(istext(new_data) && holder.check_interactivity(user) )
to_chat(user, span_notice("You input [new_data] into the pin."))
return new_data

View File

@@ -3,7 +3,7 @@
name = "char pin"
/datum/integrated_io/char/ask_for_pin_data(mob/user)
var/new_data = tgui_input_text(user, "Please type in one character.","[src] char writing")
var/new_data = sanitizeSafe(tgui_input_text(user, "Please type in one character.","[src] char writing", encode = FALSE), 1, 1, 0)
if(holder.check_interactivity(user) )
to_chat(user, span_notice("You input [new_data ? "new_data" : "NULL"] into the pin."))
write_data_to_pin(new_data)

View File

@@ -3,8 +3,8 @@
name = "string pin"
/datum/integrated_io/string/ask_for_pin_data(mob/user)
var/new_data = tgui_input_text(user, "Please type in a string.","[src] string writing")
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 0, 0)
var/new_data = tgui_input_text(user, "Please type in a string.","[src] string writing", encode = FALSE)
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 1, 0)
if(new_data && holder.check_interactivity(user) )
to_chat(user, span_notice("You input [new_data ? "new_data" : "NULL"] into the pin."))

View File

@@ -122,8 +122,8 @@
switch(type_to_use)
if("string")
accepting_refs = 0
new_data = tgui_input_text(user, "Now type in a string.","[src] string writing", null, MAX_MESSAGE_LEN)
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 0, 0)
new_data = tgui_input_text(user, "Now type in a string.","[src] string writing", null, MAX_MESSAGE_LEN, encode = FALSE)
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 1, 0)
if(istext(new_data) && CanInteract(user, GLOB.tgui_physical_state))
data_to_write = new_data
to_chat(user, span_notice("You set \the [src]'s memory to \"[new_data]\"."))

View File

@@ -103,7 +103,7 @@
power_draw_per_use = 4
/obj/item/integrated_circuit/input/textpad/ask_for_input(mob/user)
var/new_input = tgui_input_text(user, "Enter some words, please.", "Text pad", get_pin_data(IC_OUTPUT, 1), MAX_KEYPAD_INPUT_LEN)
var/new_input = sanitizeSafe(tgui_input_text(user, "Enter some words, please.", "Text pad", get_pin_data(IC_OUTPUT, 1), MAX_KEYPAD_INPUT_LEN, encode = FALSE), MAX_KEYPAD_INPUT_LEN, 1, 0)
if(istext(new_input) && CanInteract(user, GLOB.tgui_physical_state))
set_pin_data(IC_OUTPUT, 1, new_input)
push_data()

View File

@@ -100,7 +100,7 @@
switch(type_to_use)
if("string")
accepting_refs = 0
new_data = tgui_input_text(user, "Now type in a string.","[src] string writing","", MAX_NAME_LEN)
new_data = sanitizeSafe(tgui_input_text(user, "Now type in a string.","[src] string writing","", MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN, 1, 0)
if(istext(new_data) && CanInteract(user, GLOB.tgui_physical_state))
O.data = new_data
to_chat(user, span_notice("You set \the [src]'s memory to [O.display_data(O.data)]."))