MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / BuildRoadStationWindow

Method BuildRoadStationWindow

src/road_gui.cpp:1332–1353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1330
1331public:
1332 BuildRoadStationWindow(WindowDesc &desc, Window *parent, RoadStopType rs) : PickerWindow(desc, parent, TRANSPORT_ROAD, GetRoadStopPickerCallbacks(rs))
1333 {
1334 this->coverage_height = 2 * GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.vsep_normal;
1335
1336 /* Trams don't have non-drivethrough stations */
1337 if (RoadTypeIsTram(_cur_roadtype) && _roadstop_gui.orientation < DIAGDIR_END) {
1338 _roadstop_gui.orientation = DIAGDIR_END;
1339 }
1340 this->ConstructWindow();
1341
1342 const RoadTypeInfo *rti = GetRoadTypeInfo(_cur_roadtype);
1343 this->GetWidget<NWidgetCore>(WID_BROS_CAPTION)->SetString(rti->strings.picker_title[to_underlying(rs)]);
1344
1345 for (WidgetID i = RoadTypeIsTram(_cur_roadtype) ? WID_BROS_STATION_X : WID_BROS_STATION_NE; i < WID_BROS_LT_OFF; i++) {
1346 this->GetWidget<NWidgetCore>(i)->SetToolTip(rti->strings.picker_tooltip[to_underlying(rs)]);
1347 }
1348
1349 this->LowerWidget(WID_BROS_STATION_NE + _roadstop_gui.orientation);
1350 this->LowerWidget(WID_BROS_LT_OFF + _settings_client.gui.station_show_coverage);
1351
1352 this->window_class = (rs == RoadStopType::Bus) ? WC_BUS_STATION : WC_TRUCK_STATION;
1353 }
1354
1355 void Close([[maybe_unused]] int data = 0) override
1356 {

Callers

nothing calls this directly

Calls 8

GetCharacterHeightFunction · 0.85
RoadTypeIsTramFunction · 0.85
GetRoadTypeInfoFunction · 0.85
to_underlyingFunction · 0.85
SetToolTipMethod · 0.80
LowerWidgetMethod · 0.80
ConstructWindowMethod · 0.45
SetStringMethod · 0.45

Tested by

no test coverage detected