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 btn.color = '1 1 1';
23 btn.colorF = '1 1 1';
24 }
25 }
26 else
27 {
28 if (btn.toString(btn) == _("Restart level"))
29 {
30 btn.setText(btn, _("Join!"));
31 btn.onClickCommand = "join";
32 btn.color = '0 1 0';
33 btn.colorF = '0 1 0';
34 }
35 }
37}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float cvar(string name)
#define SUPER(cname)
Definition oo.qh:236

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

◆ XonoticGameMenuDialog_fill()

void XonoticGameMenuDialog_fill ( entity me)

Definition at line 39 of file dialog_gamemenu.qc.

40{
41 registercvar("_menu_gamemenu_dialog_available", "0", 0);
42 cvar_set("_menu_gamemenu_dialog_available", "1");
43
44 entity e;
45 me.TR(me);
46 me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Main menu"), '0 0 0', "menu_cmd nexposee", 0));
47 // NOTE these buttons use directmenu so that the menu will be hidden when these dialogs are closed
48 me.TR(me);
49 me.TDempty(me, 0.1);
50 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Servers"), '0 0 0', "menu_cmd directmenu servers", 0));
51 me.TR(me);
52 me.TDempty(me, 0.1);
53 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Profile"), '0 0 0', "menu_cmd directmenu profile", 0));
54 me.TR(me);
55 me.TDempty(me, 0.1);
56 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Settings"), '0 0 0', "menu_cmd directmenu settings", 0));
57 me.TR(me);
58 me.TDempty(me, 0.1);
59 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Input"), '0 0 0', "menu_cmd directmenu inputsettings", 0));
60 me.TR(me);
61 me.TDempty(me, 0.1);
62 me.TD(me, 1, 0.8, e = makeXonoticCommandButton(_("Guide"), '0 0 0', "menu_cmd directmenu guide", 0));
63 me.TR(me);
64 me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Quick menu"), '0 0 0', "quickmenu", COMMANDBUTTON_CLOSE));
65 me.TR(me);
66 me.TR(me);
67 me.TD(me, 1, 1, e = me.joinButton = makeXonoticCommandButton(_("Join!"), '0 1 0', "join", COMMANDBUTTON_CLOSE));
68 me.TR(me);
69 me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Spectate"), '0 0 0', "spec", COMMANDBUTTON_CLOSE));
70 me.TR(me);
71 me.TR(me);
72 me.TD(me, 1, 1, e = makeXonoticLeaveMatchButton('0 0 0', COMMANDBUTTON_CLOSE));
73 me.TR(me);
74 me.TR(me);
75 me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Quit"), '1 0 0', "menu_showquitdialog", 0));
76}
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().