mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-05-20 20:32:32 +12:00
Make reinstall functional
This commit is contained in:
parent
e69ab66062
commit
49e8c04441
|
@ -226,8 +226,8 @@
|
|||
Width="15"
|
||||
Height="40"
|
||||
HorizontalAlignment="Right" >
|
||||
<MenuItem Header="^" Height="40">
|
||||
<MenuItem Header="Reinstall All" Click="ReinstallAllButton_Click"/>
|
||||
<MenuItem Header="V" Height="40">
|
||||
<MenuItem Header="Reinstall and Update" Click="ReinstallAllButton_Click"/>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</StackPanel>
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace ModAssistant
|
|||
|
||||
private void InstallButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Mods.Instance.InstallMods();
|
||||
Mods.Instance.InstallMods(false);
|
||||
}
|
||||
|
||||
private void InfoButton_Click(object sender, RoutedEventArgs e)
|
||||
|
@ -322,7 +322,7 @@ namespace ModAssistant
|
|||
|
||||
private void ReinstallAllButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
Mods.Instance.InstallMods(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -309,7 +309,7 @@ namespace ModAssistant.Pages
|
|||
}
|
||||
}
|
||||
|
||||
public async void InstallMods()
|
||||
public async void InstallMods(bool reinstallInstalledMods)
|
||||
{
|
||||
MainWindow.Instance.InstallButton.IsEnabled = false;
|
||||
string installDirectory = App.BeatSaberInstallDirectory;
|
||||
|
@ -317,7 +317,10 @@ namespace ModAssistant.Pages
|
|||
foreach (Mod mod in ModsList)
|
||||
{
|
||||
// Ignore mods that are newer than installed version
|
||||
if (mod.ListItem.IsNewerVersionInstalled) continue;
|
||||
if (mod.ListItem.GetVersionComparison > 0) continue;
|
||||
|
||||
// Ignore mods that are on current version if we aren't reinstalling mods
|
||||
if (mod.ListItem.GetVersionComparison == 0 && !reinstallInstalledMods) continue;
|
||||
|
||||
if (mod.name.ToLower() == "bsipa")
|
||||
{
|
||||
|
@ -573,12 +576,13 @@ namespace ModAssistant.Pages
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsNewerVersionInstalled
|
||||
public int GetVersionComparison
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!IsInstalled) return false;
|
||||
return _installedVersion > ModVersion;
|
||||
if (!IsInstalled || _installedVersion < ModVersion) return -1;
|
||||
if (_installedVersion > ModVersion) return 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue