equal
deleted
inserted
replaced
340 y = w->widget[SNGRFS_FILE_LIST].top; |
340 y = w->widget[SNGRFS_FILE_LIST].top; |
341 for (c = *WP(w, newgrf_d).list, i = 0; c != NULL; c = c->next, i++) { |
341 for (c = *WP(w, newgrf_d).list, i = 0; c != NULL; c = c->next, i++) { |
342 if (i >= w->vscroll.pos && i < w->vscroll.pos + w->vscroll.cap) { |
342 if (i >= w->vscroll.pos && i < w->vscroll.pos + w->vscroll.cap) { |
343 const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename; |
343 const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename; |
344 SpriteID pal; |
344 SpriteID pal; |
|
345 byte txtoffset; |
345 |
346 |
346 /* Pick a colour */ |
347 /* Pick a colour */ |
347 switch (c->status) { |
348 switch (c->status) { |
348 case GCS_NOT_FOUND: |
349 case GCS_NOT_FOUND: |
349 case GCS_DISABLED: |
350 case GCS_DISABLED: |
363 pal = PALETTE_TO_ORANGE; |
364 pal = PALETTE_TO_ORANGE; |
364 } |
365 } |
365 |
366 |
366 DrawSprite(SPR_SQUARE, pal, 5, y + 2); |
367 DrawSprite(SPR_SQUARE, pal, 5, y + 2); |
367 if (c->error != NULL) DrawSprite(SPR_WARNING_SIGN, 0, 20, y + 2); |
368 if (c->error != NULL) DrawSprite(SPR_WARNING_SIGN, 0, 20, y + 2); |
368 DoDrawString(text, c->error != NULL ? 35 : 25, y + 3, WP(w, newgrf_d).sel == c ? 0xC : 0x10); |
369 txtoffset = c->error != NULL ? 35 : 25; |
|
370 DoDrawStringTruncated(text, txtoffset, y + 3, WP(w, newgrf_d).sel == c ? 0xC : 0x10, w->width - txtoffset - 10); |
369 y += 14; |
371 y += 14; |
370 } |
372 } |
371 } |
373 } |
372 |
374 |
373 if (WP(w, newgrf_d).sel != NULL) { |
375 if (WP(w, newgrf_d).sel != NULL) { |