diff options
author | belugas <belugas@openttd.org> | 2007-10-16 00:35:59 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2007-10-16 00:35:59 +0000 |
commit | ebfc4b2842085eaf79d6eb46f83945f0e0f6886c (patch) | |
tree | c3f266a03609c944f99ee496ced32d7594d06d63 /src | |
parent | 31bf6876d3fea34e7c8a57910b1815e92941716b (diff) | |
download | openttd-ebfc4b2842085eaf79d6eb46f83945f0e0f6886c.tar.xz |
(svn r11272) -Codechange: Truncate text describing the grf file in the NewGrf settings gui
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf_gui.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 453673fc5..e3d7db51e 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -342,6 +342,7 @@ static void NewGRFWndProc(Window *w, WindowEvent *e) if (i >= w->vscroll.pos && i < w->vscroll.pos + w->vscroll.cap) { const char *text = (c->name != NULL && !StrEmpty(c->name)) ? c->name : c->filename; SpriteID pal; + byte txtoffset; /* Pick a colour */ switch (c->status) { @@ -365,7 +366,8 @@ static void NewGRFWndProc(Window *w, WindowEvent *e) DrawSprite(SPR_SQUARE, pal, 5, y + 2); if (c->error != NULL) DrawSprite(SPR_WARNING_SIGN, 0, 20, y + 2); - DoDrawString(text, c->error != NULL ? 35 : 25, y + 3, WP(w, newgrf_d).sel == c ? 0xC : 0x10); + txtoffset = c->error != NULL ? 35 : 25; + DoDrawStringTruncated(text, txtoffset, y + 3, WP(w, newgrf_d).sel == c ? 0xC : 0x10, w->width - txtoffset - 10); y += 14; } } |