From: terencehill Date: Wed, 20 May 2020 13:51:53 +0000 (+0200) Subject: Menu: tie Favorite and Join buttons (and pressing enter in the address input box... X-Git-Tag: xonotic-v0.8.5~1054 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f60b0df16063066ee4c129c2cc8ac74b796f3383;p=xonotic%2Fxonotic-data.pk3dir.git Menu: tie Favorite and Join buttons (and pressing enter in the address input box) exclusively to the content of the address input box (if the address has been manually cleared it's no longer possible to connect to the currently selected server). It fixes #2442 --- diff --git a/qcsrc/menu/xonotic/serverlist.qc b/qcsrc/menu/xonotic/serverlist.qc index b301beafa..21278f720 100644 --- a/qcsrc/menu/xonotic/serverlist.qc +++ b/qcsrc/menu/xonotic/serverlist.qc @@ -528,10 +528,10 @@ void XonoticServerList_draw(entity me) } else { me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT); } - me.connectButton.disabled = (me.lockedSelectedItem || (me.nItems == 0 && me.ipAddressBox.text == "")); + me.connectButton.disabled = (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 == "")); + me.infoButton.disabled = !owned; + me.favoriteButton.disabled = (me.ipAddressBox.text == ""); bool found = false; if(me.lockedSelectedItem) @@ -745,10 +745,8 @@ void XonoticServerList_resizeNotify(entity me, vector relOrigin, vector relSize, } void ServerList_Connect_Click(entity btn, entity me) { - if (me.lockedSelectedItem) - return; - string sv = (me.ipAddressBox.text != "") ? me.ipAddressBox.text : me.selectedServer; - localcmd(sprintf("connect %s\n", sv)); + if (me.ipAddressBox.text != "") + localcmd(sprintf("connect %s\n", me.ipAddressBox.text)); } void ServerList_Favorite_Click(entity btn, entity this) {