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

Method render

source/src/menus.cpp:761–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

759 }
760
761 virtual void render(int x, int y, int w)
762 {
763 bool sel = isselection();
764 const static int boxsize = FONTH;
765 int offs = ((menurighttabwidth - FONTH) * ((msctrl % 41) ? pos : (50 + 50 * sinf(totalmillis / 300.0f + y)))) / 100;
766 int c = greyedout ? 128 : 255;
767
768 if(sel)
769 {
770 renderbg(x, y, w-boxsize-offs-FONTH/2, menuseldescbgcolor);
771 renderbg(x+w-boxsize-offs, y, boxsize, menuselbgcolor);
772 if(offs > FONTH/2) renderbg(x+w-offs+FONTH/2, y, offs-FONTH/2, menuseldescbgcolor);
773 }
774 draw_text(text, x, y, c, c, c);
775 x -= offs;
776 blendbox(x+w-boxsize, y, x+w, y+boxsize, false, -1, &gray);
777 color *col = greyedout ? &gray : (sel ? &whitepulse : &white);
778 if(checked)
779 {
780 int x1 = x+w-boxsize-FONTH/6, x2 = x+w+FONTH/6, y1 = y-FONTH/6, y2 = y+boxsize+FONTH/6;
781 line(x1, y1, x2, y2, col);
782 line(x2, y1, x1, y2, col);
783 }
784 }
785
786 virtual const char* gettext() { return text; }
787

Callers

nothing calls this directly

Calls 3

draw_textFunction · 0.85
blendboxFunction · 0.85
lineFunction · 0.85

Tested by

no test coverage detected