mirror of https://github.com/OpenTTD/OpenTTD
Fix: [NewGRF] Errors with severity ERROR also display a pop-up window (#9119)
parent
8ea06128be
commit
a934dfe0be
|
@ -3079,6 +3079,7 @@ STR_NEWGRF_ERROR_MSG_WARNING :{RED}Warning: {
|
||||||
STR_NEWGRF_ERROR_MSG_ERROR :{RED}Error: {SILVER}{RAW_STRING}
|
STR_NEWGRF_ERROR_MSG_ERROR :{RED}Error: {SILVER}{RAW_STRING}
|
||||||
STR_NEWGRF_ERROR_MSG_FATAL :{RED}Fatal: {SILVER}{RAW_STRING}
|
STR_NEWGRF_ERROR_MSG_FATAL :{RED}Fatal: {SILVER}{RAW_STRING}
|
||||||
STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}A fatal NewGRF error has occurred: {}{STRING5}
|
STR_NEWGRF_ERROR_FATAL_POPUP :{WHITE}A fatal NewGRF error has occurred: {}{STRING5}
|
||||||
|
STR_NEWGRF_ERROR_POPUP :{WHITE}A NewGRF error has occurred: {}{STRING5}
|
||||||
STR_NEWGRF_ERROR_VERSION_NUMBER :{1:RAW_STRING} will not work with the TTDPatch version reported by OpenTTD
|
STR_NEWGRF_ERROR_VERSION_NUMBER :{1:RAW_STRING} will not work with the TTDPatch version reported by OpenTTD
|
||||||
STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:RAW_STRING} is for the {RAW_STRING} version of TTD
|
STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{1:RAW_STRING} is for the {RAW_STRING} version of TTD
|
||||||
STR_NEWGRF_ERROR_UNSET_SWITCH :{1:RAW_STRING} is designed to be used with {RAW_STRING}
|
STR_NEWGRF_ERROR_UNSET_SWITCH :{1:RAW_STRING} is designed to be used with {RAW_STRING}
|
||||||
|
|
|
@ -47,8 +47,8 @@ void ShowNewGRFError()
|
||||||
if (_game_mode == GM_MENU) return;
|
if (_game_mode == GM_MENU) return;
|
||||||
|
|
||||||
for (const GRFConfig *c = _grfconfig; c != nullptr; c = c->next) {
|
for (const GRFConfig *c = _grfconfig; c != nullptr; c = c->next) {
|
||||||
/* We only want to show fatal errors */
|
/* Only show Fatal and Error level messages */
|
||||||
if (c->error == nullptr || c->error->severity != STR_NEWGRF_ERROR_MSG_FATAL) continue;
|
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);
|
SetDParam (0, c->error->message != STR_NULL ? c->error->message : STR_JUST_RAW_STRING);
|
||||||
SetDParamStr(1, c->error->custom_message.c_str());
|
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++) {
|
for (uint i = 0; i < lengthof(c->error->param_value); i++) {
|
||||||
SetDParam(4 + i, c->error->param_value[i]);
|
SetDParam(4 + i, c->error->param_value[i]);
|
||||||
}
|
}
|
||||||
|
if (c->error->severity == STR_NEWGRF_ERROR_MSG_FATAL) {
|
||||||
ShowErrorMessage(STR_NEWGRF_ERROR_FATAL_POPUP, INVALID_STRING_ID, WL_CRITICAL);
|
ShowErrorMessage(STR_NEWGRF_ERROR_FATAL_POPUP, INVALID_STRING_ID, WL_CRITICAL);
|
||||||
|
} else {
|
||||||
|
ShowErrorMessage(STR_NEWGRF_ERROR_POPUP, INVALID_STRING_ID, WL_ERROR);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue