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

Method ShowPopupMessage

src/game/client/ui.cpp:1805–1814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1803}
1804
1805void CUi::ShowPopupMessage(float X, float Y, SMessagePopupContext *pContext)
1806{
1807 const float TextWidth = minimum(std::ceil(TextRender()->TextWidth(SMessagePopupContext::POPUP_FONT_SIZE, pContext->m_aMessage, -1, -1.0f) + 0.5f), SMessagePopupContext::POPUP_MAX_WIDTH);
1808 float TextHeight = 0.0f;
1809 STextSizeProperties TextSizeProps{};
1810 TextSizeProps.m_pHeight = &TextHeight;
1811 TextRender()->TextWidth(SMessagePopupContext::POPUP_FONT_SIZE, pContext->m_aMessage, -1, TextWidth, 0, TextSizeProps);
1812 pContext->m_pUI = this;
1813 DoPopupMenu(pContext, X, Y, TextWidth + 10.0f, TextHeight + 10.0f, pContext, PopupMessage);
1814}
1815
1816CUi::SConfirmPopupContext::SConfirmPopupContext()
1817{

Callers 2

ShowFileDialogErrorMethod · 0.80

Calls 3

TextRenderFunction · 0.85
TextWidthMethod · 0.80
minimumFunction · 0.50

Tested by

no test coverage detected