diff --git a/PKHeX/MainWindow/Main.cs b/PKHeX/MainWindow/Main.cs index 86d626edd..d2fef7166 100644 --- a/PKHeX/MainWindow/Main.cs +++ b/PKHeX/MainWindow/Main.cs @@ -136,6 +136,7 @@ public Main() HaX = filename?.IndexOf("hax", StringComparison.Ordinal) >= 0; bool showChangelog = false; + bool BAKprompt = false; // Load User Settings { unicode = Menu_Unicode.Checked = Properties.Settings.Default.Unicode; @@ -157,6 +158,11 @@ public Main() showChangelog = lastrev < currrev; } + + // BAK Prompt + if (!Properties.Settings.Default.BAKPrompt) + BAKprompt = Properties.Settings.Default.BAKPrompt = true; + Properties.Settings.Default.Version = Properties.Resources.ProgramVersion; Properties.Settings.Default.Save(); } @@ -202,6 +208,10 @@ public Main() if (showChangelog) new About().ShowDialog(); + + if (BAKprompt && !Directory.Exists(BackupPath)) + promptBackup(); + #endregion } @@ -3043,10 +3053,14 @@ private void clickExportSAVBAK(object sender, EventArgs e) File.WriteAllBytes(path, SAV.BAK); Util.Alert("Saved Backup of current SAV to:", path); - if (Directory.Exists(BackupPath)) return; + if (!Directory.Exists(BackupPath)) + promptBackup(); + } + private static void promptBackup() + { if (DialogResult.Yes != Util.Prompt(MessageBoxButtons.YesNo, $"PKHeX can perform automatic backups if you create a folder with the name \"{BackupPath}\" in the same folder as PKHeX's executable.", - "Would you like to create the backup folder now and save backup of current save?")) return; + "Would you like to create the backup folder now?")) return; try { Directory.CreateDirectory(BackupPath); Util.Alert("Backup folder created!", $"If you wish to no longer automatically back up save files, delete the \"{BackupPath}\" folder."); } diff --git a/PKHeX/Properties/Settings.Designer.cs b/PKHeX/Properties/Settings.Designer.cs index 3364bdbf3..a5a21a7d0 100644 --- a/PKHeX/Properties/Settings.Designer.cs +++ b/PKHeX/Properties/Settings.Designer.cs @@ -82,5 +82,17 @@ internal sealed partial class Settings : global::System.Configuration.Applicatio this["SetUpdatePKM"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool BAKPrompt { + get { + return ((bool)(this["BAKPrompt"])); + } + set { + this["BAKPrompt"] = value; + } + } } } diff --git a/PKHeX/Properties/Settings.settings b/PKHeX/Properties/Settings.settings index 7a3cc02f5..38243d2b7 100644 --- a/PKHeX/Properties/Settings.settings +++ b/PKHeX/Properties/Settings.settings @@ -17,5 +17,8 @@ True + + False + \ No newline at end of file diff --git a/PKHeX/app.config b/PKHeX/app.config index 11ccf9c44..2cbe3b372 100644 --- a/PKHeX/app.config +++ b/PKHeX/app.config @@ -25,6 +25,9 @@ True + + False +