From: BuddyFriendGuy Date: Fri, 12 Jun 2015 22:20:56 +0000 (-0400) Subject: remove filterString when it is disabled, to avoid confusion X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f300e5f6310eda9b7fd9c79fffdb2633c914f920;p=xonotic%2Fxonotic-data.pk3dir.git remove filterString when it is disabled, to avoid confusion --- diff --git a/qcsrc/menu/xonotic/privateserverlist.qc b/qcsrc/menu/xonotic/privateserverlist.qc index 44a2e6c1a..df774f1d7 100644 --- a/qcsrc/menu/xonotic/privateserverlist.qc +++ b/qcsrc/menu/xonotic/privateserverlist.qc @@ -261,18 +261,20 @@ void PrivateServerList_onAddressNicknameBoxChange(entity box, entity me) } void _PrivateServerList_Filter_Switch(entity box, entity me, bool enabled) { - // This section toggles Filter Switch without erasing user's filterString. - // However, it could be a bit confusing for users. If so, use the next section of code instead if (box.disabled == !enabled) { return; } me.filterBox.disabled = !enabled; - PrivateServerList_onFilterBoxChange(box, me); - //if (enabled) - // return; - //me.filterBox.text = ""; - //PrivateServerList_onFilterBoxChange(box, me); + // We can toggle Filter Switch without erasing user's filterString. + // However, it could be confusing for users when it turns back on. + // To avoid that, we delete FilterString altogether. + if (box.disabled) { + box.setText(box, ""); + box.disabled = false; + } + + PrivateServerList_onFilterBoxChange(box, me); } void PrivateServerList_onFilterBoxChange(entity box, entity me) {