summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-23 10:20:29 +0000
committerrubidium <rubidium@openttd.org>2009-01-23 10:20:29 +0000
commit8382b76b0fe9a2b51fd63a831cfbe36117ac4429 (patch)
tree0ad4e75d76388e1bb1993fee5808ef18c0fd18ac /src/newgrf_gui.cpp
parent67a2dd12e837288e548d71f11604ca9d1c44a7cc (diff)
downloadopenttd-8382b76b0fe9a2b51fd63a831cfbe36117ac4429.tar.xz
(svn r15221) -Change [FS#2574]: only show missing NewGRFs when opening the content download window from a NewGRF list and there are missing NewGRFs, otherwise show just all NewGRFs the system knows.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index d18ef00b6..3596f52ec 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -399,6 +399,18 @@ struct NewGRFWindow : public Window {
this->widget[SNGRFS_PRESET_LIST].data = STR_JUST_RAW_STRING;
}
+ bool has_missing = false;
+ for (const GRFConfig *c = this->list; !has_missing && c != NULL; c = c->next) {
+ has_missing = c->status == GCS_NOT_FOUND || HasBit(c->flags, GCF_COMPATIBLE);
+ }
+ if (has_missing) {
+ this->widget[SNGRFS_CONTENT_DOWNLOAD].data = STR_CONTENT_INTRO_MISSING_BUTTON;
+ this->widget[SNGRFS_CONTENT_DOWNLOAD].tooltips = STR_CONTENT_INTRO_MISSING_BUTTON_TIP;
+ } else {
+ this->widget[SNGRFS_CONTENT_DOWNLOAD].data = STR_CONTENT_INTRO_BUTTON;
+ this->widget[SNGRFS_CONTENT_DOWNLOAD].tooltips = STR_CONTENT_INTRO_BUTTON_TIP;
+ }
+
this->DrawWidgets();
/* Draw NewGRF list */
@@ -597,6 +609,8 @@ struct NewGRFWindow : public Window {
/* Only show the things in the current list, or everything when nothing's selected */
ContentVector cv;
for (const GRFConfig *c = this->list; c != NULL; c = c->next) {
+ if (c->status != GCS_NOT_FOUND && !HasBit(c->flags, GCF_COMPATIBLE)) continue;
+
ContentInfo *ci = new ContentInfo();
ci->type = CONTENT_TYPE_NEWGRF;
ci->state = ContentInfo::DOES_NOT_EXIST;