1
0
Fork 0

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

release/1.2
rubidium 2011-08-20 17:46:03 +00:00
parent 66bab6aeff
commit 327c5dd10c
4 changed files with 24 additions and 26 deletions

View File

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

View File

@ -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:

View File

@ -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);
}

View File

@ -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;
}
}