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

Method DoButton_DraggableEx

src/game/editor/editor_ui.cpp:152–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152int CEditor::DoButton_DraggableEx(const void *pId, const char *pText, int Checked, const CUIRect *pRect, bool *pClicked, bool *pAbrupted, int Flags, const char *pToolTip, int Corners, float FontSize)
153{
154 pRect->Draw(GetButtonColor(pId, Checked), Corners, 3.0f);
155
156 CUIRect Rect;
157 pRect->VMargin(pRect->w > 20.0f ? 5.0f : 0.0f, &Rect);
158
159 SLabelProperties Props;
160 Props.m_MaxWidth = Rect.w;
161 Props.m_EllipsisAtEnd = true;
162 Ui()->DoLabel(&Rect, pText, FontSize, TEXTALIGN_MC, Props);
163
164 if(Ui()->MouseInside(pRect))
165 {
166 if(Flags & BUTTONFLAG_RIGHT)
167 m_pUiGotContext = pId;
168 }
169
170 UpdateTooltip(pId, pRect, pToolTip);
171 return Ui()->DoDraggableButtonLogic(pId, Checked, pRect, pClicked, pAbrupted);
172}
173
174bool CEditor::DoEditBox(CLineInput *pLineInput, const CUIRect *pRect, float FontSize, int Corners, const char *pToolTip, const std::vector<STextColorSplit> &vColorSplits)
175{

Callers

nothing calls this directly

Calls 6

UiFunction · 0.85
VMarginMethod · 0.80
DoLabelMethod · 0.80
MouseInsideMethod · 0.80
DrawMethod · 0.45

Tested by

no test coverage detected