Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
leavematchbutton.qc File Reference
Include dependency graph for leavematchbutton.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string leaveMatchButton_getText (entity me)
string leaveMatchButton_getTooltip (entity me)
entity makeXonoticLeaveMatchButton (vector theColor, int theFlags)
void XonoticLeaveMatchButton_configureXonoticLeaveMatchButton (entity me, vector theColor, int theFlags)
void XonoticLeaveMatchButton_draw (entity me)

Variables

const string LEAVEMATCH_CMD = "defer 0.4 disconnect; defer 0.4 wait; defer 0.4 \"g_campaign 0\"; defer 0.4 menu_sync"

Function Documentation

◆ leaveMatchButton_getText()

string leaveMatchButton_getText ( entity me)

Definition at line 9 of file leavematchbutton.qc.

10{
11 if (me.disabled)
12 return _("Leave current match");
13 else if(isdemo())
14 return _("Stop demo");
15 else if(cvar("g_campaign"))
16 return _("Leave campaign");
17 else if (isServerSingleplayer())
18 return _("Leave singleplayer");
19 else
20 return _("Leave multiplayer");
21}
bool isServerSingleplayer()
Definition util.qc:804
float isdemo()
float cvar(string name)

References cvar(), entity(), isdemo(), and isServerSingleplayer().

Referenced by XonoticLeaveMatchButton_draw().

◆ leaveMatchButton_getTooltip()

string leaveMatchButton_getTooltip ( entity me)

Definition at line 23 of file leavematchbutton.qc.

24{
25 if (me.disabled || isdemo())
26 return "-";
27 else if(cvar("g_campaign"))
28 return _("Leave current campaign level");
29 else if (isServerSingleplayer())
30 return _("Leave current singleplayer match");
31 else
32 return _("Leave current multiplayer match / Disconnect from the server");
33}

References cvar(), entity(), isdemo(), and isServerSingleplayer().

Referenced by XonoticLeaveMatchButton_draw().

◆ makeXonoticLeaveMatchButton()

entity makeXonoticLeaveMatchButton ( vector theColor,
int theFlags )

Definition at line 35 of file leavematchbutton.qc.

36{
37 entity me;
39 me.configureXonoticLeaveMatchButton(me, theColor, theFlags);
40 return me;
41}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define NEW(cname,...)
Definition oo.qh:117

References entity(), NEW, and vector.

Referenced by XonoticLeaveMatchButton::configureXonoticLeaveMatchButton(), XonoticGameMenuDialog_fill(), XonoticServerCreateTab_fill(), XonoticServerListTab_fill(), and XonoticSingleplayerDialog_fill().

◆ XonoticLeaveMatchButton_configureXonoticLeaveMatchButton()

void XonoticLeaveMatchButton_configureXonoticLeaveMatchButton ( entity me,
vector theColor,
int theFlags )

Definition at line 51 of file leavematchbutton.qc.

52{
53 me.configureXonoticCommandButton(me, string_null, theColor, LEAVEMATCH_CMD, theFlags, string_null);
55}
void XonoticLeaveMatchButton_draw(entity me)
const string LEAVEMATCH_CMD
string string_null
Definition nil.qh:9

References entity(), LEAVEMATCH_CMD, string_null, vector, and XonoticLeaveMatchButton_draw().

◆ XonoticLeaveMatchButton_draw()

void XonoticLeaveMatchButton_draw ( entity me)

Definition at line 43 of file leavematchbutton.qc.

44{
46 me.disabled = !(gamestatus & (GAME_ISSERVER | GAME_CONNECTED));
47 me.setText(me, leaveMatchButton_getText(me));
49}
string leaveMatchButton_getText(entity me)
string leaveMatchButton_getTooltip(entity me)
void setZonedTooltip(entity e, string theTooltip, string theCvar)
Definition util.qc:257
const int GAME_ISSERVER
Definition menu.qh:11
const int GAME_CONNECTED
Definition menu.qh:12
int gamestatus
Definition menu.qh:16
#define SUPER(cname)
Definition oo.qh:231

References entity(), GAME_CONNECTED, GAME_ISSERVER, gamestatus, leaveMatchButton_getText(), leaveMatchButton_getTooltip(), setZonedTooltip(), string_null, and SUPER.

Referenced by XonoticLeaveMatchButton_configureXonoticLeaveMatchButton().

Variable Documentation

◆ LEAVEMATCH_CMD

const string LEAVEMATCH_CMD = "defer 0.4 disconnect; defer 0.4 wait; defer 0.4 \"g_campaign 0\"; defer 0.4 menu_sync"