]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/textlabel.qc
Require semicolon or definition following `METHOD`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / textlabel.qc
1 #ifndef TEXTLABEL_H
2 #define TEXTLABEL_H
3 #include "../item/label.qc"
4 CLASS(XonoticTextLabel, Label)
5         METHOD(XonoticTextLabel, configureXonoticTextLabel, void(entity, float, string));
6         METHOD(XonoticTextLabel, draw, void(entity));
7         ATTRIB(XonoticTextLabel, fontSize, float, SKINFONTSIZE_NORMAL)
8         ATTRIB(XonoticTextLabel, alpha, float, SKINALPHA_TEXT)
9         ATTRIB(XonoticTextLabel, disabledAlpha, float, SKINALPHA_DISABLED)
10 ENDCLASS(XonoticTextLabel)
11 entity makeXonoticTextLabel(float theAlign, string theText);
12 entity makeXonoticHeaderLabel(string theText);
13 #endif
14
15 #ifdef IMPLEMENTATION
16 entity makeXonoticTextLabel(float theAlign, string theText)
17 {
18         entity me;
19         me = NEW(XonoticTextLabel);
20         me.configureXonoticTextLabel(me, theAlign, theText);
21         return me;
22 }
23 entity makeXonoticHeaderLabel(string theText)
24 {
25         entity me;
26         me = makeXonoticTextLabel(0.5, theText);
27         me.colorL = SKINCOLOR_HEADER;
28         me.alpha = SKINALPHA_HEADER;
29         me.isBold = true;
30         return me;
31 }
32 void XonoticTextLabel_configureXonoticTextLabel(entity me, float theAlign, string theText)
33 {
34         me.configureLabel(me, theText, me.fontSize, theAlign);
35 }
36 void XonoticTextLabel_draw(entity me)
37 {
38         SUPER(XonoticTextLabel).draw(me);
39 }
40 #endif