equal
deleted
inserted
replaced
150 const GRFConfig *c; |
150 const GRFConfig *c; |
151 const Widget *wl = &this->widget[ANGRFW_GRF_LIST]; |
151 const Widget *wl = &this->widget[ANGRFW_GRF_LIST]; |
152 int n = 0; |
152 int n = 0; |
153 |
153 |
154 /* Count the number of GRFs */ |
154 /* Count the number of GRFs */ |
155 for (c = _all_grfs; c != NULL; c = c->next) n++; |
155 for (c = _all_grfs; c != NULL; c = c->next) |
|
156 if (!HasBit(c->flags, GCF_CACHE)) |
|
157 n++; |
156 |
158 |
157 this->vscroll.cap = (wl->bottom - wl->top) / 10; |
159 this->vscroll.cap = (wl->bottom - wl->top) / 10; |
158 SetVScrollCount(this, n); |
160 SetVScrollCount(this, n); |
159 |
161 |
160 this->SetWidgetDisabledState(ANGRFW_ADD, this->sel == NULL || this->sel->IsOpenTTDBaseGRF()); |
162 this->SetWidgetDisabledState(ANGRFW_ADD, this->sel == NULL || this->sel->IsOpenTTDBaseGRF()); |
162 |
164 |
163 GfxFillRect(wl->left + 1, wl->top + 1, wl->right, wl->bottom, 0xD7); |
165 GfxFillRect(wl->left + 1, wl->top + 1, wl->right, wl->bottom, 0xD7); |
164 |
166 |
165 uint y = wl->top + 1; |
167 uint y = wl->top + 1; |
166 for (c = _all_grfs, n = 0; c != NULL && n < (this->vscroll.pos + this->vscroll.cap); c = c->next, n++) { |
168 for (c = _all_grfs, n = 0; c != NULL && n < (this->vscroll.pos + this->vscroll.cap); c = c->next, n++) { |
167 if (n >= this->vscroll.pos) { |
169 if (!HasBit(c->flags, GCF_CACHE) && n >= this->vscroll.pos) { |
168 bool h = c == this->sel; |
170 bool h = c == this->sel; |
169 const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename; |
171 const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename; |
170 |
172 |
171 /* Draw selection background */ |
173 /* Draw selection background */ |
172 if (h) GfxFillRect(3, y, this->width - 15, y + 9, 156); |
174 if (h) GfxFillRect(3, y, this->width - 15, y + 9, 156); |