mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-05-21 21:03:44 +12:00
Removed support for ModSaber OneClick Installs
This commit is contained in:
parent
45f8dc8c95
commit
23ada3a799
|
@ -25,7 +25,7 @@ namespace ModAssistant
|
|||
private const string CustomPlatformsFolder = "CustomPlatforms";
|
||||
private const string CustomSongsFolder = "CustomSongs";
|
||||
|
||||
private static readonly string[] Protocols = new[] { "modelsaber", "beatsaver", "modsaber" };
|
||||
private static readonly string[] Protocols = new[] { "modelsaber", "beatsaver" };
|
||||
|
||||
public static void InstallAsset(string link)
|
||||
{
|
||||
|
@ -40,9 +40,6 @@ namespace ModAssistant
|
|||
case "beatsaver":
|
||||
BeatSaver(uri);
|
||||
break;
|
||||
case "modsaber":
|
||||
ModSaber(uri);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,36 +68,6 @@ namespace ModAssistant
|
|||
File.Delete(Path.Combine(BeatSaberPath, CustomSongsFolder, ID + ".zip"));
|
||||
}
|
||||
|
||||
private static void ModSaber(Uri uri)
|
||||
{
|
||||
switch (uri.Host)
|
||||
{
|
||||
case "song":
|
||||
string ID = uri.Segments.Last<string>();
|
||||
DownloadAsset(BeatSaverURLPrefix + ID, CustomSongsFolder, ID + ".zip");
|
||||
string directory = Path.Combine(BeatSaberPath, CustomSongsFolder, ID);
|
||||
|
||||
using (FileStream stream = new FileStream(directory + ".zip", FileMode.Open))
|
||||
{
|
||||
using (ZipArchive archive = new ZipArchive(stream))
|
||||
{
|
||||
foreach (ZipArchiveEntry file in archive.Entries)
|
||||
{
|
||||
string fileDirectory = Path.GetDirectoryName(Path.Combine(directory, file.FullName));
|
||||
if (!Directory.Exists(fileDirectory))
|
||||
Directory.CreateDirectory(fileDirectory);
|
||||
|
||||
if (!String.IsNullOrEmpty(file.Name))
|
||||
file.ExtractToFile(Path.Combine(directory, file.FullName), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File.Delete(Path.Combine(BeatSaberPath, CustomSongsFolder, ID + ".zip"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ModelSaber(Uri uri)
|
||||
{
|
||||
switch (uri.Host)
|
||||
|
|
|
@ -65,12 +65,6 @@
|
|||
<TextBlock Grid.Row="8" Margin="20,5,5,5" Text="BeatSaver" FontWeight="Bold" HorizontalAlignment="Left" FontSize="16" />
|
||||
<CheckBox Grid.Row="8" Grid.Column="1" Name="BeatSaverProtocolHandler" VerticalAlignment="Center" HorizontalAlignment="Left" IsChecked="{Binding BeatSaverProtocolHandlerEnabled}" Checked="BeatSaverProtocolHandler_Checked" Unchecked="BeatSaverProtocolHandler_Unchecked"/>
|
||||
|
||||
<TextBlock Grid.Row="9" Margin="20,5,5,5" Text="ModSaber" FontWeight="Bold" HorizontalAlignment="Left" FontSize="16" />
|
||||
<CheckBox Grid.Row="9" Grid.Column="1" Name="ModSaberProtocolHandler" VerticalAlignment="Center" HorizontalAlignment="Left" IsChecked="{Binding ModSaberProtocolHandlerEnabled}" Checked="ModSaberProtocolHandler_Checked" Unchecked="ModSaberProtocolHandler_Unchecked"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<StackPanel Grid.Row="12" Margin="5" Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Text="Game Type: " FontWeight="Bold" FontSize="16" />
|
||||
<TextBlock Text="{Binding InstallType}" FontSize="16"/>
|
||||
|
|
|
@ -124,16 +124,6 @@ namespace ModAssistant.Pages
|
|||
OneClickInstaller.Unregister("beatsaver");
|
||||
}
|
||||
|
||||
public void ModSaberProtocolHandler_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OneClickInstaller.Register("modsaber");
|
||||
}
|
||||
|
||||
public void ModSaberProtocolHandler_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OneClickInstaller.Unregister("modsaber");
|
||||
}
|
||||
|
||||
private void SelectInstalled_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.SelectInstalled = true;
|
||||
|
|
Loading…
Reference in a new issue