save autodl setting

This commit is contained in:
Jakob 2024-02-26 19:46:46 +01:00
parent a271150b0c
commit 9eba20f28a
2 changed files with 14 additions and 0 deletions

View file

@ -115,6 +115,12 @@ namespace EnvyUpdate
GlobalVars.isMobile = Util.IsMobile();
Debug.LogToFile("INFO Mobile: " + GlobalVars.isMobile);
if (File.Exists(Path.Combine(GlobalVars.saveDirectory, "autodl.envy")))
{
Debug.LogToFile("INFO Auto-download is enabled.");
GlobalVars.autoDownload = true;
}
}
private void Window_StateChanged(object sender, EventArgs e)
{

View file

@ -95,11 +95,19 @@ namespace EnvyUpdate
private void chkAutodl_Checked(object sender, RoutedEventArgs e)
{
GlobalVars.autoDownload = true;
if (!File.Exists(Path.Combine(GlobalVars.saveDirectory, "autodl.envy")))
{
File.Create(Path.Combine(GlobalVars.saveDirectory, "autodl.envy"));
}
}
private void chkAutodl_Unchecked(object sender, RoutedEventArgs e)
{
GlobalVars.autoDownload = false;
if (File.Exists(Path.Combine(GlobalVars.saveDirectory, "autodl.envy")))
{
File.Delete(Path.Combine(GlobalVars.saveDirectory, "autodl.envy"));
}
}
}
}