mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2025-12-11 03:10:28 +00:00
@@ -264,6 +264,39 @@
|
||||
/proc/capitalize(var/t as text)
|
||||
return uppertext(copytext(t, 1, 2)) + copytext(t, 2)
|
||||
|
||||
/proc/autocorrect(var/input as text) // syntax is "stringtoreplace"="stringtoreplacewith"
|
||||
return input = replace_characters(input, list(
|
||||
" i "=" I ",
|
||||
"i'm"="I'm",
|
||||
"s's"="s'",
|
||||
"isnt"="isn't",
|
||||
"dont"="don't",
|
||||
"shouldnt"="shouldn't",
|
||||
" ive "=" I've ",
|
||||
"whos"="who's",
|
||||
"whove"="who've",
|
||||
"whod"="who’d",
|
||||
"whats"="what’s",
|
||||
"whatd"="what’d",
|
||||
"thats"="that’s",
|
||||
"thatll"="that’ll",
|
||||
"thatd"="that’d",
|
||||
" nows "=" now’s ",
|
||||
"isnt"="isn’t",
|
||||
" arent "=" aren’t ",
|
||||
"wasnt"="wasn’t",
|
||||
"werent"="weren’t",
|
||||
"havent"="haven’t",
|
||||
"hasnt"="hasn’t",
|
||||
"hadnt"="hadn’t",
|
||||
"doesnt"="doesn’t",
|
||||
"didnt"="didn’t",
|
||||
"couldnt"="couldn’t",
|
||||
"wouldnt"="wouldn’t",
|
||||
"mustnt"="mustn’t",
|
||||
"shouldnt"="shouldn’t"
|
||||
))
|
||||
|
||||
//This proc strips html properly, remove < > and all text between
|
||||
//for complete text sanitizing should be used sanitize()
|
||||
/proc/strip_html_properly(var/input)
|
||||
|
||||
@@ -342,3 +342,9 @@ var/list/_client_preferences_by_type
|
||||
enabled_by_default = FALSE
|
||||
enabled_description = "Obfuscate Ghost"
|
||||
disabled_description = "Normal Ghost"
|
||||
|
||||
/datum/client_preference/autocorrect
|
||||
description = "Autocorrect"
|
||||
key = "AUTOCORRECT"
|
||||
enabled_description = "Enabled"
|
||||
disabled_description = "Disabled"
|
||||
|
||||
@@ -215,6 +215,10 @@ proc/get_radio_key_from_channel(var/channel)
|
||||
//Autohiss handles auto-rolling tajaran R's and unathi S's/Z's
|
||||
message = handle_autohiss(message, speaking)
|
||||
|
||||
//autocorrect common typos
|
||||
if(client?.is_preference_enabled(/datum/client_preference/autocorrect))
|
||||
message = autocorrect(message)
|
||||
|
||||
//Whisper vars
|
||||
var/w_scramble_range = 5 //The range at which you get ***as*th**wi****
|
||||
var/w_adverb //An adverb prepended to the verb in whispers
|
||||
|
||||
Reference in New Issue
Block a user