]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/tabcontroller.c
rebrand nexuiz -> xonotic, will fix possible mess later
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / tabcontroller.c
diff --git a/qcsrc/menu/xonotic/tabcontroller.c b/qcsrc/menu/xonotic/tabcontroller.c
new file mode 100644 (file)
index 0000000..e454e23
--- /dev/null
@@ -0,0 +1,34 @@
+#ifdef INTERFACE
+CLASS(XonoticTabController) EXTENDS(ModalController)
+       METHOD(XonoticTabController, configureXonoticTabController, void(entity, float))
+       METHOD(XonoticTabController, makeTabButton, entity(entity, string, entity))
+       ATTRIB(XonoticTabController, rows, float, 0)
+       ATTRIB(XonoticTabController, fontSize, float, SKINFONTSIZE_NORMAL)
+       ATTRIB(XonoticTabController, image, string, SKINGFX_BUTTON)
+ENDCLASS(XonoticTabController)
+entity makeXonoticTabController(float theRows);
+#endif
+
+#ifdef IMPLEMENTATION
+entity makeXonoticTabController(float theRows)
+{
+       entity me;
+       me = spawnXonoticTabController();
+       me.configureXonoticTabController(me, theRows);
+       return me;
+}
+void configureXonoticTabControllerXonoticTabController(entity me, float theRows)
+{
+       me.rows = theRows;
+}
+entity makeTabButtonXonoticTabController(entity me, string theTitle, entity tab)
+{
+       entity b;
+       if(me.rows != tab.rows)
+               error("Tab dialog height mismatch!");
+       b = makeXonoticButton(theTitle, '0 0 0');
+               me.addTab(me, tab, b);
+       // TODO make this real tab buttons (with color parameters, and different gfx)
+       return b;
+}
+#endif