mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
Merge pull request #6425 from JJRcop/OOCemoji
Adds emoji to OOC chat [Now with in-house sprites!]
This commit is contained in:
@@ -109,6 +109,7 @@
|
||||
|
||||
var/rename_cyborg = 0
|
||||
var/ooc_during_round = 0
|
||||
var/emojis = 0
|
||||
|
||||
//Used for modifying movement speed for mobs.
|
||||
//Unversal modifiers
|
||||
@@ -300,6 +301,8 @@
|
||||
config.rename_cyborg = 1
|
||||
if("ooc_during_round")
|
||||
config.ooc_during_round = 1
|
||||
if("emojis")
|
||||
config.emojis = 1
|
||||
if("run_delay")
|
||||
config.run_speed = text2num(value)
|
||||
if("walk_delay")
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
if(prefs.toggles & MEMBER_PUBLIC)
|
||||
keyname = "<font color='[prefs.ooccolor]'><img style='width:9px;height:9px;' class=icon src=\ref['icons/member_content.dmi'] iconstate=blag>[keyname]</font>"
|
||||
|
||||
msg = emoji_parse(msg)
|
||||
|
||||
for(var/client/C in clients)
|
||||
if(C.prefs.toggles & CHAT_OOC)
|
||||
if(holder)
|
||||
|
||||
@@ -68,6 +68,8 @@
|
||||
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
|
||||
if(!msg) return
|
||||
|
||||
msg = emoji_parse(msg)
|
||||
|
||||
if(C.holder)
|
||||
if(holder) //both are admins
|
||||
C << "<font color='red'>Admin PM from-<b>[key_name(src, C, 1)]</b>: [msg]</font>"
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
var/list/emojis
|
||||
|
||||
/proc/emoji_parse(text)
|
||||
if(!config.emojis)
|
||||
return text
|
||||
if(!emojis)
|
||||
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 += "<img class=icon src=\ref['icons/emoji.dmi'] iconstate='[emoji]'>"
|
||||
pos = search + 1
|
||||
else
|
||||
parsed += copytext(text, pos, search)
|
||||
pos = search
|
||||
emoji = ""
|
||||
continue
|
||||
else
|
||||
parsed += copytext(text, pos, search)
|
||||
break
|
||||
return parsed
|
||||
|
||||
@@ -27,6 +27,10 @@ REVIVAL_BRAIN_LIFE -1
|
||||
#Comment this out if you want OOC to be automatically disabled during the round, it will be enabled during the lobby and after the round end results.
|
||||
OOC_DURING_ROUND
|
||||
|
||||
### EMOJI ###
|
||||
#Comment this out if you want to disable emojis
|
||||
EMOJIS
|
||||
|
||||
### MOB MOVEMENT ###
|
||||
|
||||
## We suggest editing these variables ingame to find a good speed for your server.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
author: JJRcop, Nienhaus
|
||||
delete-after: True
|
||||
changes:
|
||||
- rscadd: "Adds emoji to OOC chat."
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
@@ -854,6 +854,7 @@
|
||||
#include "code\modules\detectivework\evidence.dm"
|
||||
#include "code\modules\detectivework\footprints_and_rag.dm"
|
||||
#include "code\modules\detectivework\scanner.dm"
|
||||
#include "code\modules\emoji\emoji_parse.dm"
|
||||
#include "code\modules\events\alien_infestation.dm"
|
||||
#include "code\modules\events\anomaly.dm"
|
||||
#include "code\modules\events\anomaly_bluespace.dm"
|
||||
|
||||
Reference in New Issue
Block a user