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
Add hex and RGB(A) support to all map color attributes #1258
Comments
Are legacy vehicle colors supported? |
and are you 100% that allowing different types of colors in a single attribute is a good idea? |
By legacy colors you probably mean the palette colors. Yes, they are still supported same as before. This is also tested in the provided map file above. As for mixed values, I think it is trivial, but to be honest I don't see any issues with having it either. This is actually an "unintended" side-effect of the simplified C++ code to be able to read colors despite odd types mixed together. I didn't want to limit it to a single type. But I think it is not a bad side-effect as it doesn't break anything and is logical. I think it could be kept as undocumented behavior, as it is not good practice for mappers to do that. |
* Fix #1258: Add mixed hex and RGBA parsing to XMLColorToInt `XMLColorToInt` is used when parsing i.e. `color` attribute from map files on various elements such as vehicles, blips, radarareas, teams and so on. Before it only supported a single format for multi-value attributes. So now it is possible to specify separate colors like so: `#ff0, 255, 0, 0, #ff0000, #ffffff55` Which corresponds: yellow, red, red, transparent white * Use unsigned int * Handle empty strings as RGB skip
Fix due in next branch to be merged for 1.6 because it is not entirely backwards compatible. Requires tweaks in race gamemode. See issue #1393. |
According to #1393 this PR changes the behaviour of
Are you certain that |
Indeed change in behavior of getColorFromString is unintentional and went unnoticed. As described on the Wiki page and previous behavior:
This no longer holds true as of the change and we need to find a solution to this.
To me,
Some possible solutions:
All of these fixes can be deployed in 1.5.8 instead of 1.6. |
Is your feature request related to a problem? Please describe.
It seems various color formats like hex or RGB(A) aren't supported for many element types like
radararea
andblip
but throw an error instead.This is a breaking change. For example the race gamemode depends on this old behavior as described in #1393
Describe the solution you'd like
Make color format support consistent across element types.
Describe alternatives you've considered
Use of a third-party script to convert unsupported color values in map files to a supported format.
Additional context
The text was updated successfully, but these errors were encountered: