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

Method InitializeWindow

src/graph_gui.cpp:1183–1200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1181 BaseCargoGraphWindow(WindowDesc &desc, StringID format_str_y_axis) : BaseGraphWindow(desc, format_str_y_axis) {}
1182
1183 void InitializeWindow(WindowNumber number, StringID footer_wallclock = STR_NULL, StringID footer_calendar = STR_NULL)
1184 {
1185 this->CreateNestedTree();
1186
1187 this->excluded_range = this->masked_range;
1188 this->cargo_types = this->GetCargoTypes(number);
1189
1190 this->vscroll = this->GetScrollbar(WID_GRAPH_MATRIX_SCROLLBAR);
1191 this->vscroll->SetCount(CountBits(this->cargo_types));
1192
1193 auto *wid = this->GetWidget<NWidgetCore>(WID_GRAPH_FOOTER);
1194 wid->SetString(TimerGameEconomy::UsingWallclockUnits() ? footer_wallclock : footer_calendar);
1195
1196 this->FinishInitNested(number);
1197
1198 /* Initialise the dataset */
1199 this->InvalidateData();
1200 }
1201
1202 virtual CargoTypes GetCargoTypes(WindowNumber number) const = 0;
1203 virtual CargoTypes &GetExcludedCargoTypes() const = 0;

Calls 8

CountBitsFunction · 0.85
CreateNestedTreeMethod · 0.80
GetScrollbarMethod · 0.80
FinishInitNestedMethod · 0.80
GetCargoTypesMethod · 0.45
SetCountMethod · 0.45
SetStringMethod · 0.45
InvalidateDataMethod · 0.45

Tested by

no test coverage detected