From e3600d2348640b8ecb911dbff83a6d2a2c7ac44d Mon Sep 17 00:00:00 2001 From: Parapass Date: Sat, 27 Apr 2024 18:19:36 -0400 Subject: [PATCH 1/4] Update OneClickInstaller.cs --- ModAssistant/Classes/OneClickInstaller.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ModAssistant/Classes/OneClickInstaller.cs b/ModAssistant/Classes/OneClickInstaller.cs index fedf195c..59d81bfe 100644 --- a/ModAssistant/Classes/OneClickInstaller.cs +++ b/ModAssistant/Classes/OneClickInstaller.cs @@ -12,7 +12,7 @@ namespace ModAssistant { class OneClickInstaller { - private static readonly string[] Protocols = new[] { "modelsaber", "beatsaver", "bsplaylist" }; + private static readonly string[] Protocols = new[] { "modelsaber", "beatsaver", "bsplaylist", "web+bsmap" }; public static OneClickStatus Status = new OneClickStatus(); public static async Task InstallAsset(string link) @@ -28,6 +28,9 @@ public static async Task InstallAsset(string link) case "beatsaver": await BeatSaver(uri); break; + case "web+bsmap": + await ScoreSaber(uri); + break; case "bsplaylist": await Playlist(uri); break; @@ -56,6 +59,12 @@ private static async Task BeatSaver(Uri uri) await API.BeatSaver.GetFromKey(Key); } + private static async Task ScoreSaber(Uri uri) + { + string Hash = uri.Host; + await API.BeatSaver.GetFromHash(Hash); + } + private static async Task ModelSaber(Uri uri) { if (App.OCIWindow != "No" && App.OCIWindow != "Notify") Status.Show(); From ce8ee5d47441d9c4b1c7ea5f72d8276056489cc9 Mon Sep 17 00:00:00 2001 From: Parapass Date: Sat, 27 Apr 2024 18:20:25 -0400 Subject: [PATCH 2/4] this is gonna look awful --- ModAssistant/Localisation/en.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/ModAssistant/Localisation/en.xaml b/ModAssistant/Localisation/en.xaml index 1065fa37..b21393e1 100644 --- a/ModAssistant/Localisation/en.xaml +++ b/ModAssistant/Localisation/en.xaml @@ -144,6 +144,7 @@ Reinstall Installed Mods Enable OneClick™ Installs BeatSaver + ScoreSaber ModelSaber Playlists Close window when finished From f93cfefd58e0639858e7f5e128821dd3ba0ec98b Mon Sep 17 00:00:00 2001 From: Parapass Date: Sat, 27 Apr 2024 18:21:26 -0400 Subject: [PATCH 3/4] score sbaer --- ModAssistant/Pages/Options.xaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ModAssistant/Pages/Options.xaml b/ModAssistant/Pages/Options.xaml index 431b14cf..53f024a8 100644 --- a/ModAssistant/Pages/Options.xaml +++ b/ModAssistant/Pages/Options.xaml @@ -196,6 +196,15 @@ Unchecked="BeatSaverProtocolHandler_Unchecked"/> + Date: Sat, 27 Apr 2024 18:22:42 -0400 Subject: [PATCH 4/4] barebones support done --- ModAssistant/Pages/Options.xaml.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ModAssistant/Pages/Options.xaml.cs b/ModAssistant/Pages/Options.xaml.cs index 1686d50c..9e573ab6 100644 --- a/ModAssistant/Pages/Options.xaml.cs +++ b/ModAssistant/Pages/Options.xaml.cs @@ -27,6 +27,7 @@ public partial class Options : Page public bool ReinstallInstalledMods { get; set; } public bool ModelSaberProtocolHandlerEnabled { get; set; } public bool BeatSaverProtocolHandlerEnabled { get; set; } + public bool ScoreSaberProtocolHandlerEnabled { get; set; } public bool PlaylistsProtocolHandlerEnabled { get; set; } public bool CloseWindowOnFinish { get; set; } public string LogURL { get; private set; } @@ -55,6 +56,7 @@ public void UpdateHandlerStatus() { ModelSaberProtocolHandlerEnabled = OneClickInstaller.IsRegistered("modelsaber"); BeatSaverProtocolHandlerEnabled = OneClickInstaller.IsRegistered("beatsaver"); + ScoreSaberProtocolHandlerEnabled = OneClickInstaller.IsRegistered("web+bsmap"); PlaylistsProtocolHandlerEnabled = OneClickInstaller.IsRegistered("bsplaylist"); } @@ -154,6 +156,17 @@ public void BeatSaverProtocolHandler_Unchecked(object sender, RoutedEventArgs e) { OneClickInstaller.Unregister("beatsaver"); } + + public void ScoreSaberProtocolHandler_Checked(object sender, RoutedEventArgs e) + { + OneClickInstaller.Register("web+bsmap", Description: "URL:web+bsmap OneClick Install"); + } + + public void ScoreSaberProtocolHandler_Unchecked(object sender, RoutedEventArgs e) + { + OneClickInstaller.Unregister("web+bsmap"); + } + public void PlaylistsProtocolHandler_Checked(object sender, RoutedEventArgs e) { OneClickInstaller.Register("bsplaylist", Description: "URL:BeatSaver Playlist OneClick Install");