mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-22 11:36:38 +01:00
@@ -5,6 +5,7 @@
|
||||
/datum/configuration
|
||||
var/discord_restriction = 0
|
||||
var/use_jobwhitelist = 0
|
||||
var/emojis = 1
|
||||
|
||||
/hook/startup/proc/read_ch_config()
|
||||
var/list/Lines = file2list("config/config.txt")
|
||||
@@ -35,4 +36,6 @@
|
||||
config.discord_restriction = 1
|
||||
if ("use_jobwhitelist")
|
||||
config.use_jobwhitelist = 1
|
||||
if ("disable_emojis")
|
||||
config.emojis = 0
|
||||
return 1
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
if(telemob.can_be_drop_prey && telenommer.can_be_drop_pred)
|
||||
return 1
|
||||
obstructed = 1
|
||||
else if(!isturf(destination.loc) || !destination.x || !destination.y || !destination.z) //If we're inside something or outside universe
|
||||
else if(!destination.x || !destination.y || !destination.z) //If we're inside something or outside universe
|
||||
obstructed = 1
|
||||
to_chat(teleatom, "<span class='warning'>Something is blocking way on the other side!</span>")
|
||||
if(obstructed)
|
||||
|
||||
+11
-3
@@ -12,13 +12,18 @@
|
||||
src << "Guests may not use OOC."
|
||||
return
|
||||
|
||||
//Chompstation ADD
|
||||
msg = sanitize(msg)
|
||||
if(!msg) return
|
||||
|
||||
//Chompstation ADD - Emoji Parsing
|
||||
msg = emoji_parse(msg)
|
||||
|
||||
|
||||
//Chompstation ADD - IC in OOC Warning filter
|
||||
if((copytext(msg, 1, 2) in list(".",";",":","#")) || (findtext(lowertext(copytext(msg, 1, 5)), "say")))
|
||||
if(alert("Your message \"[msg]\" looks like it was meant for in game communication, say it in OOC?", "Meant for OOC?", "No", "Yes") != "Yes")
|
||||
return
|
||||
|
||||
msg = sanitize(msg)
|
||||
if(!msg) return
|
||||
|
||||
if(!is_preference_enabled(/datum/client_preference/show_ooc))
|
||||
src << "<span class='warning'>You have OOC muted.</span>"
|
||||
@@ -96,6 +101,9 @@
|
||||
if(!msg)
|
||||
return
|
||||
|
||||
//Chompstation ADD - Emoji Parsing
|
||||
msg = emoji_parse(msg)
|
||||
|
||||
if(!is_preference_enabled(/datum/client_preference/show_looc))
|
||||
src << "<span class='danger'>You have LOOC muted.</span>"
|
||||
return
|
||||
|
||||
@@ -106,6 +106,8 @@
|
||||
|
||||
log_adminpm(msg,src,C)
|
||||
send2adminirc("Reply: [key_name(src)]->[key_name(C)]: [html_decode(msg)]")
|
||||
msg = emoji_parse(msg) //Chompstation ADD - Emojis
|
||||
|
||||
|
||||
//we don't use message_admins here because the sender/receiver might get it too
|
||||
for(var/client/X in admins)
|
||||
@@ -126,6 +128,8 @@
|
||||
return
|
||||
|
||||
sanitize(msg)
|
||||
msg = emoji_parse(msg) //Chompstation ADD - Emojis
|
||||
|
||||
|
||||
// Handled on Bot32's end, unsure about other bots
|
||||
// if(length(msg) > 400) // TODO: if message length is over 400, divide it up into seperate messages, the message length restriction is based on IRC limitations. Probably easier to do this on the bots ends.
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/proc/emoji_parse(text)
|
||||
. = text
|
||||
if(!config.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 += " <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
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@@ -1661,6 +1661,7 @@
|
||||
#include "code\modules\economy\price_list.dm"
|
||||
#include "code\modules\economy\retail_scanner.dm"
|
||||
#include "code\modules\economy\TradeDestinations.dm"
|
||||
#include "code\modules\emoji\emoji_parse.dm"
|
||||
#include "code\modules\entopics_vr\alternate_appearance.dm"
|
||||
#include "code\modules\entopics_vr\entopics.dm"
|
||||
#include "code\modules\error_handler\_defines.dm"
|
||||
|
||||
Reference in New Issue
Block a user