]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_multiplayer_join.qc
take3: format 903 files
[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 "button.qh"
9
10 entity makeXonoticServerListTab()
11 {
12         entity me;
13         me = NEW(XonoticServerListTab);
14         me.configureDialog(me);
15         return me;
16 }
17
18 void XonoticServerListTab_refresh(entity this, entity slist)
19 {
20         bool clear = false;
21         slist.refreshServerList(slist, clear ? REFRESHSERVERLIST_RESET : REFRESHSERVERLIST_ASK);
22 }
23
24 void XonoticServerListTab_fill(entity me)
25 {
26         entity e, slist;
27
28         slist  = makeXonoticServerList();
29
30         me.gotoRC(me, 0.5, 0);
31         me.TD(me, 1, 0.5, e = makeXonoticTextLabel(1, _("Filter:")));
32         me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null));
33         e.onChange = ServerList_Filter_Change;
34         e.onChangeEntity = slist;
35         slist.controlledTextbox = e;
36
37         me.gotoRC(me, 0.5, 2.6);
38         me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
39         e.onClickEntity = slist;
40         e.onClick = ServerList_Categories_Click;
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.6, 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, "net_slist_pause", _("Pause"),
52                         _("Pause updating the server list to prevent servers from \"jumping around\"")));
53         me.TD(me, 1, 1, e = makeXonoticButton_T(_("Refresh"), '0 0 0', _("Reload the server list")));
54         e.onClick = XonoticServerListTab_refresh;
55         e.onClickEntity = slist;
56
57         me.gotoRC(me, 2, 0);
58         me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0'));
59         me.TD(me, 1, 1, slist.sortButton2 = makeXonoticButton(string_null, '0 0 0'));
60         me.TD(me, 1, 1, slist.sortButton3 = makeXonoticButton(string_null, '0 0 0'));
61         me.TD(me, 1, 1, slist.sortButton4 = makeXonoticButton(string_null, '0 0 0'));
62         me.TD(me, 1, 1, slist.sortButton5 = makeXonoticButton(string_null, '0 0 0'));
63         me.TR(me);
64         me.TD(me, me.rows - 5, me.columns, slist);
65
66         me.gotoRC(me, me.rows - 2, 0);
67         me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Address:")));
68         me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
69         e.onEnter = ServerList_Connect_Click;
70         e.onEnterEntity = slist;
71         e.onChange = ServerList_Update_favoriteButton;
72         e.onChangeEntity = slist;
73         slist.ipAddressBox = e;
74         me.TD(me, 1, 1.5, e = makeXonoticButton("", '0 0 0'));
75         e.onClick = ServerList_Favorite_Click;
76         e.onClickEntity = slist;
77         slist.favoriteButton = e;
78         me.TD(me, 1, 1.5, e = makeXonoticButton_T(_("Info..."), '0 0 0',
79                         _("Show more information about the currently highlighted server")));
80         e.onClick = ServerList_Info_Click;
81         e.onClickEntity = slist;
82         slist.infoButton = e;
83         me.TR(me);
84         me.TD(me, 1, me.columns, e = makeXonoticButton(_("Join!"), '0 0 0'));
85         e.onClick = ServerList_Connect_Click;
86         e.onClickEntity = slist;
87         slist.connectButton = e;
88 }