[MIRROR] chat Timestamps for TG chat + some fixes (#7804)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2
2024-02-21 19:37:58 +01:00
committed by GitHub
co-authored by Kashargul
parent 431e841e0c
commit 7eabb7b371
13 changed files with 139 additions and 42 deletions
+15 -12
View File
@@ -38,9 +38,6 @@
raw_msg += (piece + " ")
if(!speaker.client)
piece = "<span class='npcsay'>[piece]</span>"
//HTML formatting
if(!SP.speaking) // Catch the most generic case first
piece = "<span class='message body'>[piece]</span>"
@@ -125,7 +122,7 @@
if(check_mentioned(multilingual_to_message(message_pieces)) && is_preference_enabled(/datum/client_preference/check_mention))
message_to_send = "<font size='3'><b>[message_to_send]</b></font>"
on_hear_say(message_to_send)
on_hear_say(message_to_send, speaker)
create_chat_message(speaker, combined["raw"], italics, list())
if(speech_sound && (get_dist(speaker, src) <= world.view && z == speaker.z))
@@ -140,25 +137,29 @@
if(has_AI()) // Won't happen if no ai_holder exists or there's a player inside w/o autopilot active.
ai_holder.on_hear_say(speaker, multilingual_to_message(message_pieces))
/mob/proc/on_hear_say(var/message)
/mob/proc/on_hear_say(var/message, var/mob/speaker = null)
var/time = say_timestamp()
if(client)
if(client.prefs.chat_timestamp)
to_chat(src, "<span class='game say'>[time] [message]</span>")
else
to_chat(src, "<span class='game say'>[message]</span>")
message = "[time] [message]"
message = "<span class='game say'>[message]</span>"
if(speaker && !speaker.client)
message = "<span class='npcsay'>[message]</span>"
to_chat(src, message)
else if(teleop)
to_chat(teleop, "<span class='game say'>[create_text_tag("body", "BODY:", teleop.client)][message]</span>")
else
to_chat(src, "<span class='game say'>[message]</span>")
/mob/living/silicon/on_hear_say(var/message)
/mob/living/silicon/on_hear_say(var/message, var/mob/speaker = null)
var/time = say_timestamp()
if(client)
if(client.prefs.chat_timestamp)
to_chat(src, "<span class='game say'>[time] [message]</span>")
else
to_chat(src, "<span class='game say'>[message]</span>")
message = "[time] [message]"
message = "<span class='game say'>[message]</span>"
if(speaker && !speaker.client)
message = "<span class='npcsay'>[message]</span>"
to_chat(src, message)
else if(teleop)
to_chat(teleop, "<span class='game say'>[create_text_tag("body", "BODY:", teleop.client)][message]</span>")
else
@@ -330,4 +331,6 @@
name = speaker.voice_name
var/rendered = "<span class='game say'><span class='name'>[name]</span> [message]</span>"
if(!speaker.client)
rendered = "<span class='npcsay'>[rendered]</span>"
to_chat(src, rendered)
@@ -406,7 +406,7 @@ GLOBAL_LIST_INIT(digest_modes, list())
new_percent = (L.health / L.maxHealth) * 100
var/lets_announce = FALSE
if(new_percent <= 99 && old_percent > 99)
if(new_percent <= 95 && old_percent > 95)
lets_announce = TRUE
else if(new_percent <= 75 && old_percent > 75)
lets_announce = TRUE
@@ -414,7 +414,7 @@ GLOBAL_LIST_INIT(digest_modes, list())
lets_announce = TRUE
else if(new_percent <= 25 && old_percent > 25)
lets_announce = TRUE
else if(new_percent <= 5 && old_percent > 5)
else if(new_percent <= 0 && old_percent > 0)
lets_announce = TRUE
if(lets_announce)
@@ -459,7 +459,7 @@ GLOBAL_LIST_INIT(digest_modes, list())
var/old_percent = ((old_nutrition - 100) / 500) * 100
var/new_percent = ((L.nutrition - 100) / 500) * 100
var/lets_announce = FALSE
if(new_percent <= 99 && old_percent > 99)
if(new_percent <= 95 && old_percent > 95)
lets_announce = TRUE
else if(new_percent <= 75 && old_percent > 75)
lets_announce = TRUE
@@ -483,7 +483,7 @@ GLOBAL_LIST_INIT(digest_modes, list())
var/new_percent = ((L.nutrition - 100) / 500) * 100
var/lets_announce = FALSE
if(new_percent <= 99 && old_percent > 99)
if(new_percent <= 95 && old_percent > 95)
lets_announce = TRUE
else if(new_percent <= 75 && old_percent > 75)
lets_announce = TRUE
+1
View File
@@ -2471,6 +2471,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
SEND_SOUND(ourtarget, sound(get_sfx("classic_death_sounds")))
else
SEND_SOUND(ourtarget, sound(get_sfx("fancy_death_prey")))
ourtarget.mind?.vore_death = TRUE
b.handle_digestion_death(ourtarget)
if("Absorb")
if(tgui_alert(ourtarget, "\The [usr] is attempting to instantly absorb you. Is this something you are okay with happening to you?","Instant Absorb", list("No", "Yes")) != "Yes")