mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[MIRROR] encode patch (#11356)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
be6c681c50
commit
25d93e0895
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/mob/verb/me_verb_subtle(message as message) //This would normally go in say.dm //CHOMPEdit
|
||||
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
|
||||
|
||||
@@ -217,8 +217,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)
|
||||
@@ -250,8 +248,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 /////
|
||||
|
||||
@@ -264,7 +260,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
|
||||
@@ -369,7 +365,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
|
||||
@@ -472,7 +468,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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user