From 0c9213df19386a3a92e0a0b94113bfbe04a913c6 Mon Sep 17 00:00:00 2001 From: EgorDinamit <53223414+EgorDinamit@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:15:50 +0300 Subject: [PATCH] Minor floating chat tweaks (#557) --- code/game/atoms_movable.dm | 6 ++++++ code/modules/mob/floating_message.dm | 9 +++++---- code/modules/mob/mob.dm | 6 ++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b3af9fb07e2..59e4f9cfe5b 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -354,3 +354,9 @@ if(SEND_SIGNAL(src, COMSIG_ATOM_MOVABLE_DISPELL, dispell_strength) & COMPONENT_DISPELL_BLOCKED) return FALSE return TRUE + +/atom/movable/proc/GetOverheadTextXOffset() + return pixel_x + +/atom/movable/proc/GetOverheadTextYOffset() + return pixel_y diff --git a/code/modules/mob/floating_message.dm b/code/modules/mob/floating_message.dm index 087377b3669..6c9f96cc296 100644 --- a/code/modules/mob/floating_message.dm +++ b/code/modules/mob/floating_message.dm @@ -59,20 +59,21 @@ var/global/list/floating_chat_colors = list() for(var/client/C in show_to) if(!C.mob.is_deaf() && C.get_preference_value(/datum/client_preference/floating_messages) == GLOB.PREF_SHOW) - if(C.mob.say_understands(null, language)) + if(C.mob.say_understands(src, language)) C.images += understood else C.images += gibberish /proc/generate_floating_text(atom/movable/holder, message, style, size, duration, show_to) var/image/I = image(null, get_atom_on_turf(holder)) - I.layer=FLY_LAYER + I.plane = HUD_PLANE + I.layer = HUD_ABOVE_ITEM_LAYER I.alpha = 0 I.maptext_width = CHAT_MESSAGE_WIDTH I.maptext_height = CHAT_MESSAGE_HEIGHT I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA | KEEP_APART - I.plane = EFFECTS_ABOVE_LIGHTING_PLANE - I.pixel_w = -round(I.maptext_width/2) + 16 + I.pixel_w = -round(I.maptext_width/2) + 16 + holder.GetOverheadTextXOffset() + I.pixel_z = holder.GetOverheadTextYOffset() style = "font-family: 'Small Fonts'; -dm-text-outline: 1px black; font-size: [size]px; line-height: 1.1; [style]" I.maptext = "