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

Method DoButton_PopupMenu

src/game/client/ui.cpp:1181–1191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1179}
1180
1181int CUi::DoButton_PopupMenu(CButtonContainer *pButtonContainer, const char *pText, const CUIRect *pRect, float Size, int Align, float Padding, bool TransparentInactive, bool Enabled, const std::optional<ColorRGBA> ButtonColor)
1182{
1183 if(!TransparentInactive || CheckActiveItem(pButtonContainer) || HotItem() == pButtonContainer)
1184 pRect->Draw(ButtonColor.value_or(Enabled ? ColorRGBA(1.0f, 1.0f, 1.0f, 0.5f * ButtonColorMul(pButtonContainer)) : ColorRGBA(0.0f, 0.0f, 0.0f, 0.4f)), IGraphics::CORNER_ALL, 3.0f);
1185
1186 CUIRect Label;
1187 pRect->Margin(Padding, &Label);
1188 DoLabel(&Label, pText, Size, Align);
1189
1190 return Enabled ? DoButtonLogic(pButtonContainer, 0, pRect, BUTTONFLAG_LEFT) : 0;
1191}
1192
1193int64_t CUi::DoValueSelector(const void *pId, const CUIRect *pRect, const char *pLabel, int64_t Current, int64_t Min, int64_t Max, const SValueSelectorProperties &Props)
1194{

Callers 4

PopupConfirmMethod · 0.80
PopupSelectionMethod · 0.80
PopupColorPickerMethod · 0.80
RenderMethod · 0.80

Calls 3

MarginMethod · 0.80
ColorRGBAClass · 0.50
DrawMethod · 0.45

Tested by

no test coverage detected