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

Method TownViewWindow

src/town_gui.cpp:354–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352 static const int WID_TV_HEIGHT_NORMAL = 150;
353
354 TownViewWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
355 {
356 this->CreateNestedTree();
357
358 this->town = Town::Get(window_number);
359
360 this->FinishInitNested(window_number);
361
362 this->flags.Set(WindowFlag::DisableVpScroll);
363 NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_TV_VIEWPORT);
364 nvp->InitializeViewport(this, this->town->xy, ScaleZoomGUI(ZoomLevel::Town));
365
366 /* disable renaming town in network games if you are not the server */
367 this->SetWidgetDisabledState(WID_TV_CHANGE_NAME, _networking && !_network_server);
368 }
369
370 void Close([[maybe_unused]] int data = 0) override
371 {

Callers

nothing calls this directly

Calls 6

ScaleZoomGUIFunction · 0.85
CreateNestedTreeMethod · 0.80
FinishInitNestedMethod · 0.80
InitializeViewportMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected