]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_multiplayer_join.qc
Merge branch 'master' into terencehill/menu_quit_game
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_multiplayer_join.qc
1 #include "dialog_multiplayer_join.qh"
2
3 #include "serverlist.qh"
4
5 #include "textlabel.qh"
6 #include "inputbox.qh"
7 #include "checkbox.qh"
8 #include "commandbutton.qh"
9 #include "leavematchbutton.qh"
10 #include "button.qh"
11
12 entity makeXonoticServerListTab()
13 {
14         entity me;
15         me = NEW(XonoticServerListTab);
16         me.configureDialog(me);
17         return me;
18 }
19
20 void XonoticServerListTab_refresh(entity this, entity slist)
21 {
22         slist.refreshServerList(slist, REFRESHSERVERLIST_ASK);
23 }
24
25 void XonoticServerListTab_fill(entity me)
26 {
27         entity e, slist;
28
29         slist  = makeXonoticServerList();
30
31         me.gotoRC(me, 0.5, 0);
32                 me.TD(me, 1, 0.8, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
33                         e.onClickEntity = slist;
34                         e.onClick = ServerList_Categories_Click;
35                 /* FILTER CONTROLS */
36                 me.TD(me, 1, 0.5, e = makeXonoticTextLabel(1, _("Filter:")));
37                 me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null));
38                         e.onChange = ServerList_Filter_Change;
39                         e.onChangeEntity = slist;
40                         slist.controlledTextbox = e;
41         me.gotoRC(me, 0.5, 0.8 + 0.5 + 2);
42                 me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showempty", ZCTX(_("SRVS^Empty")),
43                         _("Show empty servers")));
44                         slist.filterShowEmpty = e.checked;
45                         e.onClickEntity = slist;
46                         e.onClick = ServerList_ShowEmpty_Click;
47                 me.TD(me, 1, 0.5, e = makeXonoticCheckBox_T(0, "menu_slist_showfull", ZCTX(_("SRVS^Full")),
48                         _("Show full servers that have no slots available")));
49                         slist.filterShowFull = e.checked;
50                         e.onClickEntity = slist;
51                         e.onClick = ServerList_ShowFull_Click;
52                 me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showlaggy", ZCTX(_("SRVS^Laggy")),
53                         _("Show high latency servers")));
54                         slist.filterShowLaggy = e.checked;
55                         e.onClickEntity = slist;
56                         e.onClick = ServerList_ShowLaggy_Click;
57                 /* END FILTER CONTROLS */
58                 me.TDempty(me, 0.1);
59                 me.TD(me, 1, 0.8, e = makeXonoticButton_T(_("Refresh"), '0 0 0', _("Reload the server list")));
60                         e.onClick = XonoticServerListTab_refresh;
61                         e.onClickEntity = slist;
62                 me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "net_slist_pause", _("Pause"),
63                         _("Pause updating the server list to prevent servers from \"jumping around\"")));
64
65         me.gotoRC(me, 2, 0);
66                 me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0'));
67                 me.TD(me, 1, 1, slist.sortButton2 = makeXonoticButton(string_null, '0 0 0'));
68                 me.TD(me, 1, 1, slist.sortButton3 = makeXonoticButton(string_null, '0 0 0'));
69                 me.TD(me, 1, 1, slist.sortButton4 = makeXonoticButton(string_null, '0 0 0'));
70                 me.TD(me, 1, 1, slist.sortButton5 = makeXonoticButton(string_null, '0 0 0'));
71         me.TR(me);
72                 me.TD(me, me.rows - 5, me.columns, slist);
73
74         me.gotoRC(me, me.rows - 2, 0);
75                 me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Address:")));
76                 me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
77                         e.onEnter = ServerList_Connect_Click;
78                         e.onEnterEntity = slist;
79                         e.onChange = ServerList_Update_favoriteButton;
80                         e.onChangeEntity = slist;
81                         slist.ipAddressBox = e;
82                 me.TD(me, 1, 1.5, e = makeXonoticButton("", '0 0 0'));
83                         e.onClick = ServerList_Favorite_Click;
84                         e.onClickEntity = slist;
85                         slist.favoriteButton = e;
86                 me.TD(me, 1, 1.5, e = makeXonoticButton_T(_("Info..."), '0 0 0',
87                         _("Show more information about the currently highlighted server")));
88                         e.onClick = ServerList_Info_Click;
89                         e.onClickEntity = slist;
90                         slist.infoButton = e;
91         me.TR(me);
92                 me.TD(me, 1, me.columns * 0.5, e = makeXonoticLeaveMatchButton('0 0 0', 0));
93                 me.TD(me, 1, me.columns * 0.5, e = makeXonoticButton(_("Join!"), '0 0 0'));
94                         e.onClick = ServerList_Connect_Click;
95                         e.onClickEntity = slist;
96                         slist.connectButton = e;
97 }