News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Custom "night colors" are not applied immediately on game start

Started by Nazalassa, August 22, 2024, 12:16:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nazalassa

This bug has been found in 120.4, 124.2.1 and r11372.

It is possible for paksets to redefine some of the "night colors", i.e colors that do not darken at night, but "shine" in some other color (such as the grey window colors that turn yellow at night, or the red, yellow, green, blue and purple lights, which do not change color at night). This can be done with lines such as:
special_color[0]=0x57, 0x65, 0x6F, 0xD3, 0xC3, 0x80
(so it is possible to redefine both the daytime color and the nighttime color.)

However, when such a special color is redefined, the redefinition only applies when the colors need changing (i.e when transitioning from day colors to night colors in the evening, or vice-versa). This means that, between game start and next in-game morning/evening, the default special colors are used, and not the custom ones.

I may not understand what happens internally correctly, but I think there is some kind of table which maps image colors (from the pakset images) to on-screen colors, - which means we can map a special color into another color, - and that it is set up before the 'special_color\[x\]' are processed. (This is only a wild guess.)