(svn r7812) -Fix: rail station build window was not correctly updated after station_spread change
This commit is contained in:
		@@ -694,6 +694,7 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
 | 
				
			|||||||
		bool newstations = _railstation.newstations;
 | 
							bool newstations = _railstation.newstations;
 | 
				
			||||||
		int y_offset;
 | 
							int y_offset;
 | 
				
			||||||
		DrawPixelInfo tmp_dpi, *old_dpi;
 | 
							DrawPixelInfo tmp_dpi, *old_dpi;
 | 
				
			||||||
 | 
							const StationSpec *statspec = newstations ? GetCustomStationSpec(_railstation.station_class, _railstation.station_type) : NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (WP(w,def_d).close) return;
 | 
							if (WP(w,def_d).close) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -712,23 +713,14 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
 | 
				
			|||||||
		if (_station_show_coverage)
 | 
							if (_station_show_coverage)
 | 
				
			||||||
			SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
 | 
								SetTileSelectBigSize(-rad, -rad, 2 * rad, 2 * rad);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* Update buttons for correct spread value */
 | 
							for (bits = 0; bits < 7; bits++) {
 | 
				
			||||||
		for (bits = _patches.station_spread; bits < 7; bits++) {
 | 
								bool disable = bits >= _patches.station_spread;
 | 
				
			||||||
			DisableWindowWidget(w, bits + 5);
 | 
								if (statspec == NULL) {
 | 
				
			||||||
			DisableWindowWidget(w, bits + 12);
 | 
									SetWindowWidgetDisabledState(w, bits +  5, disable);
 | 
				
			||||||
		}
 | 
									SetWindowWidgetDisabledState(w, bits + 12, disable);
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
		if (newstations) {
 | 
									SetWindowWidgetDisabledState(w, bits +  5, HASBIT(statspec->disallowed_platforms, bits) || disable);
 | 
				
			||||||
			const StationSpec *statspec = GetCustomStationSpec(_railstation.station_class, _railstation.station_type);
 | 
									SetWindowWidgetDisabledState(w, bits + 12, HASBIT(statspec->disallowed_lengths,   bits) || disable);
 | 
				
			||||||
 | 
					 | 
				
			||||||
			for (bits = 0; bits < 7; bits++) {
 | 
					 | 
				
			||||||
				if (statspec == NULL) {
 | 
					 | 
				
			||||||
					EnableWindowWidget(w, bits +  5);
 | 
					 | 
				
			||||||
					EnableWindowWidget(w, bits + 12);
 | 
					 | 
				
			||||||
				} else {
 | 
					 | 
				
			||||||
					SetWindowWidgetDisabledState(w, bits +  5, HASBIT(statspec->disallowed_platforms, bits));
 | 
					 | 
				
			||||||
					SetWindowWidgetDisabledState(w, bits + 12, HASBIT(statspec->disallowed_lengths,   bits));
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user