MCPcopy Create free account
hub / github.com/assaultcube/AC / render

Method render

source/src/menus.cpp:204–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202 virtual int width() { return text_width(text) + (strchr(text, '\n') ? menurighttabwidth : 0); }
203
204 virtual void render(int x, int y, int w)
205 {
206 int c = greyedout ? 128 : 255;
207 mitem::render(x, y, w);
208 const char *nl = strchr(text, '\n');
209 if(nl)
210 {
211 string l;
212 copystring(l, text, min(MAXSTRLEN, (int)strcspn(text, "\n") + 1));
213 draw_text(l, x, y, c, c, c);
214 draw_text(nl + 1, x + w - max(menurighttabwidth, text_width(nl + 1)), y, c, c, c);
215 }
216 else draw_text(text, x, y, c, c, c);
217 }
218
219 virtual void focus(bool on)
220 {

Callers

nothing calls this directly

Calls 5

copystringFunction · 0.85
minFunction · 0.85
draw_textFunction · 0.85
maxFunction · 0.85
text_widthFunction · 0.85

Tested by

no test coverage detected