[READY] Mime PDAs only accept emojis for messages, mime cartridge comes with an emoji guidebook (#47177)

* relic file

* Revert "Merge branch 'master' of https://github.com/tralezab/tgstation"

This reverts commit 826916d87b421dbb0ebcfce7fad96e456b6d3674, reversing
changes made to a0f476d874.

* mime pda

* hey maybe it works

* some steps forward

* IT WORKS HAHAHA YAAAAAAAAAAAAAAAAA

* logged properly in everything
This commit is contained in:
tralezab
2019-10-22 20:19:21 -07:00
committed by Rob Bailey
parent d86515fea9
commit fcf2dbfa02
6 changed files with 75 additions and 11 deletions
+20 -1
View File
@@ -1,4 +1,4 @@
/proc/emoji_parse(text)
/proc/emoji_parse(text) //turns :ai: into an emoji in text.
. = text
if(!CONFIG_GET(flag/emojis))
return
@@ -30,3 +30,22 @@
break
return parsed
/proc/emoji_sanitize(text) //cuts any text that would not be parsed as an emoji
. = text
if(!CONFIG_GET(flag/emojis))
return
var/static/list/emojis = icon_states(icon('icons/emoji.dmi'))
var/final = "" //only tags are added to this
var/pos = 1
var/search = 0
while(1)
search = findtext(text, ":", pos)
if(search)
pos = search
search = findtext(text, ":", pos+1)
if(search)
final += lowertext(copytext(text, pos, search+1))
pos = search + 1
continue
break
return final