From 8b6d07cb8583a9bf7bef176da942bd469ea88485 Mon Sep 17 00:00:00 2001 From: maedhros Date: Wed, 21 Feb 2007 23:18:08 +0000 Subject: (svn r8838) -Feature: Show newgrf error messages loaded in Action B in the newgrf gui window. GRFs with an error have a warning symbol shown before the name. --- src/newgrf_gui.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/newgrf_gui.cpp') diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 0de82b529..c418786b2 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -43,6 +43,11 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, bool show { char buff[256]; + if (c->error != NULL) { + SetDParamStr(0, c->error); + y += DrawStringMultiLine(x, y, STR_NEWGRF_ERROR_MSG, w); + } + /* Draw filename or not if it is not known (GRF sent over internet) */ if (c->filename != NULL) { SetDParamStr(0, c->filename); @@ -328,7 +333,8 @@ static void NewGRFWndProc(Window *w, WindowEvent *e) } DrawSprite(SPR_SQUARE, pal, 5, y + 2); - DoDrawString(text, 25, y + 3, WP(w, newgrf_d).sel == c ? 0xC : 0x10); + 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); y += 14; } } -- cgit v1.2.3-70-g09d2