Show warning dialog if NewGRFs use too many string IDs.

Show when reloading/changing NewGRF config, or starting new game.
This commit is contained in:
Jonathan G Rennison
2016-12-08 23:48:53 +00:00
parent 6f4dbacf3e
commit 20a090b077
8 changed files with 35 additions and 1 deletions

View File

@@ -607,6 +607,7 @@ static void FillGrfidMap(const GRFConfig *c, GrfIdMap *grfid_map)
static void NewGRFConfirmationCallback(Window *w, bool confirmed);
static void ShowSavePresetWindow(const char *initial_text);
void PostCheckNewGRFLoadWarnings();
/**
* Window for showing NewGRF files
@@ -691,6 +692,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
CopyGRFConfigList(this->orig_list, this->actives, true);
ResetGRFConfig(false);
ReloadNewGRFData();
PostCheckNewGRFLoadWarnings();
}
/* Remove the temporary copy of grf-list used in window */
@@ -1113,6 +1115,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
CopyGRFConfigList(this->orig_list, this->actives, true);
ResetGRFConfig(false);
ReloadNewGRFData();
PostCheckNewGRFLoadWarnings();
}
this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window
break;
@@ -1975,6 +1978,7 @@ static void NewGRFConfirmationCallback(Window *w, bool confirmed)
GamelogGRFUpdate(_grfconfig, nw->actives); // log GRF changes
CopyGRFConfigList(nw->orig_list, nw->actives, false);
ReloadNewGRFData();
PostCheckNewGRFLoadWarnings();
GamelogStopAction();
/* Show new, updated list */
@@ -1993,6 +1997,12 @@ static void NewGRFConfirmationCallback(Window *w, bool confirmed)
}
}
void PostCheckNewGRFLoadWarnings()
{
if (_grf_bug_too_many_strings) {
ShowErrorMessage(STR_NEWGRF_TOO_MANY_STRINGS, STR_NEWGRF_TOO_MANY_STRINGS_DETAIL, WL_WARNING);
}
}
/**