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