From 5e8ac004c713dcbb2bd527cc8ea90b723484556a Mon Sep 17 00:00:00 2001 From: F K <54195004+fredjk-gh@users.noreply.github.com> Date: Wed, 24 Jan 2024 08:51:46 -0500 Subject: [PATCH] [Core] Fix: Convert Decimal control values to int32 for Int settings (#134) Attempting to set decimal values to int properties tends to throw errors. ;-) --- ObservatoryCore/UI/SettingsForm.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ObservatoryCore/UI/SettingsForm.cs b/ObservatoryCore/UI/SettingsForm.cs index f05f38c..c13f5ac 100644 --- a/ObservatoryCore/UI/SettingsForm.cs +++ b/ObservatoryCore/UI/SettingsForm.cs @@ -246,7 +246,7 @@ namespace Observatory.UI trackBar.ValueChanged += (sender, e) => { - setting.SetValue(_plugin.Settings, trackBar.Value); + setting.SetValue(_plugin.Settings, Convert.ToInt32(trackBar.Value)); SaveSettings(); }; @@ -268,7 +268,7 @@ namespace Observatory.UI numericUpDown.ValueChanged += (sender, e) => { - setting.SetValue(_plugin.Settings, numericUpDown.Value); + setting.SetValue(_plugin.Settings, Convert.ToInt32(numericUpDown.Value)); SaveSettings(); };