save autodl setting
This commit is contained in:
parent
a271150b0c
commit
9eba20f28a
2 changed files with 14 additions and 0 deletions
|
@ -115,6 +115,12 @@ namespace EnvyUpdate
|
||||||
|
|
||||||
GlobalVars.isMobile = Util.IsMobile();
|
GlobalVars.isMobile = Util.IsMobile();
|
||||||
Debug.LogToFile("INFO Mobile: " + GlobalVars.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)
|
private void Window_StateChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -95,11 +95,19 @@ namespace EnvyUpdate
|
||||||
private void chkAutodl_Checked(object sender, RoutedEventArgs e)
|
private void chkAutodl_Checked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
GlobalVars.autoDownload = true;
|
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)
|
private void chkAutodl_Unchecked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
GlobalVars.autoDownload = false;
|
GlobalVars.autoDownload = false;
|
||||||
|
if (File.Exists(Path.Combine(GlobalVars.saveDirectory, "autodl.envy")))
|
||||||
|
{
|
||||||
|
File.Delete(Path.Combine(GlobalVars.saveDirectory, "autodl.envy"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue