]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/tabcontroller.c
rebrand nexuiz -> xonotic, will fix possible mess later
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / tabcontroller.c
1 #ifdef INTERFACE
2 CLASS(XonoticTabController) EXTENDS(ModalController)
3         METHOD(XonoticTabController, configureXonoticTabController, void(entity, float))
4         METHOD(XonoticTabController, makeTabButton, entity(entity, string, entity))
5         ATTRIB(XonoticTabController, rows, float, 0)
6         ATTRIB(XonoticTabController, fontSize, float, SKINFONTSIZE_NORMAL)
7         ATTRIB(XonoticTabController, image, string, SKINGFX_BUTTON)
8 ENDCLASS(XonoticTabController)
9 entity makeXonoticTabController(float theRows);
10 #endif
11
12 #ifdef IMPLEMENTATION
13 entity makeXonoticTabController(float theRows)
14 {
15         entity me;
16         me = spawnXonoticTabController();
17         me.configureXonoticTabController(me, theRows);
18         return me;
19 }
20 void configureXonoticTabControllerXonoticTabController(entity me, float theRows)
21 {
22         me.rows = theRows;
23 }
24 entity makeTabButtonXonoticTabController(entity me, string theTitle, entity tab)
25 {
26         entity b;
27         if(me.rows != tab.rows)
28                 error("Tab dialog height mismatch!");
29         b = makeXonoticButton(theTitle, '0 0 0');
30                 me.addTab(me, tab, b);
31         // TODO make this real tab buttons (with color parameters, and different gfx)
32         return b;
33 }
34 #endif