(svn r11329) -Fix: if a NewGRF failed to load for some reason (like fatal errors), but it was a "compatible" NewGRF, it was shown with the compatible colour and not the not-loaded colour in the NewGRF list.
authorrubidium
Sun, 21 Oct 2007 12:45:43 +0000
changeset 8275 7bb7b8b75f5a
parent 8274 db7597912df7
child 8276 1fe8700644de
(svn r11329) -Fix: if a NewGRF failed to load for some reason (like fatal errors), but it was a "compatible" NewGRF, it was shown with the compatible colour and not the not-loaded colour in the NewGRF list.
src/newgrf_gui.cpp
--- a/src/newgrf_gui.cpp	Sun Oct 21 11:48:44 2007 +0000
+++ b/src/newgrf_gui.cpp	Sun Oct 21 12:45:43 2007 +0000
@@ -358,10 +358,13 @@
 							break;
 					}
 
-					if (HASBIT(c->flags, GCF_STATIC)) {
-						pal = PALETTE_TO_GREY;
-					} else if (HASBIT(c->flags, GCF_COMPATIBLE)) {
-						pal = PALETTE_TO_ORANGE;
+					/* Do not show a "not-failure" colour when it actually failed to load */
+					if (pal != PALETTE_TO_RED) {
+						if (HASBIT(c->flags, GCF_STATIC)) {
+							pal = PALETTE_TO_GREY;
+						} else if (HASBIT(c->flags, GCF_COMPATIBLE)) {
+							pal = PALETTE_TO_ORANGE;
+						}
 					}
 
 					DrawSprite(SPR_SQUARE, pal, 5, y + 2);