diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index f2db0738316..4adb5081960 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -83,6 +83,7 @@ #define DO_AUTOPILOT 5 #define MAX_MESSAGE_LEN 4096 +#define MAX_HUGE_MESSAGE_LEN 8192 #define MAX_PAPER_MESSAGE_LEN 6144 #define MAX_BOOK_MESSAGE_LEN 24576 #define MAX_RECORD_LENGTH 24576 diff --git a/code/modules/emotes/emote_mob.dm b/code/modules/emotes/emote_mob.dm index fb00512cdb4..6fbfc475b6f 100644 --- a/code/modules/emotes/emote_mob.dm +++ b/code/modules/emotes/emote_mob.dm @@ -54,7 +54,7 @@ if(act == "custom") if(!message) - message = sanitize_or_reflect(tgui_input_text(src,"Choose an emote to display."), src) //VOREStation Edit - Reflect too long messages, within reason + message = sanitize_or_reflect(tgui_input_text(src,"Choose an emote to display.", encode = FALSE), src) //VOREStation Edit - Reflect too long messages, within reason if(!message) return if (!m_type) diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 75aa32a1b7a..4595ec5c20b 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -23,7 +23,7 @@ var/input if(!message) - input = sanitize_or_reflect(tgui_input_text(src, "Choose an emote to display."), src) //VOREStation Edit - Reflect too long messages, within reason + input = sanitize_or_reflect(tgui_input_text(src, "Choose an emote to display.", encode = FALSE), src) //VOREStation Edit - Reflect too long messages, within reason else input = message diff --git a/code/modules/mob/living/silicon/pai/pai_vr.dm b/code/modules/mob/living/silicon/pai/pai_vr.dm index 14f15924bc4..c2ef208fd72 100644 --- a/code/modules/mob/living/silicon/pai/pai_vr.dm +++ b/code/modules/mob/living/silicon/pai/pai_vr.dm @@ -448,7 +448,7 @@ if(loc != card) to_chat(src, span_warning("Your message won't be visible while unfolded!")) if (!message) - message = tgui_input_text(src, "Enter text you would like to show on your screen.","Screen Message") + message = tgui_input_text(src, "Enter text you would like to show on your screen.","Screen Message", encode = FALSE) message = sanitize_or_reflect(message,src) if (!message) return diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/stardog.dm b/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/stardog.dm index 8485bdad764..b5eab2ac092 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/stardog.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/alien animals/stardog.dm @@ -476,7 +476,7 @@ to_chat(L, span_warning("You cannot speak in IC (muted).")) return if (!message) - message = tgui_input_text(usr, "Type a message to emote.","Emote Beyond") + message = tgui_input_text(usr, "Type a message to emote.","Emote Beyond", encode = FALSE) message = sanitize_or_reflect(message,L) if (!message) return @@ -1142,7 +1142,7 @@ to_chat(L, span_warning("You cannot speak in IC (muted).")) return if (!message) - message = tgui_input_text(L, "Type a message to emote.","Emote Beyond") + message = tgui_input_text(L, "Type a message to emote.","Emote Beyond", encode = FALSE) message = sanitize_or_reflect(message,L) if (!message) return diff --git a/code/modules/mob/say_old.dm b/code/modules/mob/say_old.dm index aef6d50757e..d3187217aee 100644 --- a/code/modules/mob/say_old.dm +++ b/code/modules/mob/say_old.dm @@ -5,7 +5,7 @@ client?.start_thinking() client?.start_typing() - var/message = tgui_input_text(src, "Speak to people in sight.\nType your message:", "Say") + var/message = tgui_input_text(src, "Speak to people in sight.\nType your message:", "Say", encode = FALSE) client?.stop_thinking() if(message) @@ -18,7 +18,7 @@ client?.start_thinking() client?.start_typing() - var/message = tgui_input_text(src, "Emote to people in sight (and your pred/prey).\nType your message:", "Emote", multiline = TRUE) + var/message = tgui_input_text(src, "Emote to people in sight (and your pred/prey).\nType your message:", "Emote", multiline = TRUE, encode = FALSE) client?.stop_thinking() if(message) @@ -28,7 +28,11 @@ set name = "Whisper Old" set category = "IC.Subtle" - var/message = tgui_input_text(src, "Speak to nearby people.\nType your message:", "Whisper") + if(client?.prefs?.read_preference(/datum/preference/toggle/show_typing_indicator_subtle)) + client?.start_thinking() + client?.start_typing() + var/message = tgui_input_text(src, "Speak to nearby people.\nType your message:", "Whisper", encode = FALSE) + client?.stop_thinking() if(message) whisper(message) @@ -39,7 +43,11 @@ set category = "IC.Subtle" set desc = "Emote to nearby people (and your pred/prey)" - var/message = tgui_input_text(src, "Emote to nearby people (and your pred/prey).\nType your message:", "Subtle", multiline = TRUE) + if(client?.prefs?.read_preference(/datum/preference/toggle/show_typing_indicator_subtle)) + client?.start_thinking() + client?.start_typing() + var/message = tgui_input_text(src, "Emote to nearby people (and your pred/prey).\nType your message:", "Subtle", multiline = TRUE, encode = FALSE) + client?.stop_thinking() if(message) me_verb_subtle(message) @@ -49,7 +57,7 @@ set category = "IC.Subtle" set desc = "Emote to nearby people, with ability to choose which specific portion of people you wish to target." - var/message = tgui_input_text(src, "Emote to nearby people, with ability to choose which specific portion of people you wish to target.\nType your message:", "Subtle (Custom)", multiline = TRUE) + var/message = tgui_input_text(src, "Emote to nearby people, with ability to choose which specific portion of people you wish to target.\nType your message:", "Subtle (Custom)", multiline = TRUE, encode = FALSE) if(message) me_verb_subtle_custom(message) @@ -58,7 +66,7 @@ set name = "Psay Old" set category = "IC.Subtle" - var/message = tgui_input_text(src, "Talk to people affected by complete absorbed or dominate predator/prey.\nType your message:", "Psay") + var/message = tgui_input_text(src, "Talk to people affected by complete absorbed or dominate predator/prey.\nType your message:", "Psay", encode = FALSE) if(message) psay(message) @@ -67,7 +75,7 @@ set name = "Pme Old" set category = "IC.Subtle" - var/message = tgui_input_text(src, "Emote to people affected by complete absorbed or dominate predator/prey.\nType your message:", "Pme") + var/message = tgui_input_text(src, "Emote to people affected by complete absorbed or dominate predator/prey.\nType your message:", "Pme", encode = FALSE) if(message) pme(message) @@ -76,7 +84,7 @@ set name = "Narrate (Player) Old" set category = "IC.Chat" - var/message = tgui_input_text(src, "Narrate an action or event! An alternative to emoting, for when your emote shouldn't start with your name!\nType your message:", "Narrate (Player)") + var/message = tgui_input_text(src, "Narrate an action or event! An alternative to emoting, for when your emote shouldn't start with your name!\nType your message:", "Narrate (Player)", encode = FALSE) if(message) player_narrate(message) diff --git a/code/modules/mob/say_vr.dm b/code/modules/mob/say_vr.dm index 277afd3effd..f46cb9f203b 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -5,7 +5,7 @@ /mob/verb/me_verb_subtle(message as message) //This would normally go in say.dm set name = "Subtle" set desc = "Emote to nearby people (and your pred/prey)" - set hidden = 1 + set hidden = TRUE if(forced_psay) pme(message) @@ -69,7 +69,7 @@ var/input if(!message) - input = sanitize_or_reflect(tgui_input_text(src,"Choose an emote to display."), src) + input = sanitize_or_reflect(tgui_input_text(src,"Choose an emote to display.", encode = FALSE), src) else input = message @@ -216,8 +216,6 @@ if(act == "me") return custom_emote_vr(type, message, mode_selection) -#define MAX_HUGE_MESSAGE_LEN 8192 -#define POST_DELIMITER_STR "\<\>" /proc/sanitize_or_reflect(message,user) //Way too long to send if(length(message) > MAX_HUGE_MESSAGE_LEN) @@ -249,8 +247,6 @@ var/posts = CEILING((length/MAX_MESSAGE_LEN), 1) to_chat(user,message) to_chat(user, span_danger("^ This message was NOT SENT ^ -- It was [length] characters, and the limit is [MAX_MESSAGE_LEN]. It would fit in [posts] separate messages.")) -#undef MAX_HUGE_MESSAGE_LEN -#undef POST_DELIMITER_STR ///// PSAY ///// @@ -263,7 +259,7 @@ to_chat(src, span_warning("You cannot speak in IC (muted).")) return if (!message) - message = tgui_input_text(src, "Type a message to say.","Psay") + message = tgui_input_text(src, "Type a message to say.","Psay", encode = FALSE) message = sanitize_or_reflect(message,src) if (!message) return @@ -360,7 +356,7 @@ to_chat(src, span_warning("You cannot speak in IC (muted).")) return if (!message) - message = tgui_input_text(src, "Type a message to emote.","Pme") + message = tgui_input_text(src, "Type a message to emote.","Pme", encode = FALSE) message = sanitize_or_reflect(message,src) if (!message) return @@ -455,7 +451,7 @@ to_chat(src, span_warning("You cannot speak in IC (muted).")) return if(!message) - message = tgui_input_text(src, "Type a message to narrate.","Narrate") + message = tgui_input_text(src, "Type a message to narrate.","Narrate", encode = FALSE) message = sanitize_or_reflect(message,src) if(!message) return diff --git a/code/modules/mob/typing_indicator.dm b/code/modules/mob/typing_indicator.dm index ce0bc352d5e..08661c8a774 100644 --- a/code/modules/mob/typing_indicator.dm +++ b/code/modules/mob/typing_indicator.dm @@ -20,13 +20,7 @@ winset(src, "tgui_say.browser", "focus=true") return - client?.start_thinking() - client?.start_typing() - var/message = tgui_input_text(src, "Type your message:", "Say") - client?.stop_thinking() - - if(message) - say_verb(message) + say_verb_old() /mob/verb/me_wrapper() set name = "Me verb" @@ -37,13 +31,7 @@ winset(src, "tgui_say.browser", "focus=true") return - client?.start_thinking() - client?.start_typing() - var/message = tgui_input_text(src, "Type your message:", "Emote", multiline = TRUE) - client?.stop_thinking() - - if(message) - me_verb(message) + me_verb_old() /mob/verb/whisper_wrapper() set name = "Whisper verb" @@ -54,14 +42,7 @@ winset(src, "tgui_say.browser", "focus=true") return - if(client?.prefs?.read_preference(/datum/preference/toggle/show_typing_indicator_subtle)) - client?.start_thinking() - client?.start_typing() - var/message = tgui_input_text(src, "Type your message:", "Whisper") - client?.stop_thinking() - - if(message) - whisper(message) + whisper_old() /mob/verb/subtle_wrapper() set name = "Subtle verb" @@ -73,11 +54,4 @@ winset(src, "tgui_say.browser", "focus=true") return - if(client?.prefs?.read_preference(/datum/preference/toggle/show_typing_indicator_subtle)) - client?.start_thinking() - client?.start_typing() - var/message = tgui_input_text(src, "Type your message:", "Subtle", multiline = TRUE) - client?.stop_thinking() - - if(message) - me_verb_subtle(message) + me_verb_subtle_old() diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm index 4a5e1bcdd50..671a6f79252 100644 --- a/code/modules/pda/messenger.dm +++ b/code/modules/pda/messenger.dm @@ -124,10 +124,9 @@ /datum/data/pda/app/messenger/proc/create_message(var/mob/living/U, var/obj/item/pda/P) - var/t = tgui_input_text(U, "Please enter message", name, null) + var/t = tgui_input_text(U, "Please enter message", name, null, MAX_MESSAGE_LEN) if(!t) return - t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN)) t = readd_quotes(t) if(!t || !istype(P)) return