mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-06-11 17:24:18 +01:00
4178c209f1
* Configuration datum refactor * More WIP * New easier on the eyes format * More WIP * Finished config.txt * Fucktons more WIP * The end of conversion draws near... * Add all this shit * Done converting entries finally * Hunting down compile errors * More WIP * MORE CONVERSIONS * More WIP * More WIP * Oh shit only 90 errors this time! * IT COMPILES!!! * Fixes world start runtimes
31 lines
695 B
Plaintext
31 lines
695 B
Plaintext
/proc/emoji_parse(text)
|
|
. = text
|
|
if(!CONFIG_GET(flag/emojis))
|
|
return
|
|
var/static/list/emojis = icon_states(icon('icons/emoji.dmi'))
|
|
var/parsed = ""
|
|
var/pos = 1
|
|
var/search = 0
|
|
var/emoji = ""
|
|
while(1)
|
|
search = findtext(text, ":", pos)
|
|
parsed += copytext(text, pos, search)
|
|
if(search)
|
|
pos = search
|
|
search = findtext(text, ":", pos+1)
|
|
if(search)
|
|
emoji = lowertext(copytext(text, pos+1, search))
|
|
if(emoji in emojis)
|
|
parsed += icon2html('icons/emoji.dmi', world, emoji)
|
|
pos = search + 1
|
|
else
|
|
parsed += copytext(text, pos, search)
|
|
pos = search
|
|
emoji = ""
|
|
continue
|
|
else
|
|
parsed += copytext(text, pos, search)
|
|
break
|
|
return parsed
|
|
|