Feature autodownload #44
2 changed files with 14 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue