2 CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab)
3 METHOD(XonoticDemoBrowserTab, fill, void(entity))
4 ATTRIB(XonoticDemoBrowserTab, title, string, _("Demo"))
5 ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9)
6 ATTRIB(XonoticDemoBrowserTab, rows, float, 21)
7 ATTRIB(XonoticDemoBrowserTab, columns, float, 6.5)
8 ATTRIB(XonoticDemoBrowserTab, name, string, "DemoBrowser")
9 ENDCLASS(XonoticDemoBrowserTab)
10 entity makeXonoticDemoBrowserTab();
11 void Demo_Confirm(entity me, entity btn);
15 void DemoConfirm_Check_Gamestatus(entity me, entity btn)
17 if not(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) // we're not in a match, lets watch the demo
23 else // already in a match, player has to confirm
25 Demo_Confirm(me, btn);
29 entity makeXonoticDemoBrowserTab()
32 me = spawnXonoticDemoBrowserTab();
33 me.configureDialog(me);
36 void XonoticDemoBrowserTab_fill(entity me)
41 me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "cl_autodemo", _("Automatically record demos while playing")));
44 me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, _("Filter:")));
45 me.TD(me, 1, 6, e = makeXonoticInputBox(0, string_null));
46 dlist = makeXonoticDemoList();
47 e.onChange = DemoList_Filter_Change;
48 e.onChangeEntity = dlist;
49 dlist.controlledTextbox = e;
52 me.TD(me, me.rows - 4, me.columns, dlist);
54 me.gotoRC(me, me.rows - 1, 0);
55 me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Timedemo"), '0 0 0'));
56 e.onClick = DemoConfirm_Check_Gamestatus;
57 e.onClickEntity = dlist;
58 me.TD(me, 1, me.columns / 2, e = makeXonoticButton(ZCTX(_("DEMO^Play")), '0 0 0'));
59 e.onClick = DemoConfirm_Check_Gamestatus;
60 e.onClickEntity = dlist;