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