From 1569628c71f15520fcbaae0e212a25feb058276f Mon Sep 17 00:00:00 2001 From: ReturnToZender Date: Wed, 25 Oct 2023 20:45:18 -0500 Subject: [PATCH 1/3] Adds auto punctuation --- code/__SPLURTCODE/DEFINES/autopunctuation.dm | 2 ++ code/modules/mob/dead/observer/say.dm | 5 +++++ code/modules/mob/say.dm | 5 +++++ tgstation.dme | 1 + 4 files changed, 13 insertions(+) create mode 100644 code/__SPLURTCODE/DEFINES/autopunctuation.dm diff --git a/code/__SPLURTCODE/DEFINES/autopunctuation.dm b/code/__SPLURTCODE/DEFINES/autopunctuation.dm new file mode 100644 index 000000000000..ec0e2a0b03a5 --- /dev/null +++ b/code/__SPLURTCODE/DEFINES/autopunctuation.dm @@ -0,0 +1,2 @@ +GLOBAL_DATUM_INIT(has_eol_punctuation, /regex, regex(@"^(\w|^[^\*].*[^.!?~\+\|\_]+)$")) +//Auto punctuation global datum diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index c5c7350b4781..8ec8a54dcd0a 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -3,6 +3,11 @@ if (!message) return + //SPLURT Edit Start: adds automatic punctuation + if(findtext(message, GLOB.has_eol_punctuation)) + message += "." + //SPLURT Edit End: adds automatic punctuation + var/message_mode = get_message_mode(message) if(client && (message_mode == MODE_ADMIN || message_mode == MODE_DEADMIN)) message = copytext_char(message, 3) diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 98fd85dbe16c..6a6ca2e6ae1c 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -25,6 +25,11 @@ client?.last_activity = world.time +//SPLURT Edit Start: Adds auto punctuation + if(findtext(message, GLOB.has_eol_punctuation)) + message += "." +//SPLURT Edit End: Adds auto punctuation + say(message) /mob/verb/me_typing_indicator() diff --git a/tgstation.dme b/tgstation.dme index f44fd0b52733..758f871c346b 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -268,6 +268,7 @@ #include "code\__SPLURTCODE\DEFINES\access.dm" #include "code\__SPLURTCODE\DEFINES\admin.dm" #include "code\__SPLURTCODE\DEFINES\atmospherics.dm" +#include "code\__SPLURTCODE\DEFINES\autopunctuation.dm" #include "code\__SPLURTCODE\DEFINES\cit_defines.dm" #include "code\__SPLURTCODE\DEFINES\click.dm" #include "code\__SPLURTCODE\DEFINES\configuration.dm" From f02976157b92794da1d7ea7b3c9f4e8d2fc13fc6 Mon Sep 17 00:00:00 2001 From: ReturnToZender Date: Thu, 26 Oct 2023 14:44:03 -0500 Subject: [PATCH 2/3] Add the modified regex --- code/__SPLURTCODE/DEFINES/autopunctuation.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/__SPLURTCODE/DEFINES/autopunctuation.dm b/code/__SPLURTCODE/DEFINES/autopunctuation.dm index ec0e2a0b03a5..3b08f95d06b2 100644 --- a/code/__SPLURTCODE/DEFINES/autopunctuation.dm +++ b/code/__SPLURTCODE/DEFINES/autopunctuation.dm @@ -1,2 +1,2 @@ -GLOBAL_DATUM_INIT(has_eol_punctuation, /regex, regex(@"^(\w|^[^\*].*[^.!?~\+\|\_]+)$")) +GLOBAL_DATUM_INIT(has_eol_punctuation, /regex, regex(@"^(\w|^[^\*].*[^.!?~\-\+\|\_\*]+)$")) //Auto punctuation global datum From b14314b699e93b190e7380ee4d1f16bd8f80d0c9 Mon Sep 17 00:00:00 2001 From: ReturnToZender Date: Wed, 1 Nov 2023 02:25:45 -0500 Subject: [PATCH 3/3] Removes observersay punct --- code/modules/mob/dead/observer/say.dm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index 8ec8a54dcd0a..c5c7350b4781 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -3,11 +3,6 @@ if (!message) return - //SPLURT Edit Start: adds automatic punctuation - if(findtext(message, GLOB.has_eol_punctuation)) - message += "." - //SPLURT Edit End: adds automatic punctuation - var/message_mode = get_message_mode(message) if(client && (message_mode == MODE_ADMIN || message_mode == MODE_DEADMIN)) message = copytext_char(message, 3)