Various TG Chat message sorting fixes (#25229)

* Fixes unsorted emotes, announcements, votes, surgery, prayers, ahelp responses

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
S34N
2024-04-29 03:07:25 +01:00
committed by GitHub
parent 4add53d6c1
commit 2e4089dc15
28 changed files with 368 additions and 209 deletions
@@ -217,7 +217,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/obj/machinery/cryopod/P = istype(loc, /obj/machinery/cryopod) && loc
if(frozen)
to_chat(src, "<span class='warning'>You cannot do this while admin frozen.</span>")
to_chat(src, "<span class='warning'>You cannot do this while admin frozen.</span>", MESSAGE_TYPE_WARNING)
message_admins("[key_name_admin(src)] tried to ghost while admin frozen")
return
@@ -99,7 +99,7 @@
to_chat(src, "<i><span class='game say'>Holopad action relayed, <span class='name'>[real_name]</span> <span class='message'>[message]</span></span></i>")
for(var/mob/M in viewers(T.loc))
M.show_message(rendered, EMOTE_VISIBLE)
M.show_message(rendered, EMOTE_VISIBLE, chat_message_type = MESSAGE_TYPE_LOCALCHAT)
log_emote("(HPAD) [message]", src)
else //This shouldn't occur, but better safe then sorry.
@@ -399,7 +399,7 @@ Difficulty: Medium
return FALSE
return ..()
/mob/living/simple_animal/hostile/megafauna/dragon/visible_message(message, self_message, blind_message)
/mob/living/simple_animal/hostile/megafauna/dragon/visible_message(message, self_message, blind_message, chat_message_type)
if(swooping & SWOOP_INVULNERABLE) //to suppress attack messages without overriding every single proc that could send a message saying we got hit
return
return ..()
+20 -20
View File
@@ -106,31 +106,31 @@
usr.show_message(t, EMOTE_VISIBLE)
/mob/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
if(!client) return
/mob/proc/show_message(msg, type, alt, alt_type, chat_message_type) // Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
if(!client)
return
if(type)
if(type & EMOTE_VISIBLE && !has_vision(information_only=TRUE))//Vision related
if(type & EMOTE_VISIBLE && !has_vision(information_only = TRUE)) // Vision related
if(!alt)
return
else
msg = alt
type = alt_type
if(type & EMOTE_AUDIBLE && !can_hear())//Hearing related
msg = alt
type = alt_type
if(type & EMOTE_AUDIBLE && !can_hear()) // Hearing related
if(!alt)
return
else
msg = alt
type = alt_type
if(type & EMOTE_VISIBLE && !has_vision(information_only=TRUE))
return
msg = alt
type = alt_type
if(type & EMOTE_VISIBLE && !has_vision(information_only = TRUE))
return
// Added voice muffling for Issue 41.
if(stat == UNCONSCIOUS)
to_chat(src, "<I>... You can almost hear someone talking ...</I>")
else
to_chat(src, msg)
return
to_chat(src, "<i>... You can almost hear someone talking ...</i>", MESSAGE_TYPE_LOCALCHAT)
return
to_chat(src, msg, chat_message_type)
// Show a message to all mobs in sight of this one
// This would be for visible actions by the src mob
@@ -138,7 +138,7 @@
// self_message (optional) is what the src mob sees e.g. "You do something!"
// blind_message (optional) is what blind people will hear e.g. "You hear something!"
/mob/visible_message(message, self_message, blind_message)
/mob/visible_message(message, self_message, blind_message, chat_message_type)
if(!isturf(loc)) // mobs inside objects (such as lockers) shouldn't have their actions visible to those outside the object
for(var/mob/M as anything in get_mobs_in_view(3, src))
if(M.see_invisible < invisibility)
@@ -150,7 +150,7 @@
if(!blind_message) // for some reason VISIBLE action has blind_message param so if we are not in the same object but next to it, lets show it
continue
msg = blind_message
M.show_message(msg, EMOTE_VISIBLE, blind_message, EMOTE_AUDIBLE)
M.show_message(msg, EMOTE_VISIBLE, blind_message, EMOTE_AUDIBLE, chat_message_type)
return
for(var/mob/M as anything in get_mobs_in_view(7, src))
if(M.see_invisible < invisibility)
@@ -158,7 +158,7 @@
var/msg = message
if(self_message && M == src)
msg = self_message
M.show_message(msg, EMOTE_VISIBLE, blind_message, EMOTE_AUDIBLE)
M.show_message(msg, EMOTE_VISIBLE, blind_message, EMOTE_AUDIBLE, chat_message_type)
// Show a message to all mobs in sight of this atom
// Use for objects performing visible actions
+2 -2
View File
@@ -29,9 +29,9 @@
for(var/mob/M in src.contents)
M.attackby(W,user, params)
/obj/item/holder/proc/show_message(message, m_type)
/obj/item/holder/proc/show_message(message, m_type, chat_message_type)
for(var/mob/living/M in contents)
M.show_message(message,m_type)
M.show_message(message, m_type, chat_message_type)
/obj/item/holder/emp_act(intensity)
for(var/mob/living/M in contents)