Ports CM's langchat to replace floating chat. (#20818)

Works generally better and will allow for better customization and emote
display.

---------

Co-authored-by: realmattatlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2025-07-07 23:55:26 +00:00
committed by GitHub
co-authored by realmattatlas
parent 2700e9b9ca
commit 1738301ea7
26 changed files with 533 additions and 245 deletions
+6 -13
View File
@@ -149,7 +149,6 @@
return pretext + nametext + subtext
/mob/proc/custom_emote(var/m_type = VISIBLE_MESSAGE, var/message = null, var/do_show_observers = TRUE)
if((usr && stat) || (!use_me && usr == src))
to_chat(src, "You are unable to emote.")
return
@@ -157,27 +156,21 @@
if(!message)
return
var/animated_chat_message = message
message = format_emote(src, message)
if (message)
log_emote("[name]/[key] : [message]")
message = process_chat_markup(message, list("~", "_"))
var/langchat_message = message
message = format_emote(src, message)
var/list/emote_viewers = list()
if(m_type == VISIBLE_MESSAGE)
visible_message(message, show_observers = do_show_observers)
emote_viewers = viewers(world.view, src)
else
audible_message(message, ghost_hearing = do_show_observers)
emote_viewers = get_hearers_in_LOS(world.view, src)
var/list/hearers = get_hearers_in_view(7, src)
var/list/hear_clients = list()
for(var/mob/M in hearers)
if(M.client)
hear_clients |= M.client
animated_chat_message = SPAN_COLOR("#f3ef09", "*") + animated_chat_message
animate_chat(animated_chat_message, null, TRUE, hear_clients, 30)
langchat_speech(langchat_message, emote_viewers, GLOB.all_languages, skip_language_check = TRUE, additional_styles = list("emote", "langchat_small"))
// Specific mob type exceptions below.
/mob/living/silicon/ai/emote(var/act, var/type, var/message)