forked from mirror/OpenTTD
(svn r9031) -Codechange: Introduce grfconfig->status, and use it for states that are
mutually exclusive. At the same time, add an INITIALISED state which makes it possible to check if a grf is not yet active but will be later on during the GLS_ACTIVATION loading stage.
This commit is contained in:
@@ -91,8 +91,8 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, bool show
|
||||
}
|
||||
|
||||
/* Show flags */
|
||||
if (HASBIT(c->flags, GCF_NOT_FOUND)) y += DrawStringMultiLine(x, y, STR_NEWGRF_NOT_FOUND, w);
|
||||
if (HASBIT(c->flags, GCF_DISABLED)) y += DrawStringMultiLine(x, y, STR_NEWGRF_DISABLED, w);
|
||||
if (c->status == GCS_NOT_FOUND) y += DrawStringMultiLine(x, y, STR_NEWGRF_NOT_FOUND, w);
|
||||
if (c->status == GCS_DISABLED) y += DrawStringMultiLine(x, y, STR_NEWGRF_DISABLED, w);
|
||||
if (HASBIT(c->flags, GCF_COMPATIBLE)) y += DrawStringMultiLine(x, y, STR_NEWGRF_COMPATIBLE_LOADED, w);
|
||||
|
||||
/* Draw GRF info if it exists */
|
||||
@@ -335,16 +335,23 @@ static void NewGRFWndProc(Window *w, WindowEvent *e)
|
||||
SpriteID pal;
|
||||
|
||||
/* Pick a colour */
|
||||
if (HASBIT(c->flags, GCF_NOT_FOUND) || HASBIT(c->flags, GCF_DISABLED)) {
|
||||
pal = PALETTE_TO_RED;
|
||||
} else if (HASBIT(c->flags, GCF_STATIC)) {
|
||||
switch (c->status) {
|
||||
case GCS_NOT_FOUND:
|
||||
case GCS_DISABLED:
|
||||
pal = PALETTE_TO_RED;
|
||||
break;
|
||||
case GCS_ACTIVATED:
|
||||
pal = PALETTE_TO_GREEN;
|
||||
break;
|
||||
default:
|
||||
pal = PALETTE_TO_BLUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (HASBIT(c->flags, GCF_STATIC)) {
|
||||
pal = PALETTE_TO_GREY;
|
||||
} else if (HASBIT(c->flags, GCF_COMPATIBLE)) {
|
||||
pal = PALETTE_TO_ORANGE;
|
||||
} else if (HASBIT(c->flags, GCF_ACTIVATED)) {
|
||||
pal = PALETTE_TO_GREEN;
|
||||
} else {
|
||||
pal = PALETTE_TO_BLUE;
|
||||
}
|
||||
|
||||
DrawSprite(SPR_SQUARE, pal, 5, y + 2);
|
||||
|
Reference in New Issue
Block a user