MCPcopy Create free account
hub / github.com/ddnet/ddnet / PopupSelectConfigAutoMapInvoke

Method PopupSelectConfigAutoMapInvoke

src/game/editor/popups.cpp:2465–2474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2463}
2464
2465void CEditor::PopupSelectConfigAutoMapInvoke(int Current, float x, float y)
2466{
2467 static SPopupMenuId s_PopupSelectConfigAutoMapId;
2468 s_AutoMapConfigSelected = -100;
2469 s_AutoMapConfigCurrent = Current;
2470 std::shared_ptr<CLayerTiles> pLayer = std::static_pointer_cast<CLayerTiles>(Map()->SelectedLayer(0));
2471 const int ItemCount = minimum(Map()->m_vpImages[pLayer->m_Image]->m_AutoMapper.ConfigNamesNum() + 1, 10); // +1 for None-entry
2472 // Width for buttons is 120, 15 is the scrollbar width, 2 is the margin between both.
2473 Ui()->DoPopupMenu(&s_PopupSelectConfigAutoMapId, x, y, 120.0f + 15.0f + 2.0f, 10.0f + 12.0f * ItemCount + 2.0f * (ItemCount - 1) + CScrollRegion::HEIGHT_MAGIC_FIX, this, PopupSelectConfigAutoMap);
2474}
2475
2476int CEditor::PopupSelectConfigAutoMapResult()
2477{

Callers

nothing calls this directly

Calls 6

MapFunction · 0.85
UiFunction · 0.85
SelectedLayerMethod · 0.80
ConfigNamesNumMethod · 0.80
DoPopupMenuMethod · 0.80
minimumFunction · 0.50

Tested by

no test coverage detected