From 25642779383a7d9a1cc29a0167f7abba7e52920d Mon Sep 17 00:00:00 2001 From: Loloppe Date: Mon, 9 Sep 2024 15:44:10 -0400 Subject: [PATCH 1/3] 1.37.5 --- .gitignore | 1 + BetterSongSearch.csproj | 12 ++++++++++++ Plugin.cs | 11 +++++------ UI/CustomLists/DownloadList.cs | 2 +- UI/CustomLists/SongList.cs | 2 +- UI/DownloadHistoryView.cs | 4 ++-- UI/FilterView.cs | 6 +++--- UI/Manager.cs | 2 +- UI/SongListController.cs | 4 ++-- UI/Views/SplitViews/PlaylistCreation.cs | 2 +- UI/Views/SplitViews/Presets.cs | 10 +++++----- Util/BSMLStuff.cs | 2 +- manifest.json | 3 ++- 13 files changed, 37 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index b46e503..e6316ed 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ obj/* HarmonyPatches/RemoveSplashscreen.cs HarmonyPatchHelper.cs Screenshots/SocialPreview.jpg +/.vs diff --git a/BetterSongSearch.csproj b/BetterSongSearch.csproj index 4addaaf..0eb7508 100644 --- a/BetterSongSearch.csproj +++ b/BetterSongSearch.csproj @@ -83,6 +83,9 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\BeatmapCore.dll + + $(BeatSaberDir)\Beat Saber_Data\Managed\BeatSaber.ViewSystem.dll + $(BeatSaberDir)\Libs\BeatSaberPlaylistsLib.dll @@ -97,6 +100,9 @@ $(BeatSaberDir)\Plugins\BSML.dll + + $(BeatSaberDir)\Plugins\BS_Utils.dll + $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll @@ -106,6 +112,9 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\HMUI.dll + + $(BeatSaberDir)\Beat Saber_Data\Managed\Interactable.dll + $(BeatSaberDir)\Beat Saber_Data\Managed\IPA.Loader.dll @@ -119,6 +128,9 @@ $(BeatSaberDir)\Beat Saber_Data\Managed\Oculus.VR.dll + + $(BeatSaberDir)\Beat Saber_Data\Managed\SegmentedControl.dll + $(BeatSaberDir)\Plugins\SongCore.dll diff --git a/Plugin.cs b/Plugin.cs index 9a1e531..87363cb 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -21,18 +21,17 @@ public void Init(IPALogger logger, Config conf) { Log = logger; Log.Info("BetterSongSearch initialized."); Settings.cfgInstance = PluginConfig.Instance = conf.Generated(); - - UI.Manager.Init(); - - SharedCoroutineStarter.Init(); - new Harmony("Kinsi55.BeatSaber.BetterSongSearch").PatchAll(Assembly.GetExecutingAssembly()); } [OnStart] public void OnApplicationStart() { + BS_Utils.Utilities.BSEvents.lateMenuSceneLoadedFresh += LateMenuSceneLoadedFresh; + } - + public void LateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO scene) { + UI.Manager.Init(); + SharedCoroutineStarter.Init(); } [OnExit] diff --git a/UI/CustomLists/DownloadList.cs b/UI/CustomLists/DownloadList.cs index a0c81d2..c6e2a15 100644 --- a/UI/CustomLists/DownloadList.cs +++ b/UI/CustomLists/DownloadList.cs @@ -19,7 +19,7 @@ public static CustomDownloadListTableCell GetCell(TableView tableView) { tableCell.interactable = true; tableCell.reuseIdentifier = ReuseIdentifier; - BSMLParser.instance.Parse( + BSMLParser.Instance.Parse( Utilities.GetResourceContent(Assembly.GetExecutingAssembly(), "BetterSongSearch.UI.CustomLists.DownloadListCell.bsml"), tableCell.gameObject, tableCell ); diff --git a/UI/CustomLists/SongList.cs b/UI/CustomLists/SongList.cs index 3dfa590..4e94a4d 100644 --- a/UI/CustomLists/SongList.cs +++ b/UI/CustomLists/SongList.cs @@ -18,7 +18,7 @@ public static CustomSongListTableCell GetCell(TableView tableView) { tableCell.interactable = true; tableCell.reuseIdentifier = ReuseIdentifier; - BSMLParser.instance.Parse( + BSMLParser.Instance.Parse( Utilities.GetResourceContent(Assembly.GetExecutingAssembly(), "BetterSongSearch.UI.CustomLists.SongListCell.bsml"), tableCell.gameObject, tableCell ); diff --git a/UI/DownloadHistoryView.cs b/UI/DownloadHistoryView.cs index e71b8de..7d35c56 100644 --- a/UI/DownloadHistoryView.cs +++ b/UI/DownloadHistoryView.cs @@ -18,7 +18,7 @@ namespace BetterSongSearch.UI { class DownloadHistoryView : BSMLAutomaticViewController, TableView.IDataSource { [UIComponent("scrollBarContainer")] private VerticalLayoutGroup _scrollBarContainer = null; [UIComponent("downloadList")] CustomListTableData downloadHistoryData = null; - TableView downloadHistoryTable => downloadHistoryData?.tableView; + TableView downloadHistoryTable => downloadHistoryData?.TableView; public readonly List downloadList = new List(); DownloadHistoryEntry[] downloadListSorted = null; @@ -156,7 +156,7 @@ void Parsed() { BSMLStuff.GetScrollbarForTable(downloadHistoryData.gameObject, _scrollBarContainer.transform); } - public float CellSize() => 8.05f; + public float CellSize(int idx) => 8.05f; public int NumberOfCells() => downloadList?.Count ?? 0; public TableCell CellForIdx(TableView tableView, int idx) => DownloadListTableData.GetCell(tableView).PopulateWithSongData(downloadListSorted[idx]); diff --git a/UI/FilterView.cs b/UI/FilterView.cs index 3e4ddcc..d616604 100644 --- a/UI/FilterView.cs +++ b/UI/FilterView.cs @@ -43,7 +43,7 @@ static List BuildList() { [UIAction("#post-parse")] void Parsed() { - currentFilter.hideOlderThanSlider.slider.maxValue = hideOlderThanOptions.Count - 1; + currentFilter.hideOlderThanSlider.Slider.maxValue = hideOlderThanOptions.Count - 1; ((RectTransform)gameObject.transform).offsetMax = new Vector2(20, 22); @@ -51,7 +51,7 @@ void Parsed() { // I hate BSML some times var m = GetComponentsInChildren() - .Where(x => x.associatedValue.MemberName == "mods") + .Where(x => x.AssociatedValue.MemberName == "mods") .First() .GetComponent() ._modalView; @@ -87,7 +87,7 @@ internal void SetFilter(FilterOptions filter = null) { * Seems like there is SOMETHING broken with how input changes are handled, something to do * with nested coroutines or whatever. I have no idea. For now I spent enough time trying to fix this */ - currentFilter.hideOlderThanSlider.onChange.Invoke(currentFilter.hideOlderThanSlider.Value); + currentFilter.hideOlderThanSlider.OnChange.Invoke(currentFilter.hideOlderThanSlider.Value); } BSMLParserParams presetsViewParams = null; diff --git a/UI/Manager.cs b/UI/Manager.cs index fc0a46d..8e8520b 100644 --- a/UI/Manager.cs +++ b/UI/Manager.cs @@ -7,7 +7,7 @@ namespace BetterSongSearch.UI { static class Manager { public static void Init() { - MenuButtons.instance.RegisterButton(new MenuButton("Better Song Search", "Search songs, but better", ShowFlow, true)); + MenuButtons.Instance.RegisterButton(new MenuButton("Better Song Search", "Search songs, but better", ShowFlow, true)); } internal static FlowCoordinator _parentFlow { get; private set; } diff --git a/UI/SongListController.cs b/UI/SongListController.cs index 385a2d8..afd8508 100644 --- a/UI/SongListController.cs +++ b/UI/SongListController.cs @@ -113,7 +113,7 @@ void Awake() { [UIAction("SelectSong")] void _SelectSong(TableView _, int row) => selectedSongView.SetSelectedSong(searchedSongsList[row]); [UIComponent("songList")] public CustomListTableData songListData = null; - public TableView songList => songListData?.tableView; + public TableView songList => songListData?.TableView; [UIComponent("searchBoxContainer")] private VerticalLayoutGroup _searchBoxContainer = null; [UIComponent("scrollBarContainer")] private VerticalLayoutGroup _scrollBarContainer = null; @@ -166,7 +166,7 @@ void Parsed() { Task.Run(_UpdateSearchedSongsList); } - public float CellSize() => PluginConfig.Instance.smallerFontSize ? 11.66f : 14f; + public float CellSize(int idx) => PluginConfig.Instance.smallerFontSize ? 11.66f : 14f; public int NumberOfCells() => searchedSongsList?.Count ?? 0; public TableCell CellForIdx(TableView tableView, int idx) => SongListTableData.GetCell(tableView).PopulateWithSongData(searchedSongsList[idx]); diff --git a/UI/Views/SplitViews/PlaylistCreation.cs b/UI/Views/SplitViews/PlaylistCreation.cs index cf910b7..816b016 100644 --- a/UI/Views/SplitViews/PlaylistCreation.cs +++ b/UI/Views/SplitViews/PlaylistCreation.cs @@ -22,7 +22,7 @@ class PlaylistCreation { [UIAction("#post-parse")] void Parsed() { - playlistName.modalKeyboard.modalView._animateParentCanvas = false; + playlistName.ModalKeyboard.ModalView._animateParentCanvas = false; } internal static string nameToUseOnNextOpen = "h"; diff --git a/UI/Views/SplitViews/Presets.cs b/UI/Views/SplitViews/Presets.cs index 4280144..36beab3 100644 --- a/UI/Views/SplitViews/Presets.cs +++ b/UI/Views/SplitViews/Presets.cs @@ -34,10 +34,10 @@ public void Refresh(bool selected, bool highlighted) { void Parsed() { FilterPresets.Init(); - BSMLStuff.GetScrollbarForTable(presetList.tableView.gameObject, _presetScrollbarContainer.transform); + BSMLStuff.GetScrollbarForTable(presetList.TableView.gameObject, _presetScrollbarContainer.transform); // BSML / HMUI my beloved - newPresetName.modalKeyboard.modalView._animateParentCanvas = false; + newPresetName.ModalKeyboard.ModalView._animateParentCanvas = false; } @@ -47,9 +47,9 @@ void Parsed() { [UIComponent("newPresetName")] readonly StringSetting newPresetName = null; [UIComponent("presetScrollbarContainer")] readonly VerticalLayoutGroup _presetScrollbarContainer = null; internal void ReloadPresets() { - presetList.data = FilterPresets.presets.Select(x => new FilterPresetRow(x.Key)).ToList(); - presetList.tableView.ReloadData(); - presetList.tableView.ClearSelection(); + presetList.Data = FilterPresets.presets.Select(x => new FilterPresetRow(x.Key)).ToList(); + presetList.TableView.ReloadData(); + presetList.TableView.ClearSelection(); loadButton.interactable = false; deleteButton.interactable = false; diff --git a/Util/BSMLStuff.cs b/Util/BSMLStuff.cs index 7e95d4a..5303595 100644 --- a/Util/BSMLStuff.cs +++ b/Util/BSMLStuff.cs @@ -64,7 +64,7 @@ public static BSMLParserParams InitSplitView(ref BSMLParserParams pparams, GameO if(viewName == null) viewName = host.GetType().Name; - return pparams = BSMLParser.instance.Parse(Utilities.GetResourceContent(Assembly.GetExecutingAssembly(), $"BetterSongSearch.UI.Views.SplitViews.{viewName}.bsml"), targetGameObject, host); + return pparams = BSMLParser.Instance.Parse(Utilities.GetResourceContent(Assembly.GetExecutingAssembly(), $"BetterSongSearch.UI.Views.SplitViews.{viewName}.bsml"), targetGameObject, host); } static GameObject scrollBar = null; diff --git a/manifest.json b/manifest.json index fc71ec4..bd8a81a 100644 --- a/manifest.json +++ b/manifest.json @@ -4,10 +4,11 @@ "author": "Kinsi55", "version": "0.7.87", "description": "Search and download songs with a lot of filtering and sorting options and without frustration!", - "gameVersion": "1.34.5", + "gameVersion": "1.37.5", "dependsOn": { "BSIPA": "^4.0.5", "BeatSaberMarkupLanguage": "^1.5.3", + "BS Utils": "^1.14.0", "SongDetailsCache": "^1.2.2", "SongCore": "^3.3.1" } From 6c13bb376c173b9bd0524d7f2ad050ccc525b1fe Mon Sep 17 00:00:00 2001 From: Loloppe Date: Mon, 9 Sep 2024 19:29:30 -0400 Subject: [PATCH 2/3] Use MainMenuAwaiter instead of BS_Utils. --- BetterSongSearch.csproj | 3 --- BetterSongSearch.sln | 25 +++++++++++++++++++++++++ Plugin.cs | 4 ++-- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 BetterSongSearch.sln diff --git a/BetterSongSearch.csproj b/BetterSongSearch.csproj index 0eb7508..a8d9e5c 100644 --- a/BetterSongSearch.csproj +++ b/BetterSongSearch.csproj @@ -100,9 +100,6 @@ $(BeatSaberDir)\Plugins\BSML.dll - - $(BeatSaberDir)\Plugins\BS_Utils.dll - $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll diff --git a/BetterSongSearch.sln b/BetterSongSearch.sln new file mode 100644 index 0000000..60c7591 --- /dev/null +++ b/BetterSongSearch.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35222.181 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BetterSongSearch", "BetterSongSearch.csproj", "{AC39B7E1-394D-4964-A575-9BE792B5C637}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AC39B7E1-394D-4964-A575-9BE792B5C637}.Debug|x64.ActiveCfg = Debug|x64 + {AC39B7E1-394D-4964-A575-9BE792B5C637}.Debug|x64.Build.0 = Debug|x64 + {AC39B7E1-394D-4964-A575-9BE792B5C637}.Release|x64.ActiveCfg = Release|x64 + {AC39B7E1-394D-4964-A575-9BE792B5C637}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FFDDFC11-9646-47E4-B711-3DBB17F9689B} + EndGlobalSection +EndGlobal diff --git a/Plugin.cs b/Plugin.cs index 87363cb..314b660 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -26,10 +26,10 @@ public void Init(IPALogger logger, Config conf) { [OnStart] public void OnApplicationStart() { - BS_Utils.Utilities.BSEvents.lateMenuSceneLoadedFresh += LateMenuSceneLoadedFresh; + BeatSaberMarkupLanguage.Util.MainMenuAwaiter.MainMenuInitializing += MainMenuInit; } - public void LateMenuSceneLoadedFresh(ScenesTransitionSetupDataSO scene) { + public void MainMenuInit() { UI.Manager.Init(); SharedCoroutineStarter.Init(); } From 323395723477a61a0341c8680c2f73c17c4f8490 Mon Sep 17 00:00:00 2001 From: Loloppe Date: Fri, 27 Sep 2024 17:14:00 -0400 Subject: [PATCH 3/3] manifest update + version bump --- manifest.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index bd8a81a..f2eb20f 100644 --- a/manifest.json +++ b/manifest.json @@ -2,14 +2,14 @@ "id": "BetterSongSearch", "name": "BetterSongSearch", "author": "Kinsi55", - "version": "0.7.87", + "version": "0.7.88", "description": "Search and download songs with a lot of filtering and sorting options and without frustration!", - "gameVersion": "1.37.5", + "gameVersion": "1.37.4", "dependsOn": { - "BSIPA": "^4.0.5", - "BeatSaberMarkupLanguage": "^1.5.3", - "BS Utils": "^1.14.0", + "BSIPA": "^4.3.5", + "BeatSaberMarkupLanguage": "^1.12.0", + "BS Utils": "^1.14.1", "SongDetailsCache": "^1.2.2", - "SongCore": "^3.3.1" + "SongCore": "^3.14.13" } } \ No newline at end of file