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..a8d9e5c 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
@@ -106,6 +109,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 +125,9 @@
$(BeatSaberDir)\Beat Saber_Data\Managed\Oculus.VR.dll
+
+ $(BeatSaberDir)\Beat Saber_Data\Managed\SegmentedControl.dll
+
$(BeatSaberDir)\Plugins\SongCore.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 9a1e531..314b660 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() {
+ BeatSaberMarkupLanguage.Util.MainMenuAwaiter.MainMenuInitializing += MainMenuInit;
+ }
-
+ public void MainMenuInit() {
+ 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