From f300e5f6310eda9b7fd9c79fffdb2633c914f920 Mon Sep 17 00:00:00 2001 From: BuddyFriendGuy Date: Fri, 12 Jun 2015 18:20:56 -0400 Subject: [PATCH] remove filterString when it is disabled, to avoid confusion --- qcsrc/menu/xonotic/privateserverlist.qc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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) { -- 2.39.2