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

Method UpdateSampleButton

src/game/client/components/touch_controls.cpp:2492–2503  ·  view source on GitHub ↗

Make it look like the button, only have bind behavior. This is only used on m_pSampleButton.

Source from the content-addressed store, hash-verified

2490
2491// Make it look like the button, only have bind behavior. This is only used on m_pSampleButton.
2492void CTouchControls::UpdateSampleButton(const CTouchButton &SrcButton)
2493{
2494 dbg_assert(m_pSampleButton != nullptr, "Sample button not created");
2495 m_pSampleButton->m_UnitRect = SrcButton.m_UnitRect;
2496 m_pSampleButton->m_Shape = SrcButton.m_Shape;
2497 m_pSampleButton->m_vVisibilities = SrcButton.m_vVisibilities;
2498 CButtonLabel Label = SrcButton.m_pBehavior->GetLabel();
2499 m_pSampleButton->m_pBehavior = std::make_unique<CBindTouchButtonBehavior>(Label.m_pLabel, Label.m_Type, "");
2500 m_pSampleButton->UpdatePointers();
2501 m_pSampleButton->m_UnitRect = CalculateHitbox(m_pSampleButton->m_UnitRect, m_pSampleButton->m_Shape);
2502 m_pSampleButton->UpdateScreenFromUnitRect();
2503}
2504
2505std::vector<CTouchControls::CTouchButton *> CTouchControls::GetButtonsEditor()
2506{

Callers 1

Calls 3

GetLabelMethod · 0.80
UpdatePointersMethod · 0.80

Tested by

no test coverage detected