Skip to content

Commit

Permalink
Fixes Langchat X offsets for Megaphone/Xenos (#4725)
Browse files Browse the repository at this point in the history
# About the pull request

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

Langchat has incorrect calc for X offsets, which results in goofy speech
through megaphone and some big xenos text being off-center

This brings them in line accounting for atom dimension using
`get_pixel_position_x`

# Explain why it's good for the game
Looks less goofy especially for megaphone

# Testing Photographs and Procedure
Tested megaphone and queen result in centered text. Also tested
adjusting pixel_x on source atom and that it was still the case.

I'd post an image of the problem but all i have is current round's

# Changelog
:cl:
fix: Xeno and Megaphone abovehead chat speech should now properly be
centered horizontally.
/:cl:
  • Loading branch information
fira committed Oct 20, 2023
1 parent 2d3d8a8 commit cfcb282
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/datums/langchat/langchat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#define LANGCHAT_LONGEST_TEXT 64
#define LANGCHAT_WIDTH 96
#define LANGCHAT_X_OFFSET -32
#define LANGCHAT_MAX_ALPHA 196

//pop defines
Expand Down Expand Up @@ -57,7 +56,7 @@
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 = LANGCHAT_X_OFFSET
langchat_image.maptext_x = - world.icon_size - get_pixel_position_x(src, TRUE)
langchat_image.maptext_y -= LANGCHAT_MESSAGE_POP_Y_SINK

langchat_image.pixel_y = 0
Expand Down Expand Up @@ -149,6 +148,7 @@

langchat_image.maptext = text_to_display
langchat_image.maptext_width = LANGCHAT_WIDTH * 2
langchat_image.maptext_x -= LANGCHAT_WIDTH / 2

langchat_listeners = listeners
for(var/mob/M in langchat_listeners)
Expand Down

0 comments on commit cfcb282

Please sign in to comment.