(svn r10820) -Codechange: make negative currencies red and restore the colour from before the currency was printed; this removes the need to make two strings for printing currencies (one for positive currencies and one for negative currencies).

-Fix [FS#1036]: do not use green for currencies as it is practically unreadable on CRT monitors.
This commit is contained in:
rubidium
2007-08-07 15:20:31 +00:00
parent a7e37d8592
commit c46e445e69
5 changed files with 18 additions and 21 deletions

View File

@@ -495,10 +495,10 @@ int DoDrawString(const char *string, int x, int y, uint16 real_color)
DrawPixelInfo *dpi = _cur_dpi;
FontSize size = _cur_fontsize;
WChar c;
byte color;
int xo = x, yo = y;
color = real_color & 0xFF;
byte color = real_color & 0xFF;
byte previous_color = color;
if (color != 0xFE) {
if (x >= dpi->left + dpi->width ||
@@ -548,8 +548,12 @@ skip_cont:;
y += GetCharacterHeight(size);
goto check_bounds;
} else if (c >= SCC_BLUE && c <= SCC_BLACK) { // change color?
previous_color = color;
color = (byte)(c - SCC_BLUE);
goto switch_color;
} else if (c == SCC_PREVIOUS_COLOUR) { // revert to the previous color
Swap(color, previous_color);
goto switch_color;
} else if (c == SCC_SETX) { // {SETX}
x = xo + (byte)*string++;
} else if (c == SCC_SETXY) {// {SETXY}