mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[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:
committed by
GitHub
parent
87c0a426f9
commit
6cb0a9531a
@@ -154,7 +154,7 @@ list[](
|
|||||||
var/new_data = null
|
var/new_data = null
|
||||||
switch(type_to_use)
|
switch(type_to_use)
|
||||||
if("string")
|
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) )
|
if(istext(new_data) && holder.check_interactivity(user) )
|
||||||
to_chat(user, span_notice("You input [new_data] into the pin."))
|
to_chat(user, span_notice("You input [new_data] into the pin."))
|
||||||
return new_data
|
return new_data
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
name = "char pin"
|
name = "char pin"
|
||||||
|
|
||||||
/datum/integrated_io/char/ask_for_pin_data(mob/user)
|
/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) )
|
if(holder.check_interactivity(user) )
|
||||||
to_chat(user, span_notice("You input [new_data ? "new_data" : "NULL"] into the pin."))
|
to_chat(user, span_notice("You input [new_data ? "new_data" : "NULL"] into the pin."))
|
||||||
write_data_to_pin(new_data)
|
write_data_to_pin(new_data)
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
name = "string pin"
|
name = "string pin"
|
||||||
|
|
||||||
/datum/integrated_io/string/ask_for_pin_data(mob/user)
|
/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")
|
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, 0, 0)
|
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 1, 0)
|
||||||
|
|
||||||
if(new_data && holder.check_interactivity(user) )
|
if(new_data && holder.check_interactivity(user) )
|
||||||
to_chat(user, span_notice("You input [new_data ? "new_data" : "NULL"] into the pin."))
|
to_chat(user, span_notice("You input [new_data ? "new_data" : "NULL"] into the pin."))
|
||||||
|
|||||||
@@ -122,8 +122,8 @@
|
|||||||
switch(type_to_use)
|
switch(type_to_use)
|
||||||
if("string")
|
if("string")
|
||||||
accepting_refs = 0
|
accepting_refs = 0
|
||||||
new_data = tgui_input_text(user, "Now type in a string.","[src] string writing", null, MAX_MESSAGE_LEN)
|
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, 0, 0)
|
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 1, 0)
|
||||||
if(istext(new_data) && CanInteract(user, GLOB.tgui_physical_state))
|
if(istext(new_data) && CanInteract(user, GLOB.tgui_physical_state))
|
||||||
data_to_write = new_data
|
data_to_write = new_data
|
||||||
to_chat(user, span_notice("You set \the [src]'s memory to \"[new_data]\"."))
|
to_chat(user, span_notice("You set \the [src]'s memory to \"[new_data]\"."))
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
power_draw_per_use = 4
|
power_draw_per_use = 4
|
||||||
|
|
||||||
/obj/item/integrated_circuit/input/textpad/ask_for_input(mob/user)
|
/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))
|
if(istext(new_input) && CanInteract(user, GLOB.tgui_physical_state))
|
||||||
set_pin_data(IC_OUTPUT, 1, new_input)
|
set_pin_data(IC_OUTPUT, 1, new_input)
|
||||||
push_data()
|
push_data()
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
switch(type_to_use)
|
switch(type_to_use)
|
||||||
if("string")
|
if("string")
|
||||||
accepting_refs = 0
|
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))
|
if(istext(new_data) && CanInteract(user, GLOB.tgui_physical_state))
|
||||||
O.data = new_data
|
O.data = new_data
|
||||||
to_chat(user, span_notice("You set \the [src]'s memory to [O.display_data(O.data)]."))
|
to_chat(user, span_notice("You set \the [src]'s memory to [O.display_data(O.data)]."))
|
||||||
|
|||||||
Reference in New Issue
Block a user