]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Issue-1618 : add button to disconnect from server 554/head
authorBen Waters <Ben.Waters@member.fsf.org>
Mon, 16 Apr 2018 00:03:07 +0000 (20:03 -0400)
committerBen Waters <Ben.Waters@member.fsf.org>
Thu, 19 Apr 2018 02:43:51 +0000 (22:43 -0400)
qcsrc/menu/xonotic/dialog_multiplayer_join.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/serverlist.qh

index a34d0d80a1cb12a9e713efb213d147b5f272226d..cd75a0ab55bddf41e4b2560933a785e8c14729ba 100644 (file)
@@ -81,7 +81,10 @@ void XonoticServerListTab_fill(entity me)
                        e.onClickEntity = slist;
                        slist.infoButton = e;
        me.TR(me);
-               me.TD(me, 1, me.columns, e = makeXonoticButton(_("Join!"), '0 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticCommandButton_T(_("Disconnect"), '0 0 0', "echo disconnect\ndisconnect", 0,
+                       _("Disconnecting from server")));
+                       slist.disconnectButton = e;
+               me.TD(me, 1, me.columns-1, e = makeXonoticButton(_("Join!"), '0 0 0'));
                        e.onClick = ServerList_Connect_Click;
                        e.onClickEntity = slist;
                        slist.connectButton = e;
index 503a975c326fe09ba82aab79ac0b5131d6cb41a5..eec56ca5fd56725c7106d0ba246f8f70396d104f 100644 (file)
@@ -546,6 +546,7 @@ void XonoticServerList_draw(entity me)
        else { me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT); }
 
        me.connectButton.disabled = (me.lockedSelectedItem || (me.nItems == 0 && me.ipAddressBox.text == ""));
+       me.disconnectButton.disabled = (!(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)));
        me.infoButton.disabled = (me.lockedSelectedItem || me.nItems == 0 || !owned);
        me.favoriteButton.disabled = (me.lockedSelectedItem || (me.nItems == 0 && me.ipAddressBox.text == ""));
 
index 32359ad2b22edf9abf652201b8e8c6a6b199c217..74f3bd570d5fee88efdcdbab3fbdaa341c2545a6 100644 (file)
@@ -52,6 +52,7 @@ CLASS(XonoticServerList, XonoticListBox)
        ATTRIB(XonoticServerList, sortButton4, entity);
        ATTRIB(XonoticServerList, sortButton5, entity);
        ATTRIB(XonoticServerList, connectButton, entity);
+       ATTRIB(XonoticServerList, disconnectButton, entity);
        ATTRIB(XonoticServerList, infoButton, entity);
        ATTRIB(XonoticServerList, currentSortOrder, float, 0);
        ATTRIB(XonoticServerList, currentSortField, float, -1);