Changeset - r9277:109a9e789573
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-05-17 16:59:12
smatz@openttd.org
(svn r13143) -Fix (r13142): the Build Waypoint window wasn't resized when it was opened
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/rail_gui.cpp
Show inline comments
 
@@ -1452,48 +1452,49 @@ static void ShowBuildTrainDepotPicker()
 
{
 
	new BuildRailDepotWindow(&_build_depot_desc);
 
}
 

	
 
struct BuildRailWaypointWindow : PickerWindowBase {
 
private:
 
	/** Enum referring to the widgets of the build NewGRF rail waypoint window */
 
	enum BuildRailWaypointWidgets {
 
		BRWW_CLOSEBOX = 0,
 
		BRWW_CAPTION,
 
		BRWW_BACKGROUND,
 
		BRWW_WAYPOINT_1,
 
		BRWW_WAYPOINT_2,
 
		BRWW_WAYPOINT_3,
 
		BRWW_WAYPOINT_4,
 
		BRWW_WAYPOINT_5,
 
		BRWW_SCROLL,
 
	};
 

	
 
public:
 
	BuildRailWaypointWindow(const WindowDesc *desc) : PickerWindowBase(desc)
 
	{
 
		this->hscroll.cap = 5;
 
		this->hscroll.count = _waypoint_count;
 
		this->FindWindowPlacementAndResize(desc);
 
	};
 

	
 
	virtual void OnPaint()
 
	{
 
		uint i;
 

	
 
		for (i = 0; i < this->hscroll.cap; i++) {
 
			this->SetWidgetLoweredState(i + BRWW_WAYPOINT_1, (this->hscroll.pos + i) == _cur_waypoint_type);
 
		}
 

	
 
		this->DrawWidgets();
 

	
 
		for (i = 0; i < this->hscroll.cap; i++) {
 
			if (this->hscroll.pos + i < this->hscroll.count) {
 
				const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, this->hscroll.pos + i);
 

	
 
				DrawWaypointSprite(2 + i * 68, 25, this->hscroll.pos + i, _cur_railtype);
 

	
 
				if (statspec != NULL &&
 
						HasBit(statspec->callbackmask, CBM_STATION_AVAIL) &&
 
						GB(GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE), 0, 8) == 0) {
 
					GfxFillRect(4 + i * 68, 18, 67 + i * 68, 75, (1 << PALETTE_MODIFIER_GREYOUT));
 
				}
 
			}
0 comments (0 inline, 0 general)