Xonotic
dialog_multiplayer_join.qc
Go to the documentation of this file.
2 
3 #include "serverlist.qh"
4 
5 #include "textlabel.qh"
6 #include "inputbox.qh"
7 #include "checkbox.qh"
8 #include "commandbutton.qh"
9 #include "button.qh"
10 
12 {
13  entity me;
15  me.configureDialog(me);
16  return me;
17 }
18 
20 {
21  slist.refreshServerList(slist, REFRESHSERVERLIST_ASK);
22 }
23 
25 {
26  entity e, slist;
27 
28  slist = makeXonoticServerList();
29 
30  me.gotoRC(me, 0.5, 0);
31  me.TD(me, 1, 0.8, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
32  e.onClickEntity = slist;
33  e.onClick = ServerList_Categories_Click;
34  /* FILTER CONTROLS */
35  me.TD(me, 1, 0.5, e = makeXonoticTextLabel(1, _("Filter:")));
36  me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null));
37  e.onChange = ServerList_Filter_Change;
38  e.onChangeEntity = slist;
39  slist.controlledTextbox = e;
40  me.gotoRC(me, 0.5, 0.8 + 0.5 + 2);
41  me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showempty", ZCTX(_("SRVS^Empty")),
42  _("Show empty servers")));
43  slist.filterShowEmpty = e.checked;
44  e.onClickEntity = slist;
45  e.onClick = ServerList_ShowEmpty_Click;
46  me.TD(me, 1, 0.5, e = makeXonoticCheckBox_T(0, "menu_slist_showfull", ZCTX(_("SRVS^Full")),
47  _("Show full servers that have no slots available")));
48  slist.filterShowFull = e.checked;
49  e.onClickEntity = slist;
50  e.onClick = ServerList_ShowFull_Click;
51  me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showlaggy", ZCTX(_("SRVS^Laggy")),
52  _("Show high latency servers")));
53  slist.filterShowLaggy = e.checked;
54  e.onClickEntity = slist;
55  e.onClick = ServerList_ShowLaggy_Click;
56  /* END FILTER CONTROLS */
57  me.TDempty(me, 0.1);
58  me.TD(me, 1, 0.8, e = makeXonoticButton_T(_("Refresh"), '0 0 0', _("Reload the server list")));
59  e.onClick = XonoticServerListTab_refresh;
60  e.onClickEntity = slist;
61  me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "net_slist_pause", _("Pause"),
62  _("Pause updating the server list to prevent servers from \"jumping around\"")));
63 
64  me.gotoRC(me, 2, 0);
65  me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0'));
66  me.TD(me, 1, 1, slist.sortButton2 = makeXonoticButton(string_null, '0 0 0'));
67  me.TD(me, 1, 1, slist.sortButton3 = makeXonoticButton(string_null, '0 0 0'));
68  me.TD(me, 1, 1, slist.sortButton4 = makeXonoticButton(string_null, '0 0 0'));
69  me.TD(me, 1, 1, slist.sortButton5 = makeXonoticButton(string_null, '0 0 0'));
70  me.TR(me);
71  me.TD(me, me.rows - 5, me.columns, slist);
72 
73  me.gotoRC(me, me.rows - 2, 0);
74  me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Address:")));
75  me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
76  e.onEnter = ServerList_Connect_Click;
77  e.onEnterEntity = slist;
79  e.onChangeEntity = slist;
80  slist.ipAddressBox = e;
81  me.TD(me, 1, 1.5, e = makeXonoticButton("", '0 0 0'));
82  e.onClick = ServerList_Favorite_Click;
83  e.onClickEntity = slist;
84  slist.favoriteButton = e;
85  me.TD(me, 1, 1.5, e = makeXonoticButton_T(_("Info..."), '0 0 0',
86  _("Show more information about the currently highlighted server")));
87  e.onClick = ServerList_Info_Click;
88  e.onClickEntity = slist;
89  slist.infoButton = e;
90  me.TR(me);
91  /*
92  me.TD(me, 1, 1, e = makeXonoticCommandButton_T(_("Disconnect"), '0 0 0', "disconnect", 0,
93  _("Disconnect from the server")));
94  slist.disconnectButton = e;
95  */
96  me.TD(me, 1, me.columns, e = makeXonoticButton(_("Join!"), '0 0 0'));
97  e.onClick = ServerList_Connect_Click;
98  e.onClickEntity = slist;
99  slist.connectButton = e;
100 }
string string_null
Definition: nil.qh:9
void XonoticServerListTab_fill(entity me)
entity makeXonoticServerList()
Definition: serverlist.qc:272
#define NEW(cname,...)
Definition: oo.qh:105
void ServerList_Update_favoriteButton(entity btn, entity me)
Definition: serverlist.qc:257
entity() spawn
entity makeXonoticTextLabel(float theAlign, string theText)
Definition: textlabel.qc:3
void ServerList_Categories_Click(entity box, entity me)
Definition: serverlist.qc:667
void ServerList_Info_Click(entity btn, entity me)
Definition: serverlist.qc:781
void ServerList_ShowEmpty_Click(entity box, entity me)
Definition: serverlist.qc:676
entity makeXonoticServerListTab()
#define ZCTX(s)
Definition: i18n.qh:68
void ServerList_ShowLaggy_Click(entity box, entity me)
Definition: serverlist.qc:694
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
Definition: checkbox.qc:3
void ServerList_Filter_Change(entity box, entity me)
Definition: serverlist.qc:656
void ServerList_ShowFull_Click(entity box, entity me)
Definition: serverlist.qc:685
void XonoticServerListTab_refresh(entity this, entity slist)
const float REFRESHSERVERLIST_ASK
Definition: serverlist.qh:123
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
Definition: checkbox.qc:28
void ServerList_Connect_Click(entity btn, entity me)
Definition: serverlist.qc:767
entity makeXonoticInputBox(float doEditColorCodes, string theCvar)
Definition: inputbox.qc:10
void ServerList_Favorite_Click(entity btn, entity this)
Definition: serverlist.qc:772