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

Method ShowPopupConfirm

src/game/client/ui.cpp:1832–1843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1830}
1831
1832void CUi::ShowPopupConfirm(float X, float Y, SConfirmPopupContext *pContext)
1833{
1834 const float TextWidth = minimum(std::ceil(TextRender()->TextWidth(SConfirmPopupContext::POPUP_FONT_SIZE, pContext->m_aMessage, -1, -1.0f) + 0.5f), SConfirmPopupContext::POPUP_MAX_WIDTH);
1835 float TextHeight = 0.0f;
1836 STextSizeProperties TextSizeProps{};
1837 TextSizeProps.m_pHeight = &TextHeight;
1838 TextRender()->TextWidth(SConfirmPopupContext::POPUP_FONT_SIZE, pContext->m_aMessage, -1, TextWidth, 0, TextSizeProps);
1839 const float PopupHeight = TextHeight + SConfirmPopupContext::POPUP_BUTTON_HEIGHT + SConfirmPopupContext::POPUP_BUTTON_SPACING + 10.0f;
1840 pContext->m_pUI = this;
1841 pContext->m_Result = SConfirmPopupContext::UNSET;
1842 DoPopupMenu(pContext, X, Y, TextWidth + 10.0f, PopupHeight, pContext, PopupConfirm);
1843}
1844
1845CUi::EPopupMenuFunctionResult CUi::PopupConfirm(void *pContext, CUIRect View, bool Active)
1846{

Callers 3

PopupMenuToolsMethod · 0.80
OnInputMethod · 0.80

Calls 3

TextRenderFunction · 0.85
TextWidthMethod · 0.80
minimumFunction · 0.50

Tested by

no test coverage detected