DopplerShift13 / DopplerShift

Doppler Shift, a /tg/station Fork for SS13
https://dopplershift13.com/
GNU Affero General Public License v3.0
7 stars 22 forks source link

1984 (Autopunctuation) #154

Closed Nerev4r closed 1 week ago

Nerev4r commented 1 week ago

About The Pull Request

Code by Yooriss, I just work here. This PR introduces basic automatic punctuation for the following circumstances on living mobs only, and only for says (/me or emotes that aren't special say-emotes are unaffected):

If a chat message does not end in any kind of punctuation (like a period (.), a comma (,), a question mark (?), an exclamation mark (!) or a hyphen (-)), a period is automatically added to the end.
Any kind of lowercase 'i' between word boundaries is automatically converted to uppercase.

To be completely clear: this does not affect PDA's, asterisk emotes (*emotes), full emotes, announcements or basically any other non-speaking form of communication. It affects speech, so says and radio chatter only. PDAspeak enjoyers can continue to sling slang at one another without The Man moderating their grammar.

I've strategically chosen these two changes to produce what I believe to be most comfortable compromise between an easy chatting experience and having dialogue look clean, while also allowing for people to continue to flavour their character's speech patterns as appropriate.

There is one caveat: if you make use of in-game bold/italics/underline formatting, the autopunct function this PR adds will not add an additional end-of-line period if your message does not contain one. For example: |I can't believe you've done this| will not have a period added - you'll need to do this yourself.

I've confirmed with our unofficial TGcode liaison (goof) that regex filters have negligible performance impacts (and that any concerns that they did was largely what he describes as 'cargo cult' behavior). See for yourself on /tg/'s Discord here, if you like.

tl;dr: easier and faster Good Chatting (tm) with likely little performance impact

Why It's Good For The Game

I swear to God.

Changelog

:cl: add: Automatic punctuation! /:cl: