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

Go to the source code of this file.

Functions

void XonoticGameMenuDialog_destroy (entity me)
void XonoticGameMenuDialog_draw (entity me)
void XonoticGameMenuDialog_fill (entity me)

Function Documentation

◆ XonoticGameMenuDialog_destroy()

void XonoticGameMenuDialog_destroy ( entity me)

Definition at line 8 of file dialog_gamemenu.qc.

9{
10 cvar_set("_menu_gamemenu_dialog_available", "0");
11}
void cvar_set(string name, string value)

References cvar_set(), and entity().

◆ XonoticGameMenuDialog_draw()

void XonoticGameMenuDialog_draw ( entity me)

Definition at line 13 of file dialog_gamemenu.qc.

14{
15 entity btn = me.joinButton;
16 if(cvar("g_campaign"))
17 {
18 if (btn.toString(btn) == _("Join!"))
19 {
20 btn.setText(btn, _("Restart level"));
21 btn.onClickCommand = "resetmatch";
22 }
23 }
24 else
25 {
26 if (btn.toString(btn) == _("Restart level"))
27 {
28 btn.setText(btn, _("Join!"));
29 btn.onClickCommand = "join";
30 }
31 }
33}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float cvar(string name)
#define SUPER(cname)
Definition oo.qh:231

References cvar(), entity(), and SUPER.

◆ XonoticGameMenuDialog_fill()

void XonoticGameMenuDialog_fill ( entity me)

Definition at line 35 of file dialog_gamemenu.qc.

36{
37 registercvar("_menu_gamemenu_dialog_available", "0", 0);
38 cvar_set("_menu_gamemenu_dialog_available", "1");
39
40 entity e;
41 me.TR(me);
42 me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Main menu"), '0 0 0', "menu_cmd nexposee", 0));
43 // NOTE these buttons use directmenu so that the menu will be hidden when these dialogs are closed
44 me.TR(me);
45 me.TDempty(me, 0.1);
46 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Servers"), '0 0 0', "menu_cmd directmenu servers", 0));
47 me.TR(me);
48 me.TDempty(me, 0.1);
49 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Profile"), '0 0 0', "menu_cmd directmenu profile", 0));
50 me.TR(me);
51 me.TDempty(me, 0.1);
52 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Settings"), '0 0 0', "menu_cmd directmenu settings", 0));
53 me.TR(me);
54 me.TDempty(me, 0.1);
55 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Input"), '0 0 0', "menu_cmd directmenu inputsettings", 0));
56 me.TR(me);
57 me.TDempty(me, 0.1);
58 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Guide"), '0 0 0', "menu_cmd directmenu guide", 0));
59 me.TR(me);
60 me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Quick menu"), '0 0 0', "quickmenu", COMMANDBUTTON_CLOSE));
61 me.TR(me);
62 me.TR(me);
63 me.TD(me, 1, 1, e = me.joinButton = makeXonoticCommandButton(_("Join!"), '0 0 0', "join", COMMANDBUTTON_CLOSE));
64 me.TR(me);
65 me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Spectate"), '0 0 0', "spec", COMMANDBUTTON_CLOSE));
66 me.TR(me);
67 me.TR(me);
68 me.TD(me, 1, 1, e = makeXonoticLeaveMatchButton('0 0 0', COMMANDBUTTON_CLOSE));
69 me.TR(me);
70 me.TR(me);
71 me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Quit"), '1 0 0', "menu_showquitdialog", 0));
72}
entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, int theFlags)
#define COMMANDBUTTON_CLOSE
entity makeXonoticLeaveMatchButton(vector theColor, int theFlags)
float registercvar(string name, string value, float flags)

References COMMANDBUTTON_CLOSE, cvar_set(), entity(), makeXonoticCommandButton(), makeXonoticLeaveMatchButton(), and registercvar().