Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
dialog_media_demo.qc
Go to the documentation of this file.
2
3#include "demolist.qh"
4#include "textlabel.qh"
5#include "inputbox.qh"
6#include "checkbox.qh"
7#include "button.qh"
8
9const float DMO_PLAY = 1;
10const float DMO_TIME = 2;
12{
13 if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) || isdemo()) // we're not in a match, lets watch the demo
14 {
15 if(btn.democlicktype == DMO_PLAY)
16 { demolist.startDemo(demolist); }
17 else if(btn.democlicktype == DMO_TIME)
18 { demolist.timeDemo(demolist); }
19 }
20 else // already in a match, player has to confirm
21 {
22 if(btn.democlicktype == DMO_PLAY)
23 { DialogOpenButton_Click(btn, main.demostartconfirmDialog); }
24 else if(btn.democlicktype == DMO_TIME)
25 { DialogOpenButton_Click(btn, main.demotimeconfirmDialog); }
26 }
27}
28
30{
32 me.configureDialog(me);
33 return me;
34}
36{
37 entity e;
39
40 me.gotoRC(me, 0.5, 0); me.setFirstColumn(me, me.currentColumn);
41 me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, _("Filter:")));
42 me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
43 e.onChange = DemoList_Filter_Change;
44 e.onChangeEntity = demolist;
45
46 me.gotoRC(me, 0.5, 3.7);
47 me.TD(me, 1, 1.5, e = makeXonoticCheckBox(0, "cl_autodemo", _("Auto record demos")));
48 me.TD(me, 1, 1, e = makeXonoticButton(_("Refresh"), '0 0 0'));
49 e.onClick = DemoList_Refresh_Click;
50 e.onClickEntity = demolist;
51
52 me.gotoRC(me, 2, 0);
53 me.TD(me, me.rows - 3, me.columns, demolist);
54
55 me.gotoRC(me, me.rows - 1, 0);
56 me.TD(me, 1, me.columns / 2, e = makeXonoticButton_T(_("Timedemo"), '0 0 0',
57 _("Benchmark how fast your computer can run the highlighted demo")));
58 e.democlicktype = DMO_TIME;
60 e.onClickEntity = me; // demolist is global anyway
61 me.TD(me, 1, me.columns / 2, e = makeXonoticButton(ZCTX(_("DEMO^Play")), '0 0 0'));
62 e.democlicktype = DMO_PLAY;
64 e.onClickEntity = me; // demolist is global anyway
65}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity makeXonoticDemoList()
Definition demolist.qc:5
void DemoList_Filter_Change(entity box, entity me)
Definition demolist.qc:130
void DemoList_Refresh_Click(entity btn, entity me)
Definition demolist.qc:124
entity demolist
Definition demolist.qh:30
const float DMO_TIME
entity makeXonoticDemoBrowserTab()
const float DMO_PLAY
void DemoConfirm_Check_Gamestatus(entity btn, entity me)
void XonoticDemoBrowserTab_fill(entity me)
#define ZCTX(s)
Definition i18n.qh:68
#define main
Definition _all.inc:202
entity makeXonoticButton_T(string theText, vector theColor, string theTooltip)
Definition button.qc:3
entity makeXonoticButton(string theText, vector theColor)
Definition button.qc:9
const int GAME_ISSERVER
Definition menu.qh:11
const int GAME_CONNECTED
Definition menu.qh:12
int gamestatus
Definition menu.qh:16
float isdemo()
void DialogOpenButton_Click(entity button, entity tab)
string string_null
Definition nil.qh:9
#define NEW(cname,...)
Definition oo.qh:117
entity makeXonoticTextLabel(float theAlign, string theText)
Definition textlabel.qc:3
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition checkbox.qc:28
entity makeXonoticInputBox(bool doEditColorCodes, string theCvar)
Definition inputbox.qc:9