]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/menu/xonotic/dialog_multiplayer_join.qc
Merge branch 'terencehill/obsolete_cvars_removal' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_multiplayer_join.qc
1 #ifndef DIALOG_MULTIPLAYER_JOIN_H
2 #define DIALOG_MULTIPLAYER_JOIN_H
3 #include "tab.qc"
4 CLASS(XonoticServerListTab, XonoticTab)
5         METHOD(XonoticServerListTab, fill, void(entity));
6         ATTRIB(XonoticServerListTab, intendedWidth, float, 0.9)
7         ATTRIB(XonoticServerListTab, rows, float, 23)
8         ATTRIB(XonoticServerListTab, columns, float, 6.5)
9 ENDCLASS(XonoticServerListTab)
10 entity makeXonoticServerListTab();
11 #endif
12
13 #ifdef IMPLEMENTATION
14
15 entity makeXonoticServerListTab()
16 {
17         entity me;
18         me = NEW(XonoticServerListTab);
19         me.configureDialog(me);
20         return me;
21 }
22 void XonoticServerListTab_fill(entity me)
23 {
24         entity e, slist;
25
26         slist  = makeXonoticServerList();
27
28         me.gotoRC(me, 0.5, 0);
29                 me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, _("Filter:")));
30                 me.TD(me, 1, 2.8, e = makeXonoticInputBox(0, string_null));
31                         e.onChange = ServerList_Filter_Change;
32                         e.onChangeEntity = slist;
33                         slist.controlledTextbox = e;
34
35         me.gotoRC(me, 0.5, 3.6);
36                 me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
37                         e.onClickEntity = slist;
38                         e.onClick = ServerList_Categories_Click;
39                 me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showempty", ZCTX(_("SRVS^Empty")),
40                         _("Show empty servers")));
41                         slist.filterShowEmpty = e.checked;
42                         e.onClickEntity = slist;
43                         e.onClick = ServerList_ShowEmpty_Click;
44                 me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showfull", ZCTX(_("SRVS^Full")),
45                         _("Show full servers that have no slots available")));
46                         slist.filterShowFull = e.checked;
47                         e.onClickEntity = slist;
48                         e.onClick = ServerList_ShowFull_Click;
49                 me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "net_slist_pause", _("Pause"),
50                         _("Pause updating the server list to prevent servers from \"jumping around\"")));
51
52         me.gotoRC(me, 2, 0);
53                 me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0'));
54                 me.TD(me, 1, 1, slist.sortButton2 = makeXonoticButton(string_null, '0 0 0'));
55                 me.TD(me, 1, 1, slist.sortButton3 = makeXonoticButton(string_null, '0 0 0'));
56                 me.TD(me, 1, 1, slist.sortButton4 = makeXonoticButton(string_null, '0 0 0'));
57                 me.TD(me, 1, 1, slist.sortButton5 = makeXonoticButton(string_null, '0 0 0'));
58         me.TR(me);
59                 me.TD(me, me.rows - 5, me.columns, slist);
60
61         me.gotoRC(me, me.rows - 2, 0);
62                 me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Address:")));
63                 me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
64                         e.onEnter = ServerList_Connect_Click;
65                         e.onEnterEntity = slist;
66                         e.onChange = ServerList_Update_favoriteButton;
67                         e.onChangeEntity = slist;
68                         slist.ipAddressBox = e;
69                 me.TD(me, 1, 1.5, e = makeXonoticButton("", '0 0 0'));
70                         e.onClick = ServerList_Favorite_Click;
71                         e.onClickEntity = slist;
72                         slist.favoriteButton = e;
73                 me.TD(me, 1, 1.5, e = makeXonoticButton_T(_("Info..."), '0 0 0',
74                         _("Show more information about the currently highlighted server")));
75                         e.onClick = ServerList_Info_Click;
76                         e.onClickEntity = slist;
77                         slist.infoButton = e;
78         me.TR(me);
79                 me.TD(me, 1, me.columns, e = makeXonoticButton(_("Join!"), '0 0 0'));
80                         e.onClick = ServerList_Connect_Click;
81                         e.onClickEntity = slist;
82                         slist.connectButton = e;
83 }
84 #endif