From bd7ffd33717aa463f66c763809b8ad925bd10d27 Mon Sep 17 00:00:00 2001 From: KIT! Date: Thu, 21 Mar 2024 12:34:20 +0100 Subject: [PATCH] Remember state of UseEncryption box DirSelector_PathChanged was called two times on app startup. We now also clear individual paths when a given file isn't found in the datatable folder. --- MainForm.RequestFiles.cs | 1 + MainForm.cs | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/MainForm.RequestFiles.cs b/MainForm.RequestFiles.cs index c2781a4..9abeddd 100644 --- a/MainForm.RequestFiles.cs +++ b/MainForm.RequestFiles.cs @@ -56,6 +56,7 @@ namespace TaikoSoundEditor if (!File.Exists(path)) { NotFoundFiles.Add(files[i]); + sels[i].Path = ""; continue; } sels[i].Path = path; diff --git a/MainForm.cs b/MainForm.cs index 6024328..0030ee9 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -22,13 +22,11 @@ namespace TaikoSoundEditor DirSelector.PathChanged += DirSelector_PathChanged; UseEncryptionBox.Checked = Config.UseEncryption; + UseEncryptionBox_CheckedChanged(null, null); // update state of the key two text boxes //If path is set for the datatable folder, update paths for all the files. - if (Config.DatatablesPath != "") - { - DirSelector.Path = Config.DatatablesPath; - DirSelector_PathChanged(null, null); - } + if (Config.DatatablesPath != "") DirSelector.Path = Config.DatatablesPath; + DatatableKeyBox.Text = Config.DatatableKey; FumenKeyBox.Text = Config.FumenKey; @@ -444,6 +442,11 @@ namespace TaikoSoundEditor } } - private void UseEncryptionBox_CheckedChanged(object sender, EventArgs e) => Config.UseEncryption = UseEncryptionBox.Checked; + private void UseEncryptionBox_CheckedChanged(object sender, EventArgs e) + { + Config.UseEncryption = UseEncryptionBox.Checked; + FumenKeyBox.Enabled = UseEncryptionBox.Checked; + DatatableKeyBox.Enabled = UseEncryptionBox.Checked; + } } } \ No newline at end of file