Fix property instancing order issue

This commit is contained in:
Assistant 2020-06-21 18:52:55 -06:00
parent adaca10ddb
commit 9fefe75735
2 changed files with 18 additions and 17 deletions

View file

@ -34,7 +34,6 @@ namespace ModAssistant
{
// Set SecurityProtocol to prevent crash with TLS
System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
Languages.LoadLanguages();
if (ModAssistant.Properties.Settings.Default.UpgradeRequired)
{
@ -44,7 +43,11 @@ namespace ModAssistant
}
Version = Version.Substring(0, Version.Length - 2);
BeatSaberInstallDirectory = Utils.GetInstallDir();
Pages.Options options = Pages.Options.Instance;
options.InstallDirectory =
BeatSaberInstallDirectory = Utils.GetInstallDir();
Languages.LoadLanguages();
while (string.IsNullOrEmpty(App.BeatSaberInstallDirectory))
{
@ -61,12 +64,18 @@ namespace ModAssistant
}
}
BeatSaberInstallType = ModAssistant.Properties.Settings.Default.StoreType;
SaveModSelection = ModAssistant.Properties.Settings.Default.SaveSelected;
CheckInstalledMods = ModAssistant.Properties.Settings.Default.CheckInstalled;
SelectInstalledMods = ModAssistant.Properties.Settings.Default.SelectInstalled;
ReinstallInstalledMods = ModAssistant.Properties.Settings.Default.ReinstallInstalled;
CloseWindowOnFinish = ModAssistant.Properties.Settings.Default.CloseWindowOnFinish;
options.InstallType =
BeatSaberInstallType = ModAssistant.Properties.Settings.Default.StoreType;
options.SaveSelection =
SaveModSelection = ModAssistant.Properties.Settings.Default.SaveSelected;
options.CheckInstalledMods =
CheckInstalledMods = ModAssistant.Properties.Settings.Default.CheckInstalled;
options.SelectInstalledMods =
SelectInstalledMods = ModAssistant.Properties.Settings.Default.SelectInstalled;
options.ReinstallInstalledMods =
ReinstallInstalledMods = ModAssistant.Properties.Settings.Default.ReinstallInstalled;
options.CloseWindowOnFinish =
CloseWindowOnFinish = ModAssistant.Properties.Settings.Default.CloseWindowOnFinish;
await ArgumentHandler(e.Args);
await Init();

View file

@ -34,22 +34,14 @@ namespace ModAssistant.Pages
public Options()
{
InitializeComponent();
InstallDirectory = App.BeatSaberInstallDirectory;
InstallType = App.BeatSaberInstallType;
SaveSelection = App.SaveModSelection;
CheckInstalledMods = App.CheckInstalledMods;
SelectInstalledMods = App.SelectInstalledMods;
ReinstallInstalledMods = App.ReinstallInstalledMods;
CloseWindowOnFinish = App.CloseWindowOnFinish;
if (!CheckInstalledMods)
{
SelectInstalled.IsEnabled = false;
ReinstallInstalled.IsEnabled = false;
}
UpdateHandlerStatus();
this.DataContext = this;
}