]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_multiplayer_join.qc
Rename quitbutton.qc/qh files to leavematchbutton.qc/qh
[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     bool clear = false;
23     slist.refreshServerList(slist, clear ? REFRESHSERVERLIST_RESET : REFRESHSERVERLIST_ASK);
24 }
25
26 .entity quitGameButton;
27
28 void XonoticServerListTab_fill(entity me)
29 {
30         entity e, slist;
31
32         slist  = makeXonoticServerList();
33
34         me.gotoRC(me, 0.5, 0);
35                 me.TD(me, 1, 0.8, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
36                         e.onClickEntity = slist;
37                         e.onClick = ServerList_Categories_Click;
38                 /* FILTER CONTROLS */
39                 me.TD(me, 1, 0.5, e = makeXonoticTextLabel(1, _("Filter:")));
40                 me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null));
41                         e.onChange = ServerList_Filter_Change;
42                         e.onChangeEntity = slist;
43                         slist.controlledTextbox = e;
44         me.gotoRC(me, 0.5, 0.8 + 0.5 + 2);
45                 me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showempty", ZCTX(_("SRVS^Empty")),
46                         _("Show empty servers")));
47                         slist.filterShowEmpty = e.checked;
48                         e.onClickEntity = slist;
49                         e.onClick = ServerList_ShowEmpty_Click;
50                 me.TD(me, 1, 0.5, e = makeXonoticCheckBox_T(0, "menu_slist_showfull", ZCTX(_("SRVS^Full")),
51                         _("Show full servers that have no slots available")));
52                         slist.filterShowFull = e.checked;
53                         e.onClickEntity = slist;
54                         e.onClick = ServerList_ShowFull_Click;
55                 me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showlaggy", ZCTX(_("SRVS^Laggy")),
56                         _("Show high latency servers")));
57                         slist.filterShowLaggy = e.checked;
58                         e.onClickEntity = slist;
59                         e.onClick = ServerList_ShowLaggy_Click;
60                 /* END FILTER CONTROLS */
61                 me.TDempty(me, 0.1);
62                 me.TD(me, 1, 0.8, e = makeXonoticButton_T(_("Refresh"), '0 0 0', _("Reload the server list")));
63                         e.onClick = XonoticServerListTab_refresh;
64                         e.onClickEntity = slist;
65                 me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "net_slist_pause", _("Pause"),
66                         _("Pause updating the server list to prevent servers from \"jumping around\"")));
67
68         me.gotoRC(me, 2, 0);
69                 me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0'));
70                 me.TD(me, 1, 1, slist.sortButton2 = makeXonoticButton(string_null, '0 0 0'));
71                 me.TD(me, 1, 1, slist.sortButton3 = makeXonoticButton(string_null, '0 0 0'));
72                 me.TD(me, 1, 1, slist.sortButton4 = makeXonoticButton(string_null, '0 0 0'));
73                 me.TD(me, 1, 1, slist.sortButton5 = makeXonoticButton(string_null, '0 0 0'));
74         me.TR(me);
75                 me.TD(me, me.rows - 5, me.columns, slist);
76
77         me.gotoRC(me, me.rows - 2, 0);
78                 me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Address:")));
79                 me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
80                         e.onEnter = ServerList_Connect_Click;
81                         e.onEnterEntity = slist;
82                         e.onChange = ServerList_Update_favoriteButton;
83                         e.onChangeEntity = slist;
84                         slist.ipAddressBox = e;
85                 me.TD(me, 1, 1.5, e = makeXonoticButton("", '0 0 0'));
86                         e.onClick = ServerList_Favorite_Click;
87                         e.onClickEntity = slist;
88                         slist.favoriteButton = e;
89                 me.TD(me, 1, 1.5, e = makeXonoticButton_T(_("Info..."), '0 0 0',
90                         _("Show more information about the currently highlighted server")));
91                         e.onClick = ServerList_Info_Click;
92                         e.onClickEntity = slist;
93                         slist.infoButton = e;
94         me.TR(me);
95                 me.TD(me, 1, me.columns * 0.5, me.quitGameButton = makeXonoticQuitButton('0 0 0', 0));
96                 me.TD(me, 1, me.columns * 0.5, e = makeXonoticButton(_("Join!"), '0 0 0'));
97                         e.onClick = ServerList_Connect_Click;
98                         e.onClickEntity = slist;
99                         slist.connectButton = e;
100 }