diff options
author | Chris <eratonysiad@gmail.com> | 2021-04-27 18:57:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-27 17:57:53 +0100 |
commit | a934dfe0be9621b784ccd1dca81d2ef8214fc4e0 (patch) | |
tree | 197cd82087d41b20091c979dc83f03086c7f658e /src/newgrf_gui.cpp | |
parent | 8ea06128be7b33749546500c9f2159b9d43f07a1 (diff) | |
download | openttd-a934dfe0be9621b784ccd1dca81d2ef8214fc4e0.tar.xz |
Fix: [NewGRF] Errors with severity ERROR also display a pop-up window (#9119)
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r-- | src/newgrf_gui.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index fe2510f74..3465a9437 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -47,8 +47,8 @@ void ShowNewGRFError() if (_game_mode == GM_MENU) return; for (const GRFConfig *c = _grfconfig; c != nullptr; c = c->next) { - /* We only want to show fatal errors */ - if (c->error == nullptr || c->error->severity != STR_NEWGRF_ERROR_MSG_FATAL) continue; + /* Only show Fatal and Error level messages */ + if (c->error == nullptr || (c->error->severity != STR_NEWGRF_ERROR_MSG_FATAL && c->error->severity != STR_NEWGRF_ERROR_MSG_ERROR)) continue; SetDParam (0, c->error->message != STR_NULL ? c->error->message : STR_JUST_RAW_STRING); SetDParamStr(1, c->error->custom_message.c_str()); @@ -57,7 +57,11 @@ void ShowNewGRFError() for (uint i = 0; i < lengthof(c->error->param_value); i++) { SetDParam(4 + i, c->error->param_value[i]); } - ShowErrorMessage(STR_NEWGRF_ERROR_FATAL_POPUP, INVALID_STRING_ID, WL_CRITICAL); + if (c->error->severity == STR_NEWGRF_ERROR_MSG_FATAL) { + ShowErrorMessage(STR_NEWGRF_ERROR_FATAL_POPUP, INVALID_STRING_ID, WL_CRITICAL); + } else { + ShowErrorMessage(STR_NEWGRF_ERROR_POPUP, INVALID_STRING_ID, WL_ERROR); + } break; } } |