(svn r14112) -Fix (r13715)[FS#2232]: Action B custom messages with parameteers were broken.

This commit is contained in:
frosch 2008-08-20 19:31:35 +00:00
parent d43a475650
commit 7c5d237447
2 changed files with 18 additions and 21 deletions

View File

@ -3205,13 +3205,13 @@ STR_NEWGRF_ERROR_MSG_INFO :{SILVER}{RAW_ST
STR_NEWGRF_ERROR_MSG_WARNING :{RED}Warning: {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_VERSION_NUMBER :{RAW_STRING} will not work with the TTDPatch version reported by OpenTTD.
STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{RAW_STRING} is for the {RAW_STRING} version of TTD.
STR_NEWGRF_ERROR_UNSET_SWITCH :{RAW_STRING} is designed to be used with {RAW_STRING}
STR_NEWGRF_ERROR_INVALID_PARAMETER :Invalid parameter for {RAW_STRING}: parameter {RAW_STRING} ({NUM})
STR_NEWGRF_ERROR_LOAD_BEFORE :{RAW_STRING} must be loaded before {RAW_STRING}.
STR_NEWGRF_ERROR_LOAD_AFTER :{RAW_STRING} must be loaded after {RAW_STRING}.
STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER :{RAW_STRING} requires OpenTTD version {RAW_STRING} or better.
STR_NEWGRF_ERROR_VERSION_NUMBER :{SKIP}{STRING1} will not work with the TTDPatch version reported by OpenTTD.
STR_NEWGRF_ERROR_DOS_OR_WINDOWS :{SKIP}{STRING1} is for the {STRING1} version of TTD.
STR_NEWGRF_ERROR_UNSET_SWITCH :{SKIP}{STRING1} is designed to be used with {STRING1}
STR_NEWGRF_ERROR_INVALID_PARAMETER :{SKIP}Invalid parameter for {STRING1}: parameter {STRING1} ({NUM})
STR_NEWGRF_ERROR_LOAD_BEFORE :{SKIP}{STRING1} must be loaded before {STRING1}.
STR_NEWGRF_ERROR_LOAD_AFTER :{SKIP}{STRING1} must be loaded after {STRING1}.
STR_NEWGRF_ERROR_OTTD_VERSION_NUMBER :{SKIP}{STRING1} requires OpenTTD version {STRING1} or better.
STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE :the GRF file it was designed to translate
STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED :Too many NewGRFs are loaded.
STR_NEWGRF_ERROR_STATIC_GRF_CAUSES_DESYNC :Loading {RAW_STRING} as static NewGRF with {RAW_STRING} could cause desyncs.

View File

@ -53,23 +53,20 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, uint bott
if (c->error != NULL) {
char message[512];
if (c->error->custom_message == NULL) {
SetDParamStr(0, c->filename);
SetDParamStr(1, c->error->data);
for (uint i = 0; i < c->error->num_params; i++) {
uint32 param = 0;
byte param_number = c->error->param_number[i];
SetDParamStr(0, c->error->custom_message); // is skipped by built-in messages
SetDParam (1, STR_JUST_RAW_STRING);
SetDParamStr(2, c->filename);
SetDParam (3, STR_JUST_RAW_STRING);
SetDParamStr(4, c->error->data);
for (uint i = 0; i < c->error->num_params; i++) {
uint32 param = 0;
byte param_number = c->error->param_number[i];
if (param_number < c->num_params) param = c->param[param_number];
if (param_number < c->num_params) param = c->param[param_number];
SetDParam(2 + i, param);
}
GetString(message, c->error->message, lastof(message));
} else {
SetDParamStr(0, c->error->custom_message);
GetString(message, STR_JUST_RAW_STRING, lastof(message));
SetDParam(5 + i, param);
}
GetString(message, c->error->custom_message == NULL ? c->error->message : STR_JUST_RAW_STRING, lastof(message));
SetDParamStr(0, message);
y += DrawStringMultiLine(x, y, c->error->severity, w, bottom - y);