Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Lagnchat Xeno offsets again, final edition i swear #4771

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions code/datums/langchat/langchat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading