]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/dialog_multiplayer_join.qc
Server list: soft refresh
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_multiplayer_join.qc
index 86829871bd695c14e693e6275330ba7f452c311b..a34d0d80a1cb12a9e713efb213d147b5f272226d 100644 (file)
@@ -1,16 +1,11 @@
-#ifndef DIALOG_MULTIPLAYER_JOIN_H
-#define DIALOG_MULTIPLAYER_JOIN_H
-#include "tab.qc"
-CLASS(XonoticServerListTab, XonoticTab)
-       METHOD(XonoticServerListTab, fill, void(entity));
-       ATTRIB(XonoticServerListTab, intendedWidth, float, 0.9)
-       ATTRIB(XonoticServerListTab, rows, float, 23)
-       ATTRIB(XonoticServerListTab, columns, float, 6.5)
-ENDCLASS(XonoticServerListTab)
-entity makeXonoticServerListTab();
-#endif
+#include "dialog_multiplayer_join.qh"
 
-#ifdef IMPLEMENTATION
+#include "serverlist.qh"
+
+#include "textlabel.qh"
+#include "inputbox.qh"
+#include "checkbox.qh"
+#include "button.qh"
 
 entity makeXonoticServerListTab()
 {
@@ -19,6 +14,13 @@ entity makeXonoticServerListTab()
        me.configureDialog(me);
        return me;
 }
+
+void XonoticServerListTab_refresh(entity this, entity slist)
+{
+    bool clear = false;
+    slist.refreshServerList(slist, clear ? REFRESHSERVERLIST_RESET : REFRESHSERVERLIST_ASK);
+}
+
 void XonoticServerListTab_fill(entity me)
 {
        entity e, slist;
@@ -26,25 +28,31 @@ void XonoticServerListTab_fill(entity me)
        slist  = makeXonoticServerList();
 
        me.gotoRC(me, 0.5, 0);
-               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, _("Filter:")));
-               me.TD(me, 1, 2.8, e = makeXonoticInputBox(0, string_null));
+               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(1, _("Filter:")));
+               me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null));
                        e.onChange = ServerList_Filter_Change;
                        e.onChangeEntity = slist;
                        slist.controlledTextbox = e;
 
-       me.gotoRC(me, 0.5, 3.6);
+       me.gotoRC(me, 0.5, 2.6);
                me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
                        e.onClickEntity = slist;
                        e.onClick = ServerList_Categories_Click;
-               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showempty", ZCTX(_("SRVS^Empty"))));
+               me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showempty", ZCTX(_("SRVS^Empty")),
+                       _("Show empty servers")));
                        slist.filterShowEmpty = e.checked;
                        e.onClickEntity = slist;
                        e.onClick = ServerList_ShowEmpty_Click;
-               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showfull", ZCTX(_("SRVS^Full"))));
+               me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showfull", ZCTX(_("SRVS^Full")),
+                       _("Show full servers that have no slots available")));
                        slist.filterShowFull = e.checked;
                        e.onClickEntity = slist;
                        e.onClick = ServerList_ShowFull_Click;
-               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "net_slist_pause", _("Pause")));
+               me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "net_slist_pause", _("Pause"),
+                       _("Pause updating the server list to prevent servers from \"jumping around\"")));
+               me.TD(me, 1, 1, e = makeXonoticButton_T(_("Refresh"), '0 0 0', _("Reload the server list")));
+                       e.onClick = XonoticServerListTab_refresh;
+                       e.onClickEntity = slist;
 
        me.gotoRC(me, 2, 0);
                me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0'));
@@ -67,7 +75,8 @@ void XonoticServerListTab_fill(entity me)
                        e.onClick = ServerList_Favorite_Click;
                        e.onClickEntity = slist;
                        slist.favoriteButton = e;
-               me.TD(me, 1, 1.5, e = makeXonoticButton(_("Info..."), '0 0 0'));
+               me.TD(me, 1, 1.5, e = makeXonoticButton_T(_("Info..."), '0 0 0',
+                       _("Show more information about the currently highlighted server")));
                        e.onClick = ServerList_Info_Click;
                        e.onClickEntity = slist;
                        slist.infoButton = e;
@@ -77,4 +86,3 @@ void XonoticServerListTab_fill(entity me)
                        e.onClickEntity = slist;
                        slist.connectButton = e;
 }
-#endif