Skip to content

Commit

Permalink
Adds auto punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
ReturnToZender committed Oct 26, 2023
1 parent 7da7acb commit 1569628
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/__SPLURTCODE/DEFINES/autopunctuation.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GLOBAL_DATUM_INIT(has_eol_punctuation, /regex, regex(@"^(\w|^[^\*].*[^.!?~\+\|\_]+)$"))
//Auto punctuation global datum
5 changes: 5 additions & 0 deletions code/modules/mob/dead/observer/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1569628

Please sign in to comment.