Browse Source

Working with 0.11.2.
Version bump.

Stephen Damm 6 years ago
parent
commit
3c3b50ca75

+ 7 - 5
SongBrowserPlugin/DataAccess/SongBrowserModel.cs

@@ -290,10 +290,12 @@ namespace SongBrowserPlugin
             _log.Trace("UpdateSongInfos for Gameplay Mode {0}", gameplayMode);
             _log.Trace("UpdateSongInfos for Gameplay Mode {0}", gameplayMode);
 
 
             // Get the level collection from song loader
             // Get the level collection from song loader
-            SongLoaderPlugin.OverrideClasses.CustomLevelCollectionsForGameplayModes collections = SongLoaderPlugin.SongLoader.Instance.GetPrivateField<SongLoaderPlugin.OverrideClasses.CustomLevelCollectionsForGameplayModes>("_customLevelCollectionsForGameplayModes");
-            _gameplayModeCollection = collections.GetCollection(gameplayMode) as SongLoaderPlugin.OverrideClasses.CustomLevelCollectionSO;
-            _originalSongs = collections.GetLevels(gameplayMode).ToList();
+            LevelCollectionsForGameplayModes levelCollections = Resources.FindObjectsOfTypeAll<LevelCollectionsForGameplayModes>().FirstOrDefault();            
+            List<LevelCollectionsForGameplayModes.LevelCollectionForGameplayMode> levelCollectionsForGameModes = ReflectionUtil.GetPrivateField<LevelCollectionsForGameplayModes.LevelCollectionForGameplayMode[]>(levelCollections, "_collections").ToList();
+
+            _originalSongs = levelCollections.GetLevels(gameplayMode).ToList();
             _sortedSongs = _originalSongs;
             _sortedSongs = _originalSongs;
+
             _levelIdToCustomLevel = new Dictionary<string, SongLoaderPlugin.OverrideClasses.CustomLevel>();
             _levelIdToCustomLevel = new Dictionary<string, SongLoaderPlugin.OverrideClasses.CustomLevel>();
             foreach (var level in SongLoader.CustomLevels)
             foreach (var level in SongLoader.CustomLevels)
             {
             {
@@ -614,8 +616,8 @@ namespace SongBrowserPlugin
             List<String> playlistNameListOrdered = this.CurrentPlaylist.songs.Select(x => x.songName).Distinct().ToList();
             List<String> playlistNameListOrdered = this.CurrentPlaylist.songs.Select(x => x.songName).Distinct().ToList();
             Dictionary<String, int> songNameToIndex = playlistNameListOrdered.Select((val, index) => new { Index = index, Value = val }).ToDictionary(i => i.Value, i => i.Index);
             Dictionary<String, int> songNameToIndex = playlistNameListOrdered.Select((val, index) => new { Index = index, Value = val }).ToDictionary(i => i.Value, i => i.Index);
             HashSet<String> songNames = new HashSet<String>(playlistNameListOrdered);
             HashSet<String> songNames = new HashSet<String>(playlistNameListOrdered);
-            SongLoaderPlugin.OverrideClasses.CustomLevelCollectionsForGameplayModes collections = SongLoaderPlugin.SongLoader.Instance.GetPrivateField<SongLoaderPlugin.OverrideClasses.CustomLevelCollectionsForGameplayModes>("_customLevelCollectionsForGameplayModes");
-            List<StandardLevelSO> songList = collections.GetLevels(_currentGamePlayMode).Where(x => songNames.Contains(x.songName)).ToList();
+            LevelCollectionsForGameplayModes levelCollections = Resources.FindObjectsOfTypeAll<LevelCollectionsForGameplayModes>().FirstOrDefault();
+            List<StandardLevelSO> songList = levelCollections.GetLevels(_currentGamePlayMode).Where(x => songNames.Contains(x.songName)).ToList();
             _log.Debug("\tMatching songs found for playlist: {0}", songList.Count);
             _log.Debug("\tMatching songs found for playlist: {0}", songList.Count);
             _originalSongs = songList;
             _originalSongs = songList;
             _filteredSongs = songList
             _filteredSongs = songList

+ 1 - 1
SongBrowserPlugin/Plugin.cs

@@ -13,7 +13,7 @@ namespace SongBrowserPlugin
 
 
         public string Version
         public string Version
         {
         {
-            get { return "v2.2.6"; }
+            get { return "v2.2.7"; }
         }
         }
 
 
         public void OnApplicationStart()
         public void OnApplicationStart()

+ 1 - 1
SongBrowserPlugin/SongBrowserApplication.cs

@@ -134,7 +134,7 @@ namespace SongBrowserPlugin
         /// </summary>
         /// </summary>
         /// <param name="arg1"></param>
         /// <param name="arg1"></param>
         /// <param name="arg2"></param>
         /// <param name="arg2"></param>
-        private void HandleSoloModeSelectionViewControllerDidSelectMode(SoloModeSelectionViewController arg1, SoloModeSelectionViewController.SubMenuType arg2)
+        private void HandleSoloModeSelectionViewControllerDidSelectMode(SoloModeSelectionViewController arg1, SoloModeSelectionViewController.MenuType arg2)
         {
         {
             _log.Trace("HandleSoloModeSelectionViewControllerDidSelectMode() - GameplayMode={0}", arg2);
             _log.Trace("HandleSoloModeSelectionViewControllerDidSelectMode() - GameplayMode={0}", arg2);
             this._songBrowserUI.UpdateSongList();
             this._songBrowserUI.UpdateSongList();

+ 0 - 2
SongBrowserPlugin/SongBrowserPlugin.csproj

@@ -99,8 +99,6 @@
     </Reference>
     </Reference>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <Compile Include="BeatSaverApi\BeatSaverApi.cs" />
-    <Compile Include="BeatSaverApi\BeatSaverAPIResults.cs" />
     <Compile Include="DataAccess\Playlist.cs" />
     <Compile Include="DataAccess\Playlist.cs" />
     <Compile Include="DataAccess\PlaylistReader.cs" />
     <Compile Include="DataAccess\PlaylistReader.cs" />
     <Compile Include="DataAccess\PlaylistSong.cs" />
     <Compile Include="DataAccess\PlaylistSong.cs" />

+ 5 - 6
SongBrowserPlugin/UI/Keyboard/SearchKeyboardViewController.cs

@@ -32,8 +32,8 @@ namespace SongBrowserPlugin.UI
 
 
                 _searchKeyboard = _searchKeyboardGO.AddComponent<CustomUIKeyboard>();
                 _searchKeyboard = _searchKeyboardGO.AddComponent<CustomUIKeyboard>();
 
 
-                _searchKeyboard.uiKeyboardKeyEvent = delegate (char input) { _inputString += input; UpdateInputText(); };
-                _searchKeyboard.uiKeyboardDeleteEvent = delegate () { _inputString = _inputString.Substring(0, _inputString.Length - 1); UpdateInputText(); };
+                _searchKeyboard.uiKeyboardKeyEvent += delegate (char input) { _inputString += input; UpdateInputText(); };
+                _searchKeyboard.uiKeyboardDeleteEvent += delegate () { _inputString = _inputString.Substring(0, _inputString.Length - 1); UpdateInputText(); };
             }
             }
 
 
             if (_inputText == null)
             if (_inputText == null)
@@ -50,13 +50,12 @@ namespace SongBrowserPlugin.UI
 
 
             if (_searchButton == null)
             if (_searchButton == null)
             {
             {
-                _searchButton = UIBuilder.CreateUIButton(rectTransform, "ApplyButton");
+                _searchButton = UIBuilder.CreateUIButton(rectTransform, "SettingsButton");
                 UIBuilder.SetButtonText(ref _searchButton, "Search");
                 UIBuilder.SetButtonText(ref _searchButton, "Search");
                 (_searchButton.transform as RectTransform).sizeDelta = new Vector2(30f, 10f);
                 (_searchButton.transform as RectTransform).sizeDelta = new Vector2(30f, 10f);
-                (_searchButton.transform as RectTransform).anchoredPosition = new Vector2(-15f, 1.5f);
+                (_searchButton.transform as RectTransform).anchoredPosition = new Vector2(-65f, 1.5f);
                 _searchButton.onClick.RemoveAllListeners();
                 _searchButton.onClick.RemoveAllListeners();
-                _searchButton.onClick.AddListener(delegate ()
-                {
+                _searchButton.onClick.AddListener(delegate () {
                     searchButtonPressed?.Invoke(_inputString);
                     searchButtonPressed?.Invoke(_inputString);
                     DismissModalViewController(null, false);
                     DismissModalViewController(null, false);
                 });
                 });

+ 2 - 2
SongBrowserPlugin/UI/UIBuilder.cs

@@ -70,7 +70,7 @@ namespace SongBrowserPlugin.UI
         static public Button CreateUIButton(RectTransform parent, Button buttonTemplate)
         static public Button CreateUIButton(RectTransform parent, Button buttonTemplate)
         {
         {
             Button btn = UnityEngine.Object.Instantiate(buttonTemplate, parent, false);
             Button btn = UnityEngine.Object.Instantiate(buttonTemplate, parent, false);
-            UnityEngine.Object.DestroyImmediate(btn.GetComponent<GameEventOnUIButtonClick>());
+            UnityEngine.Object.DestroyImmediate(btn.GetComponent<SignalOnUIButtonClick>());
             btn.onClick = new Button.ButtonClickedEvent();
             btn.onClick = new Button.ButtonClickedEvent();
             btn.name = "CustomUIButton";
             btn.name = "CustomUIButton";
 
 
@@ -190,7 +190,7 @@ namespace SongBrowserPlugin.UI
         public static Button CreateBackButton(RectTransform parent)
         public static Button CreateBackButton(RectTransform parent)
         {
         {
             Button dismissButton = CreateUIButton(parent, "BackArrowButton");
             Button dismissButton = CreateUIButton(parent, "BackArrowButton");
-            UnityEngine.Object.DestroyImmediate(dismissButton.GetComponent<GameEventOnUIButtonClick>());
+            UnityEngine.Object.DestroyImmediate(dismissButton.GetComponent<SignalOnUIButtonClick>());
             dismissButton.onClick = new Button.ButtonClickedEvent();
             dismissButton.onClick = new Button.ButtonClickedEvent();
             dismissButton.name = "CustomUIButton";
             dismissButton.name = "CustomUIButton";