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

This commit is contained in:
rubidium 2011-08-20 17:46:03 +00:00
parent 9b72c8acf2
commit afe407322d
4 changed files with 24 additions and 26 deletions

View File

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

View File

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

View File

@ -605,8 +605,7 @@ void ScanNewGRFFiles()
uint num = GRFFileScanner::DoScan(); uint num = GRFFileScanner::DoScan();
DEBUG(grf, 1, "Scan complete, found %d files", num); 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. /* Sort the linked list using quicksort.
* For that we first have to make an array, then sort and * For that we first have to make an array, then sort and
* then remake the linked list. */ * then remake the linked list. */
@ -634,6 +633,11 @@ void ScanNewGRFFiles()
#endif #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. * Find a NewGRF in the scanned list.

View File

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