1
0
Fork 0

(svn r20694) -Fix [FS#4087]: empty newgrf presets were not selectable

release/1.1
yexo 2010-08-30 10:52:27 +00:00
parent e91e2498c7
commit cf2032d0f8
1 changed files with 8 additions and 11 deletions

View File

@ -896,20 +896,17 @@ 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;
ClearGRFConfigList(&this->actives);
this->actives = c; this->actives = c;
this->preset = index;
this->avails.ForceRebuild(); this->avails.ForceRebuild();
} }
}
DeleteWindowByClass(WC_GRF_PARAMETERS); DeleteWindowByClass(WC_GRF_PARAMETERS);
this->active_sel = NULL; this->active_sel = NULL;