Browse Source

Don't double sort/filter on level pack change.

Stephen Damm 6 năm trước cách đây
mục cha
commit
c02b2d05f4

BIN
Screenshot.png


+ 1 - 1
SongBrowserPlugin/DataAccess/SongBrowserModel.cs

@@ -334,7 +334,7 @@ namespace SongBrowserPlugin
             }
             }
 
 
             // Actually sort and filter
             // Actually sort and filter
-            this.ProcessSongList();
+            //this.ProcessSongList();
 
 
             // Signal complete
             // Signal complete
             if (SongLoader.CustomLevels.Count > 0)
             if (SongLoader.CustomLevels.Count > 0)

+ 11 - 2
SongBrowserPlugin/UI/Browser/SongBrowserUI.cs

@@ -1530,7 +1530,12 @@ namespace SongBrowserPlugin.UI
                 }
                 }
 
 
                 _model.UpdateLevelRecords();
                 _model.UpdateLevelRecords();
-                UpdateLevelPackSelection();
+
+                bool didUpdateLevelPack = UpdateLevelPackSelection();
+                if (!didUpdateLevelPack)
+                {
+                    _model.ProcessSongList();
+                }
             }
             }
             catch (Exception e)
             catch (Exception e)
             {
             {
@@ -1550,7 +1555,7 @@ namespace SongBrowserPlugin.UI
         /// Logic for fixing BeatSaber's level pack selection bugs.
         /// Logic for fixing BeatSaber's level pack selection bugs.
         /// 
         /// 
         /// </summary>
         /// </summary>
-        public void UpdateLevelPackSelection()
+        public bool UpdateLevelPackSelection()
         {
         {
             if (_levelPackViewController != null)
             if (_levelPackViewController != null)
             {
             {
@@ -1584,8 +1589,12 @@ namespace SongBrowserPlugin.UI
 
 
                     _levelPacksTableView.didSelectPackEvent += _levelPacksTableView_didSelectPackEvent;
                     _levelPacksTableView.didSelectPackEvent += _levelPacksTableView_didSelectPackEvent;
                     _levelPackViewController.didSelectPackEvent += _levelPackViewController_didSelectPackEvent;
                     _levelPackViewController.didSelectPackEvent += _levelPackViewController_didSelectPackEvent;
+
+                    return true;
                 }
                 }
             }
             }
+
+            return false;
         }
         }
 
 
         //Pull njs from a difficulty, based on private function from SongLoader
         //Pull njs from a difficulty, based on private function from SongLoader