From f921414d3d1b1bae2d34bc7fa5d20c47a2829db8 Mon Sep 17 00:00:00 2001 From: Sparronator9999 <86388887+Sparronator9999@users.noreply.github.com> Date: Sun, 5 Jan 2025 20:53:17 +1100 Subject: [PATCH] Fix charge limit "Enabled" check box not having any effect when disabled --- YAMDCC.ConfigEditor/MainWindow.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/YAMDCC.ConfigEditor/MainWindow.cs b/YAMDCC.ConfigEditor/MainWindow.cs index f9112f4..0037824 100644 --- a/YAMDCC.ConfigEditor/MainWindow.cs +++ b/YAMDCC.ConfigEditor/MainWindow.cs @@ -351,6 +351,8 @@ private void tsiSaveConf_Click(object sender, EventArgs e) if (sfd.ShowDialog() == DialogResult.OK) { + Config.ChargeLimitConf.CurVal = (byte)(chkChgLim.Checked + ? numChgLim.Value : 0); Config.Save(sfd.FileName); SetLastConfPath(sfd.FileName); btnRevert.Enabled = tsiRevert.Enabled = false; @@ -699,7 +701,6 @@ private void numChgLim_Changed(object sender, EventArgs e) { if (Config is not null) { - Config.ChargeLimitConf.CurVal = (byte)numChgLim.Value; btnRevert.Enabled = tsiRevert.Enabled = true; } } @@ -895,6 +896,8 @@ private void LoadConf(YAMDCC_Config config) private void ApplyConf() { // Save the updated config + Config.ChargeLimitConf.CurVal = (byte)(chkChgLim.Checked + ? numChgLim.Value : 0); Config.Save(Paths.CurrentConfig); // Tell the service to reload and apply the updated config