Update openttd to 1.7.0-RC1
--HG-- branch : openttd
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: road_gui.cpp 27591 2016-05-29 19:05:11Z frosch $ */
|
||||
/* $Id: road_gui.cpp 27734 2017-01-15 14:27:54Z frosch $ */
|
||||
|
||||
/*
|
||||
* This file is part of OpenTTD.
|
||||
@@ -64,7 +64,7 @@ static RoadType _cur_roadtype;
|
||||
static DiagDirection _road_depot_orientation;
|
||||
static DiagDirection _road_station_picker_orientation;
|
||||
|
||||
void CcPlaySound1D(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
|
||||
void CcPlaySound_SPLAT_OTHER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
|
||||
{
|
||||
if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT_OTHER, tile);
|
||||
}
|
||||
@@ -629,7 +629,7 @@ struct BuildRoadToolbarWindow : Window {
|
||||
DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5),
|
||||
_remove_button_clicked ?
|
||||
CMD_REMOVE_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) :
|
||||
CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound1D);
|
||||
CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound_SPLAT_OTHER);
|
||||
break;
|
||||
|
||||
case DDSP_BUILD_BUSSTOP:
|
||||
@@ -642,13 +642,13 @@ struct BuildRoadToolbarWindow : Window {
|
||||
|
||||
case DDSP_REMOVE_BUSSTOP: {
|
||||
TileArea ta(start_tile, end_tile);
|
||||
DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound1D);
|
||||
DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_BUS, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_BUS]), CcPlaySound_SPLAT_OTHER);
|
||||
break;
|
||||
}
|
||||
|
||||
case DDSP_REMOVE_TRUCKSTOP: {
|
||||
TileArea ta(start_tile, end_tile);
|
||||
DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound1D);
|
||||
DoCommandP(ta.tile, ta.w | ta.h << 8, (_ctrl_pressed << 1) | ROADSTOP_TRUCK, CMD_REMOVE_ROAD_STOP | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_station[ROADSTOP_TRUCK]), CcPlaySound_SPLAT_OTHER);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -956,15 +956,11 @@ struct BuildRoadStationWindow : public PickerWindowBase {
|
||||
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 PickerWindowBase {
|
||||
};
|
||||
|
||||
/** 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_station_picker_widgets[] = {
|
||||
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_station_picker_widgets[] = {
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user