Xonotic
dialog_multiplayer_media_demo.qc
Go to the documentation of this file.
1
#include "
dialog_multiplayer_media_demo.qh
"
2
3
#include "
demolist.qh
"
4
#include "
textlabel.qh
"
5
#include "
inputbox.qh
"
6
#include "
checkbox.qh
"
7
#include "
button.qh
"
8
9
const
float
DMO_PLAY
= 1;
10
const
float
DMO_TIME
= 2;
11
void
DemoConfirm_Check_Gamestatus
(
entity
btn,
entity
me)
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
29
entity
makeXonoticDemoBrowserTab
()
30
{
31
entity
me;
32
me =
NEW
(
XonoticDemoBrowserTab
);
33
me.configureDialog(me);
34
return
me;
35
}
36
void
XonoticDemoBrowserTab_fill
(
entity
me)
37
{
38
entity
e;
39
demolist
=
makeXonoticDemoList
();
40
41
me.TR(me);
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, 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, 1.5, 0);
54
me.TD(me, me.rows - 2.5, 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
;
60
e.onClick =
DemoConfirm_Check_Gamestatus
;
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
;
64
e.onClick =
DemoConfirm_Check_Gamestatus
;
65
e.onClickEntity = me;
// demolist is global anyway
66
}
dialog_multiplayer_media_demo.qh
GAME_ISSERVER
const int GAME_ISSERVER
Definition:
menu.qh:11
string_null
string string_null
Definition:
nil.qh:9
NEW
#define NEW(cname,...)
Definition:
oo.qh:105
DMO_TIME
const float DMO_TIME
Definition:
dialog_multiplayer_media_demo.qc:10
makeXonoticButton_T
entity makeXonoticButton_T(string theText, vector theColor, string theTooltip)
Definition:
button.qc:3
XonoticDemoBrowserTab_fill
void XonoticDemoBrowserTab_fill(entity me)
Definition:
dialog_multiplayer_media_demo.qc:36
DemoConfirm_Check_Gamestatus
void DemoConfirm_Check_Gamestatus(entity btn, entity me)
Definition:
dialog_multiplayer_media_demo.qc:11
makeXonoticButton
entity makeXonoticButton(string theText, vector theColor)
Definition:
button.qc:10
XonoticDemoBrowserTab
Definition:
dialog_multiplayer_media_demo.qh:4
entity
entity() spawn
DialogOpenButton_Click
void DialogOpenButton_Click(entity button, entity tab)
Definition:
modalcontroller.qc:30
isdemo
float isdemo()
makeXonoticTextLabel
entity makeXonoticTextLabel(float theAlign, string theText)
Definition:
textlabel.qc:3
demolist.qh
inputbox.qh
checkbox.qh
main
entity main
Definition:
menu.qh:26
ZCTX
#define ZCTX(s)
Definition:
i18n.qh:68
gamestatus
int gamestatus
Definition:
menu.qh:16
GAME_CONNECTED
const int GAME_CONNECTED
Definition:
menu.qh:12
makeXonoticDemoList
entity makeXonoticDemoList()
Definition:
demolist.qc:5
textlabel.qh
button.qh
DemoList_Filter_Change
void DemoList_Filter_Change(entity box, entity me)
Definition:
demolist.qc:132
makeXonoticCheckBox
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition:
checkbox.qc:28
DMO_PLAY
const float DMO_PLAY
Definition:
dialog_multiplayer_media_demo.qc:9
makeXonoticDemoBrowserTab
entity makeXonoticDemoBrowserTab()
Definition:
dialog_multiplayer_media_demo.qc:29
DemoList_Refresh_Click
void DemoList_Refresh_Click(entity btn, entity me)
Definition:
demolist.qc:126
makeXonoticInputBox
entity makeXonoticInputBox(float doEditColorCodes, string theCvar)
Definition:
inputbox.qc:10
demolist
entity demolist
Definition:
demolist.qh:30
menu
xonotic
dialog_multiplayer_media_demo.qc
Generated on Thu Mar 17 2022 17:26:29 for Xonotic by
1.8.13