mirror of https://github.com/OpenTTD/OpenTTD
(svn r22791) -Codechange: use callback for scanning from the NewGRF window
parent
d7593d8815
commit
2cc2d02643
|
@ -511,7 +511,7 @@ enum ShowNewGRFStateWidgets {
|
||||||
/**
|
/**
|
||||||
* Window for showing NewGRF files
|
* Window for showing NewGRF files
|
||||||
*/
|
*/
|
||||||
struct NewGRFWindow : public QueryStringBaseWindow {
|
struct NewGRFWindow : public QueryStringBaseWindow, NewGRFScanCallback {
|
||||||
typedef GUIList<const GRFConfig *> GUIGRFConfigList;
|
typedef GUIList<const GRFConfig *> GUIGRFConfigList;
|
||||||
|
|
||||||
static const uint EDITBOX_MAX_SIZE = 50;
|
static const uint EDITBOX_MAX_SIZE = 50;
|
||||||
|
@ -985,13 +985,17 @@ struct NewGRFWindow : public QueryStringBaseWindow {
|
||||||
case SNGRFS_RESCAN_FILES:
|
case SNGRFS_RESCAN_FILES:
|
||||||
case SNGRFS_RESCAN_FILES2:
|
case SNGRFS_RESCAN_FILES2:
|
||||||
TarScanner::DoScan();
|
TarScanner::DoScan();
|
||||||
ScanNewGRFFiles();
|
ScanNewGRFFiles(this);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void OnNewGRFsScanned()
|
||||||
|
{
|
||||||
this->avail_sel = NULL;
|
this->avail_sel = NULL;
|
||||||
this->avail_pos = -1;
|
this->avail_pos = -1;
|
||||||
this->avails.ForceRebuild();
|
this->avails.ForceRebuild();
|
||||||
this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window
|
this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnDropdownSelect(int widget, int index)
|
virtual void OnDropdownSelect(int widget, int index)
|
||||||
|
|
Loading…
Reference in New Issue