Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
dialog_media_demo.qc File Reference
#include "dialog_media_demo.qh"
#include "demolist.qh"
#include "textlabel.qh"
#include "inputbox.qh"
#include "checkbox.qh"
#include "button.qh"
Include dependency graph for dialog_media_demo.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void DemoConfirm_Check_Gamestatus (entity btn, entity me)
entity makeXonoticDemoBrowserTab ()
void XonoticDemoBrowserTab_fill (entity me)

Variables

const float DMO_PLAY = 1
const float DMO_TIME = 2

Function Documentation

◆ DemoConfirm_Check_Gamestatus()

void DemoConfirm_Check_Gamestatus ( entity btn,
entity me )

Definition at line 11 of file dialog_media_demo.qc.

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}
entity demolist
Definition demolist.qh:30
const float DMO_TIME
const float DMO_PLAY
#define main
Definition _all.inc:202
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)

References demolist, DialogOpenButton_Click(), DMO_PLAY, DMO_TIME, entity(), GAME_CONNECTED, GAME_ISSERVER, gamestatus, isdemo(), and main.

Referenced by XonoticDemoBrowserTab_fill().

◆ makeXonoticDemoBrowserTab()

entity makeXonoticDemoBrowserTab ( )

Definition at line 29 of file dialog_media_demo.qc.

30{
31 entity me;
33 me.configureDialog(me);
34 return me;
35}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NEW(cname,...)
Definition oo.qh:117

References entity(), and NEW.

Referenced by XonoticMediaDialog_fill().

◆ XonoticDemoBrowserTab_fill()

void XonoticDemoBrowserTab_fill ( entity me)

Definition at line 36 of file dialog_media_demo.qc.

37{
38 entity e;
40
41 me.gotoRC(me, 0.5, 0); me.setFirstColumn(me, me.currentColumn);
42 me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, _("Filter:")));
43 me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
44 e.onChange = DemoList_Filter_Change;
45 e.onChangeEntity = demolist;
46
47 me.gotoRC(me, 0.5, 3.7);
48 me.TD(me, 1, 1.5, e = makeXonoticCheckBox(0, "cl_autodemo", _("Auto record demos")));
49 me.TD(me, 1, 1, e = makeXonoticButton(_("Refresh"), '0 0 0'));
50 e.onClick = DemoList_Refresh_Click;
51 e.onClickEntity = demolist;
52
53 me.gotoRC(me, 2, 0);
54 me.TD(me, me.rows - 3, me.columns, demolist);
55
56 me.gotoRC(me, me.rows - 1, 0);
57 me.TD(me, 1, me.columns / 2, e = makeXonoticButton_T(_("Timedemo"), '0 0 0',
58 _("Benchmark how fast your computer can run the highlighted demo")));
59 e.democlicktype = DMO_TIME;
61 e.onClickEntity = me; // demolist is global anyway
62 me.TD(me, 1, me.columns / 2, e = makeXonoticButton(ZCTX(_("DEMO^Play")), '0 0 0'));
63 e.democlicktype = DMO_PLAY;
65 e.onClickEntity = me; // demolist is global anyway
66}
entity makeXonoticDemoList()
Definition demolist.qc:5
void DemoList_Filter_Change(entity box, entity me)
Definition demolist.qc:132
void DemoList_Refresh_Click(entity btn, entity me)
Definition demolist.qc:126
void DemoConfirm_Check_Gamestatus(entity btn, entity me)
#define ZCTX(s)
Definition i18n.qh:68
entity makeXonoticButton_T(string theText, vector theColor, string theTooltip)
Definition button.qc:3
entity makeXonoticButton(string theText, vector theColor)
Definition button.qc:10
string string_null
Definition nil.qh:9
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:10

References DemoConfirm_Check_Gamestatus(), demolist, DemoList_Filter_Change(), DemoList_Refresh_Click(), DMO_PLAY, DMO_TIME, entity(), makeXonoticButton(), makeXonoticButton_T(), makeXonoticCheckBox(), makeXonoticDemoList(), makeXonoticInputBox(), makeXonoticTextLabel(), string_null, and ZCTX.

Variable Documentation

◆ DMO_PLAY

const float DMO_PLAY = 1

Definition at line 9 of file dialog_media_demo.qc.

Referenced by DemoConfirm_Check_Gamestatus(), and XonoticDemoBrowserTab_fill().

◆ DMO_TIME

const float DMO_TIME = 2