]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/tabcontroller.qc
Header police
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / tabcontroller.qc
1 #include "tabcontroller.qh"
2 #ifndef TABCONTROLLER_H
3 #define TABCONTROLLER_H
4 #include "../item/modalcontroller.qc"
5 CLASS(XonoticTabController, ModalController)
6         METHOD(XonoticTabController, configureXonoticTabController, void(entity, float));
7         METHOD(XonoticTabController, makeTabButton_T, entity(entity, string, entity, string));
8         METHOD(XonoticTabController, makeTabButton, entity(entity, string, entity));
9         ATTRIB(XonoticTabController, rows, float, 0)
10         ATTRIB(XonoticTabController, fontSize, float, SKINFONTSIZE_NORMAL)
11         ATTRIB(XonoticTabController, image, string, SKINGFX_BUTTON)
12 ENDCLASS(XonoticTabController)
13 entity makeXonoticTabController(float theRows);
14 #endif
15
16 #ifdef IMPLEMENTATION
17 entity makeXonoticTabController(float theRows)
18 {
19         entity me;
20         me = NEW(XonoticTabController);
21         me.configureXonoticTabController(me, theRows);
22         return me;
23 }
24 void XonoticTabController_configureXonoticTabController(entity me, float theRows)
25 {
26         me.rows = theRows;
27 }
28 entity XonoticTabController_makeTabButton_T(entity me, string theTitle, entity tab, string theTooltip)
29 {
30         entity b;
31         if(me.rows != tab.rows)
32                 error("Tab dialog height mismatch!");
33         b = makeXonoticButton_T(theTitle, '0 0 0', theTooltip);
34                 me.addTab(me, tab, b);
35         // TODO make this real tab buttons (with color parameters, and different gfx)
36         return b;
37 }
38 entity XonoticTabController_makeTabButton(entity me, string theTitle, entity tab)
39 {
40         return XonoticTabController_makeTabButton_T(me, theTitle, tab, string_null);
41 }
42 #endif