mirror of https://github.com/OpenTTD/OpenTTD
(svn r20694) -Fix [FS#4087]: empty newgrf presets were not selectable
parent
e91e2498c7
commit
cf2032d0f8
|
@ -896,19 +896,16 @@ struct NewGRFWindow : public QueryStringBaseWindow {
|
||||||
virtual void OnDropdownSelect(int widget, int index)
|
virtual void OnDropdownSelect(int widget, int index)
|
||||||
{
|
{
|
||||||
if (!this->editable) return;
|
if (!this->editable) return;
|
||||||
if (index == -1) {
|
|
||||||
ClearGRFConfigList(&this->actives);
|
ClearGRFConfigList(&this->actives);
|
||||||
this->preset = -1;
|
this->preset = index;
|
||||||
} else {
|
|
||||||
|
if (index != -1) {
|
||||||
GRFConfig *c = LoadGRFPresetFromConfig(_grf_preset_list[index]);
|
GRFConfig *c = LoadGRFPresetFromConfig(_grf_preset_list[index]);
|
||||||
|
|
||||||
if (c != NULL) {
|
this->active_sel = NULL;
|
||||||
this->active_sel = NULL;
|
this->actives = c;
|
||||||
ClearGRFConfigList(&this->actives);
|
this->avails.ForceRebuild();
|
||||||
this->actives = c;
|
|
||||||
this->preset = index;
|
|
||||||
this->avails.ForceRebuild();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteWindowByClass(WC_GRF_PARAMETERS);
|
DeleteWindowByClass(WC_GRF_PARAMETERS);
|
||||||
|
|
Loading…
Reference in New Issue