1 #include "dialog_multiplayer_join.qh"
3 #include "serverlist.qh"
5 #include "textlabel.qh"
8 #include "commandbutton.qh"
11 entity makeXonoticServerListTab()
14 me = NEW(XonoticServerListTab);
15 me.configureDialog(me);
19 void XonoticServerListTab_refresh(entity this, entity slist)
22 slist.refreshServerList(slist, clear ? REFRESHSERVERLIST_RESET : REFRESHSERVERLIST_ASK);
25 void XonoticServerListTab_fill(entity me)
29 slist = makeXonoticServerList();
31 me.gotoRC(me, 0.5, 0);
32 me.TD(me, 1, 0.5, e = makeXonoticTextLabel(1, _("Filter:")));
33 me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null));
34 e.onChange = ServerList_Filter_Change;
35 e.onChangeEntity = slist;
36 slist.controlledTextbox = e;
38 me.gotoRC(me, 0.5, 2.6);
39 me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
40 e.onClickEntity = slist;
41 e.onClick = ServerList_Categories_Click;
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.6, 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, "net_slist_pause", _("Pause"),
53 _("Pause updating the server list to prevent servers from \"jumping around\"")));
54 me.TD(me, 1, 1, e = makeXonoticButton_T(_("Refresh"), '0 0 0', _("Reload the server list")));
55 e.onClick = XonoticServerListTab_refresh;
56 e.onClickEntity = slist;
59 me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0'));
60 me.TD(me, 1, 1, slist.sortButton2 = makeXonoticButton(string_null, '0 0 0'));
61 me.TD(me, 1, 1, slist.sortButton3 = makeXonoticButton(string_null, '0 0 0'));
62 me.TD(me, 1, 1, slist.sortButton4 = makeXonoticButton(string_null, '0 0 0'));
63 me.TD(me, 1, 1, slist.sortButton5 = makeXonoticButton(string_null, '0 0 0'));
65 me.TD(me, me.rows - 5, me.columns, slist);
67 me.gotoRC(me, me.rows - 2, 0);
68 me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Address:")));
69 me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
70 e.onEnter = ServerList_Connect_Click;
71 e.onEnterEntity = slist;
72 e.onChange = ServerList_Update_favoriteButton;
73 e.onChangeEntity = slist;
74 slist.ipAddressBox = e;
75 me.TD(me, 1, 1.5, e = makeXonoticButton("", '0 0 0'));
76 e.onClick = ServerList_Favorite_Click;
77 e.onClickEntity = slist;
78 slist.favoriteButton = e;
79 me.TD(me, 1, 1.5, e = makeXonoticButton_T(_("Info..."), '0 0 0',
80 _("Show more information about the currently highlighted server")));
81 e.onClick = ServerList_Info_Click;
82 e.onClickEntity = slist;
87 me.TD(me, 1, 1, e = makeXonoticCommandButton_T(_("Disconnect"), '0 0 0', "disconnect", 0,
88 _("Disconnect from the server")));
89 slist.disconnectButton = e;
92 me.TD(me, 1, me.columns, e = makeXonoticButton(_("Join!"), '0 0 0'));
93 e.onClick = ServerList_Connect_Click;
94 e.onClickEntity = slist;
95 slist.connectButton = e;