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

Method SmallMapWindow

src/smallmap_gui.cpp:1453–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1451 friend class NWidgetSmallmapDisplay;
1452
1453 SmallMapWindow(WindowDesc &desc, int window_number) : Window(desc)
1454 {
1455 _smallmap_industry_highlight = IT_INVALID;
1456 this->overlay = std::make_unique<LinkGraphOverlay>(this, WID_SM_MAP, 0, this->GetOverlayCompanyMask(), 1);
1457 this->CreateNestedTree();
1458 this->LowerWidget(WID_SM_CONTOUR + this->map_type);
1459
1460 this->RebuildColourIndexIfNecessary();
1461
1462 this->SetWidgetLoweredState(WID_SM_SHOW_HEIGHT, _smallmap_show_heightmap);
1463
1464 this->SetWidgetLoweredState(WID_SM_TOGGLETOWNNAME, this->show_towns);
1465 this->SetWidgetLoweredState(WID_SM_SHOW_IND_NAMES, this->show_ind_names);
1466
1467 this->SetupWidgetData();
1468 this->FinishInitNested(window_number);
1469
1470 this->SetZoomLevel(ZLC_INITIALIZE, nullptr);
1471 this->SmallMapCenterOnCurrentPos();
1472 this->SetOverlayCargoMask();
1473 }
1474
1475 /**
1476 * Center the small map on the current center of the viewport.

Callers

nothing calls this directly

Calls 10

GetOverlayCompanyMaskMethod · 0.95
SetupWidgetDataMethod · 0.95
SetZoomLevelMethod · 0.95
SetOverlayCargoMaskMethod · 0.95
CreateNestedTreeMethod · 0.80
LowerWidgetMethod · 0.80
SetWidgetLoweredStateMethod · 0.80
FinishInitNestedMethod · 0.80

Tested by

no test coverage detected