Changeset - r22527:465dd8f46517
[Not reviewed]
master
0 1 0
frosch - 7 years ago 2017-01-15 14:27:54
frosch@openttd.org
(svn r27734) -Change: Hide the drive-in stops from the tram station picker.
1 file changed with 51 insertions and 17 deletions:
0 comments (0 inline, 0 general)
src/road_gui.cpp
Show inline comments
 
@@ -956,15 +956,11 @@ struct BuildRoadStationWindow : public P
 
		if (_cur_roadtype == ROADTYPE_TRAM && _road_station_picker_orientation < DIAGDIR_END) {
 
			_road_station_picker_orientation = DIAGDIR_END;
 
		}
 
		this->SetWidgetsDisabledState(_cur_roadtype == ROADTYPE_TRAM,
 
				WID_BROS_STATION_NE,
 
				WID_BROS_STATION_SE,
 
				WID_BROS_STATION_SW,
 
				WID_BROS_STATION_NW,
 
				WIDGET_LIST_END);
 

	
 
		this->GetWidget<NWidgetCore>(WID_BROS_CAPTION)->widget_data = _road_type_infos[_cur_roadtype].picker_title[rs];
 
		for (uint i = WID_BROS_STATION_NE; i < WID_BROS_LT_OFF; i++) this->GetWidget<NWidgetCore>(i)->tool_tip = _road_type_infos[_cur_roadtype].picker_tooltip[rs];
 
		for (uint i = (_cur_roadtype == ROADTYPE_TRAM ? WID_BROS_STATION_X : WID_BROS_STATION_NE); i < WID_BROS_LT_OFF; i++) {
 
			this->GetWidget<NWidgetCore>(i)->tool_tip = _road_type_infos[_cur_roadtype].picker_tooltip[rs];
 
		}
 

	
 
		this->LowerWidget(_road_station_picker_orientation + WID_BROS_STATION_NE);
 
		this->LowerWidget(_settings_client.gui.station_show_coverage + WID_BROS_LT_OFF);
 
@@ -1060,7 +1056,7 @@ struct BuildRoadStationWindow : public P
 
};
 

	
 
/** Widget definition of the build road station window */
 
static const NWidgetPart _nested_rv_station_picker_widgets[] = {
 
static const NWidgetPart _nested_road_station_picker_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_CAPTION,  COLOUR_DARK_GREEN, WID_BROS_CAPTION),
 
@@ -1069,17 +1065,17 @@ static const NWidgetPart _nested_rv_stat
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 3),
 
		NWidget(NWID_HORIZONTAL), SetPIP(0, 2, 0),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_NW), SetMinimalSize(66, 50), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_NE), SetMinimalSize(66, 50), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_X),  SetMinimalSize(66, 50), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_NW), SetMinimalSize(66, 50), SetFill(0, 0), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_NE), SetMinimalSize(66, 50), SetFill(0, 0), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_X),  SetMinimalSize(66, 50), SetFill(0, 0), EndContainer(),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 2),
 
		NWidget(NWID_HORIZONTAL), SetPIP(0, 2, 0),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_SW), SetMinimalSize(66, 50), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_SE), SetMinimalSize(66, 50), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_Y),  SetMinimalSize(66, 50), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_SW), SetMinimalSize(66, 50), SetFill(0, 0), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_SE), SetMinimalSize(66, 50), SetFill(0, 0), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_Y),  SetMinimalSize(66, 50), SetFill(0, 0), EndContainer(),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 1),
 
@@ -1099,16 +1095,54 @@ static const NWidgetPart _nested_rv_stat
 
	EndContainer(),
 
};
 

	
 
static WindowDesc _rv_station_picker_desc(
 
static WindowDesc _road_station_picker_desc(
 
	WDP_AUTO, NULL, 0, 0,
 
	WC_BUS_STATION, WC_BUILD_TOOLBAR,
 
	WDF_CONSTRUCTION,
 
	_nested_rv_station_picker_widgets, lengthof(_nested_rv_station_picker_widgets)
 
	_nested_road_station_picker_widgets, lengthof(_nested_road_station_picker_widgets)
 
);
 

	
 
/** Widget definition of the build tram station window */
 
static const NWidgetPart _nested_tram_station_picker_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
 
		NWidget(WWT_CAPTION,  COLOUR_DARK_GREEN, WID_BROS_CAPTION),
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BROS_BACKGROUND),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 3),
 
		NWidget(NWID_HORIZONTAL), SetPIP(0, 2, 0),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_X),  SetMinimalSize(66, 50), SetFill(0, 0), EndContainer(),
 
			NWidget(WWT_PANEL, COLOUR_GREY, WID_BROS_STATION_Y),  SetMinimalSize(66, 50), SetFill(0, 0), EndContainer(),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 1),
 
		NWidget(NWID_HORIZONTAL), SetPIP(2, 0, 2),
 
			NWidget(WWT_LABEL, COLOUR_DARK_GREEN, WID_BROS_INFO), SetMinimalSize(140, 14), SetDataTip(STR_STATION_BUILD_COVERAGE_AREA_TITLE, STR_NULL),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
		EndContainer(),
 
		NWidget(NWID_HORIZONTAL), SetPIP(2, 0, 2),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
			NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BROS_LT_OFF), SetMinimalSize(60, 12),
 
											SetDataTip(STR_STATION_BUILD_COVERAGE_OFF, STR_STATION_BUILD_COVERAGE_AREA_OFF_TOOLTIP),
 
			NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BROS_LT_ON), SetMinimalSize(60, 12),
 
											SetDataTip(STR_STATION_BUILD_COVERAGE_ON, STR_STATION_BUILD_COVERAGE_AREA_ON_TOOLTIP),
 
			NWidget(NWID_SPACER), SetFill(1, 0),
 
		EndContainer(),
 
		NWidget(NWID_SPACER), SetMinimalSize(0, 10), SetResize(0, 1),
 
	EndContainer(),
 
};
 

	
 
static WindowDesc _tram_station_picker_desc(
 
	WDP_AUTO, NULL, 0, 0,
 
	WC_BUS_STATION, WC_BUILD_TOOLBAR,
 
	WDF_CONSTRUCTION,
 
	_nested_tram_station_picker_widgets, lengthof(_nested_tram_station_picker_widgets)
 
);
 

	
 
static void ShowRVStationPicker(Window *parent, RoadStopType rs)
 
{
 
	new BuildRoadStationWindow(&_rv_station_picker_desc, parent, rs);
 
	new BuildRoadStationWindow(_cur_roadtype == ROADTYPE_ROAD ? &_road_station_picker_desc : &_tram_station_picker_desc, parent, rs);
 
}
 

	
 
void InitializeRoadGui()
0 comments (0 inline, 0 general)