| 808 | |
| 809 | public: |
| 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 | { |
nothing calls this directly
no test coverage detected