Skip to content

Fix chat preset colors without an alpha value#5034

Open
HeresHavi wants to merge 1 commit into
multitheftauto:masterfrom
HeresHavi:chat-preset-missing-alpha
Open

Fix chat preset colors without an alpha value#5034
HeresHavi wants to merge 1 commit into
multitheftauto:masterfrom
HeresHavi:chat-preset-missing-alpha

Conversation

@HeresHavi

@HeresHavi HeresHavi commented Jul 12, 2026

Copy link
Copy Markdown

Summary

Fixed chat preset colors without an alpha value loading as fully transparent.

RGB-only colors now default to an alpha value of 255, while colors with an explicit alpha keep their saved value. Presets with invalid RGB values are ignored.

Motivation

The preset loader always tried to read four color values. When a preset only contained RGB values, reading the missing alpha failed and the color was applied with a transparency value of 0.

For example, loading the bundled MTA Blue preset changed Chat Text to 255 255 255 0, making the preview fully transparent.

Fixes #5033.

Test plan

Runtime

  • Before Fix: Loading MTA Blue changed Chat Text to 255 255 255 0.
  • After Fix: The same preset loaded as 255 255 255 255, and white chat text remained visible in-game.
  • Valid Case: Race Oversized preserved its explicit 172 213 254 255 color.
  • Invalid Input: A preset containing 10 invalid 30 left the existing color unchanged.
  • Persistence: Reopened Settings and restarted MTA, then confirmed 255 255 255 255 remained saved.

Builds and Tests

  • Debug | Win32: Client Core build passed, 304 client tests passed.
  • Release | Win32: Full solution build passed, 304 client tests passed.

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat presets without an alpha value load as fully transparent

1 participant