diff --git a/code/datums/langchat/langchat.dm b/code/datums/langchat/langchat.dm index 3f00c26b6d36..83b9be0ac053 100644 --- a/code/datums/langchat/langchat.dm +++ b/code/datums/langchat/langchat.dm @@ -47,6 +47,13 @@ M.client.images -= langchat_image langchat_listeners = null +/atom/proc/langchat_set_x_offset() + langchat_image.maptext_x = world.icon_size / 2 - langchat_image.maptext_width / 2 +/atom/movable/langchat_set_x_offset() + langchat_image.maptext_x = bound_width / 2 - langchat_image.maptext_width / 2 +/mob/langchat_set_x_offset() + langchat_image.maptext_x = icon_size / 2 - langchat_image.maptext_width / 2 + ///Creates the image if one does not exist, resets settings that are modified by speech procs. /atom/proc/langchat_make_image(override_color = null) if(!langchat_image) @@ -56,8 +63,8 @@ langchat_image.appearance_flags = NO_CLIENT_COLOR|KEEP_APART|RESET_COLOR|RESET_TRANSFORM langchat_image.maptext_y = langchat_height langchat_image.maptext_height = 64 - langchat_image.maptext_x = - world.icon_size - get_pixel_position_x(src, TRUE) langchat_image.maptext_y -= LANGCHAT_MESSAGE_POP_Y_SINK + langchat_set_x_offset() langchat_image.pixel_y = 0 langchat_image.alpha = 0 @@ -102,7 +109,7 @@ langchat_image.maptext = text_to_display langchat_image.maptext_width = LANGCHAT_WIDTH - langchat_image.maptext_x = - world.icon_size - get_pixel_position_x(src, TRUE) + langchat_set_x_offset() langchat_listeners = listeners for(var/mob/M in langchat_listeners) @@ -149,7 +156,7 @@ langchat_image.maptext = text_to_display langchat_image.maptext_width = LANGCHAT_WIDTH * 2 - langchat_image.maptext_x = - world.icon_size - get_pixel_position_x(src, TRUE) - LANGCHAT_WIDTH / 2 + langchat_set_x_offset() langchat_listeners = listeners for(var/mob/M in langchat_listeners)