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

Method IndustryViewWindow

src/industry_gui.cpp:810–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

808
809public:
810 IndustryViewWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
811 {
812 this->flags.Set(WindowFlag::DisableVpScroll);
813 this->info_height = WidgetDimensions::scaled.framerect.Vertical() + 2 * GetCharacterHeight(FS_NORMAL); // Info panel has at least two lines text.
814
815 this->InitNested(window_number);
816 NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_IV_VIEWPORT);
817 nvp->InitializeViewport(this, Industry::Get(window_number)->location.GetCenterTile(), ScaleZoomGUI(ZoomLevel::Industry));
818
819 const Industry *i = Industry::Get(window_number);
820 if (!i->IsCargoProduced() && !i->IsCargoAccepted()) this->DisableWidget(WID_IV_GRAPH);
821
822 this->InvalidateData();
823 }
824
825 ~IndustryViewWindow()
826 {

Callers

nothing calls this directly

Calls 11

GetCharacterHeightFunction · 0.85
ScaleZoomGUIFunction · 0.85
VerticalMethod · 0.80
InitNestedMethod · 0.80
InitializeViewportMethod · 0.80
IsCargoProducedMethod · 0.80
DisableWidgetMethod · 0.80
SetMethod · 0.45
GetCenterTileMethod · 0.45
IsCargoAcceptedMethod · 0.45
InvalidateDataMethod · 0.45

Tested by

no test coverage detected