Skip to content

Conversation

shadylua
Copy link
Contributor

@shadylua shadylua commented Aug 18, 2025

When colorCoded = true, the chat message length calculation was incorrectly counting hex color codes as part of the text. This caused the message width to be miscalculated, so some texts did not fit properly in the chat box.

This PR updates the logic to ignore hex color codes during length calculation, ensuring that only visible characters are counted.

Result

Chat messages now display correctly without being cut off.

Length is calculated only from visible text, not formatting codes.

image

Shady1 and others added 2 commits August 19, 2025 00:57
When colorCoded = true, the chat message length calculation was incorrectly counting hex color codes as part of the text.
This caused the message width to be miscalculated, so some texts did not fit properly in the chat box.

This PR updates the logic to ignore hex color codes during length calculation, ensuring that only visible characters are counted.

Result

Chat messages now display correctly without being cut off.

Length is calculated only from visible text, not formatting codes.
@tederis tederis merged commit 9a0b1d5 into multitheftauto:master Aug 20, 2025
7 checks passed
MTABot pushed a commit that referenced this pull request Aug 20, 2025
9a0b1d5 Fix chat message length calculation with colorCoded enabled (#4370)
@FileEX FileEX added the bugfix Solution to a bug of any kind label Aug 31, 2025
@FileEX FileEX added this to the 1.7.1 milestone Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants