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