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

Method StationViewWindow

src/station_gui.cpp:1323–1338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1321 CargoDataVector displayed_rows{}; ///< Parent entry of currently displayed rows (including collapsed ones).
1322
1323 StationViewWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
1324 {
1325 this->CreateNestedTree();
1326 this->GetWidget<NWidgetStacked>(WID_SV_CLOSE_AIRPORT_SEL)->SetDisplayedPlane(Station::Get(window_number)->facilities.Test(StationFacility::Airport) ? 0 : SZSP_NONE);
1327 this->vscroll = this->GetScrollbar(WID_SV_SCROLLBAR);
1328 /* Nested widget tree creation is done in two steps to ensure that this->GetWidget<NWidgetCore>(WID_SV_ACCEPTS_RATINGS) exists in UpdateWidgetSize(). */
1329 this->FinishInitNested(window_number);
1330
1331 this->groupings[0] = GR_CARGO;
1332 this->sortings[0] = CargoSortType::AsGrouping;
1333 this->SelectGroupBy(_settings_client.gui.station_gui_group_order);
1334 this->SelectSortBy(_settings_client.gui.station_gui_sort_by);
1335 this->sort_orders[0] = SO_ASCENDING;
1336 this->SelectSortOrder((SortOrder)_settings_client.gui.station_gui_sort_order);
1337 this->owner = Station::Get(window_number)->owner;
1338 }
1339
1340 void OnInit() override
1341 {

Callers

nothing calls this directly

Calls 8

SelectGroupByMethod · 0.95
SelectSortByMethod · 0.95
SelectSortOrderMethod · 0.95
CreateNestedTreeMethod · 0.80
SetDisplayedPlaneMethod · 0.80
TestMethod · 0.80
GetScrollbarMethod · 0.80
FinishInitNestedMethod · 0.80

Tested by

no test coverage detected