]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
remove filterString when it is disabled, to avoid confusion
authorBuddyFriendGuy <bfggeneral@gmail.com>
Fri, 12 Jun 2015 22:20:56 +0000 (18:20 -0400)
committerBuddyFriendGuy <bfggeneral@gmail.com>
Fri, 12 Jun 2015 22:20:56 +0000 (18:20 -0400)
qcsrc/menu/xonotic/privateserverlist.qc

index 44a2e6c1af43d8c7a1a6089caa55710df6b3a259..df774f1d7aa6095361423ec1b1c42d4a4a80df34 100644 (file)
@@ -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)
 {