(svn r22771) -Codechange: unify some NewGRFScan calling code

pull/155/head
rubidium 13 years ago
parent 9b72c8acf2
commit afe407322d

@ -1269,7 +1269,6 @@ DEF_CONSOLE_CMD(ConRescanNewGRF)
TarScanner::DoScan();
ScanNewGRFFiles();
InvalidateWindowData(WC_GAME_OPTIONS, 0, GOID_NEWGRF_RESCANNED);
return true;
}

@ -115,9 +115,6 @@ public:
case CONTENT_TYPE_NEWGRF:
ScanNewGRFFiles();
/* Yes... these are the NewGRF windows */
InvalidateWindowClassesData(WC_SAVELOAD);
InvalidateWindowData(WC_GAME_OPTIONS, 0, GOID_NEWGRF_RESCANNED);
break;
case CONTENT_TYPE_SCENARIO:

@ -605,8 +605,7 @@ void ScanNewGRFFiles()
uint num = GRFFileScanner::DoScan();
DEBUG(grf, 1, "Scan complete, found %d files", num);
if (num == 0 || _all_grfs == NULL) return;
if (num != 0 && _all_grfs != NULL) {
/* Sort the linked list using quicksort.
* For that we first have to make an array, then sort and
* then remake the linked list. */
@ -632,6 +631,11 @@ void ScanNewGRFFiles()
#ifdef ENABLE_NETWORK
NetworkAfterNewGRFScan();
#endif
}
/* Yes... these are the NewGRF windows */
InvalidateWindowClassesData(WC_SAVELOAD);
InvalidateWindowData(WC_GAME_OPTIONS, 0, GOID_NEWGRF_RESCANNED);
}

@ -989,9 +989,7 @@ struct NewGRFWindow : public QueryStringBaseWindow {
this->avail_sel = NULL;
this->avail_pos = -1;
this->avails.ForceRebuild();
this->InvalidateData(GOID_NEWGRF_RESCANNED);
this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window
InvalidateWindowClassesData(WC_SAVELOAD);
break;
}
}

Loading…
Cancel
Save