# HG changeset patch # User Tero Marttila # Date 1216405722 -10800 # Node ID 020c61e39c94fd75ca857062ed1fe10b73f11a4d # Parent b29402c54ffea9ee8d5e455f37371f59a81d8571 added a GCS_AVAILABLE status, and changed the colours used in the download GUI diff -r b29402c54ffe -r 020c61e39c94 src/network/newgrf_download.cpp --- a/src/network/newgrf_download.cpp Fri Jul 18 21:16:18 2008 +0300 +++ b/src/network/newgrf_download.cpp Fri Jul 18 21:28:42 2008 +0300 @@ -177,24 +177,34 @@ // the NewGRF name const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename; - /* Pick a colour */ + /* + * Pick a colour + * + * orange - server has it, we don't, haven't checked availablity yet + * red - not available + * green - available + * blue - downloaded + */ switch (c->status) { case GCS_NOT_FOUND: + pal = PALETTE_TO_ORANGE; + break; + case GCS_DISABLED: pal = PALETTE_TO_RED; break; - // XXX: green if downloadable - case GCS_ACTIVATED: + case GCS_AVAILABLE: pal = PALETTE_TO_GREEN; break; - default: + default: // GCS_INITIALIZED or GCS_ACTIVATED pal = PALETTE_TO_BLUE; break; } - - // XXX: more colour logic that must be fixed... + + /* + XXX: flags? if (pal != PALETTE_TO_RED) { if (HasBit(c->flags, GCF_STATIC)) { pal = PALETTE_TO_GREY; @@ -204,7 +214,8 @@ } } - + */ + // draw the square in the chosen colour DrawSprite(SPR_SQUARE, pal, 5, y + 2); diff -r b29402c54ffe -r 020c61e39c94 src/newgrf_config.h --- a/src/newgrf_config.h Fri Jul 18 21:16:18 2008 +0300 +++ b/src/newgrf_config.h Fri Jul 18 21:28:42 2008 +0300 @@ -25,13 +25,14 @@ GCS_DISABLED, ///< GRF file is disabled GCS_NOT_FOUND, ///< GRF file was not found in the local cache GCS_INITIALISED, ///< GRF file has been initialised - GCS_ACTIVATED ///< GRF file has been activated + GCS_ACTIVATED, ///< GRF file has been activated + GCS_AVAILABLE ///< GRF was not found in the local cache, but the download repo has it }; /** Status of post-gameload GRF compatibility check */ enum GRFListCompatibility{ GLC_ALL_GOOD, ///< All GRF needed by game are present - GLC_COMPATIBLE, ///< Compatible (eg. the same ID, but different chacksum) GRF found in at least one case + GLC_COMPATIBLE, ///< Compatible (eg. the same ID, but different checksum) GRF found in at least one case GLC_NOT_FOUND ///< At least one GRF couldn't be found (higher priority than GLC_COMPATIBLE) };