mirror of https://github.com/OpenTTD/OpenTTD
(svn r22771) -Codechange: unify some NewGRFScan calling code
parent
66bab6aeff
commit
327c5dd10c
|
@ -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. */
|
||||
|
@ -634,6 +633,11 @@ void ScanNewGRFFiles()
|
|||
#endif
|
||||
}
|
||||
|
||||
/* Yes... these are the NewGRF windows */
|
||||
InvalidateWindowClassesData(WC_SAVELOAD);
|
||||
InvalidateWindowData(WC_GAME_OPTIONS, 0, GOID_NEWGRF_RESCANNED);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find a NewGRF in the scanned list.
|
||||
|
|
|
@ -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…
Reference in New Issue