1
0
Fork 0

(svn r22444) -Add: When GRFs are disabled via Action E or due to GRM failure, also display an error in the GUI.

release/1.2
frosch 2011-05-11 20:23:37 +00:00
parent 67b9eda8c6
commit 2cec96388c
2 changed files with 5 additions and 3 deletions

View File

@ -2471,6 +2471,8 @@ STR_NEWGRF_ERROR_CORRUPT_SPRITE :{YELLOW}{RAW_ST
STR_NEWGRF_ERROR_MULTIPLE_ACTION_8 :Contains multiple Action 8 entries STR_NEWGRF_ERROR_MULTIPLE_ACTION_8 :Contains multiple Action 8 entries
STR_NEWGRF_ERROR_READ_BOUNDS :Read past end of pseudo-sprite STR_NEWGRF_ERROR_READ_BOUNDS :Read past end of pseudo-sprite
STR_NEWGRF_ERROR_MISSING_SPRITES :{WHITE}The currently used base graphics set is missing a number of sprites.{}Please update the base graphics set STR_NEWGRF_ERROR_MISSING_SPRITES :{WHITE}The currently used base graphics set is missing a number of sprites.{}Please update the base graphics set
STR_NEWGRF_ERROR_GRM_FAILED :Requested GRF resources not available
STR_NEWGRF_ERROR_FORCEFULLY_DISABLED :{2:RAW_STRING} was disabled by {4:RAW_STRING}
# NewGRF related 'general' warnings # NewGRF related 'general' warnings
STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Caution! STR_NEWGRF_POPUP_CAUTION_CAPTION :{WHITE}Caution!

View File

@ -5758,7 +5758,7 @@ static uint32 PerformGRM(uint32 *grm, uint16 num_ids, uint16 count, uint8 op, ui
if (op != 4 && op != 5) { if (op != 4 && op != 5) {
/* Deactivate GRF */ /* Deactivate GRF */
grfmsg(0, "ParamSet: GRM: Unable to allocate %d %s, deactivating", count, type); grfmsg(0, "ParamSet: GRM: Unable to allocate %d %s, deactivating", count, type);
DisableGrf(); DisableGrf(STR_NEWGRF_ERROR_GRM_FAILED);
return UINT_MAX; return UINT_MAX;
} }
@ -5833,7 +5833,7 @@ static void ParamSet(ByteReader *buf)
/* Check if the allocated sprites will fit below the original sprite limit */ /* Check if the allocated sprites will fit below the original sprite limit */
if (_cur_spriteid + count >= 16384) { if (_cur_spriteid + count >= 16384) {
grfmsg(0, "ParamSet: GRM: Unable to allocate %d sprites; try changing NewGRF order", count); grfmsg(0, "ParamSet: GRM: Unable to allocate %d sprites; try changing NewGRF order", count);
DisableGrf(); DisableGrf(STR_NEWGRF_ERROR_GRM_FAILED);
return; return;
} }
@ -6110,7 +6110,7 @@ static void GRFInhibit(ByteReader *buf)
/* Unset activation flag */ /* Unset activation flag */
if (file != NULL && file != _cur_grfconfig) { if (file != NULL && file != _cur_grfconfig) {
grfmsg(2, "GRFInhibit: Deactivating file '%s'", file->filename); grfmsg(2, "GRFInhibit: Deactivating file '%s'", file->filename);
GRFError *error = DisableGrf(STR_NULL, file); GRFError *error = DisableGrf(STR_NEWGRF_ERROR_FORCEFULLY_DISABLED, file);
error->data = strdup(_cur_grfconfig->GetName()); error->data = strdup(_cur_grfconfig->GetName());
} }
} }