From 863b323dc4d9201b34b7db4ca2defaea4f6bec63 Mon Sep 17 00:00:00 2001 From: CasperH Date: Thu, 4 Aug 2022 20:24:48 +0200 Subject: [PATCH] Small fix. --- HandheldCompanion/Views/Pages/ProfilesPage.xaml | 2 +- HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/HandheldCompanion/Views/Pages/ProfilesPage.xaml b/HandheldCompanion/Views/Pages/ProfilesPage.xaml index ec125d3f6..235b5ee3c 100644 --- a/HandheldCompanion/Views/Pages/ProfilesPage.xaml +++ b/HandheldCompanion/Views/Pages/ProfilesPage.xaml @@ -476,7 +476,7 @@ - + diff --git a/HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs b/HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs index 75d32dd3b..7e478f03d 100644 --- a/HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs +++ b/HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs @@ -466,17 +466,15 @@ private void b_ApplyProfile_Click(object sender, RoutedEventArgs e) currentProfile.umc_motion_defaultoffon = (UMC_Motion_Default)cB_UMC_MotionDefaultOffOn.SelectedIndex; currentProfile.umc_trigger = 0; + foreach (GamepadButtonFlagsExt button in (GamepadButtonFlagsExt[])Enum.GetValues(typeof(GamepadButtonFlagsExt))) + if ((bool)activators[button].IsChecked) + currentProfile.umc_trigger |= button; + // Power settings currentProfile.TDP_override = (bool)TDPToggle.IsOn; currentProfile.TDP_value[0] = (int)TDPSustainedSlider.Value; currentProfile.TDP_value[1] = (int)TDPBoostSlider.Value; - currentProfile.umc_trigger = 0; - - foreach (GamepadButtonFlagsExt button in (GamepadButtonFlagsExt[])Enum.GetValues(typeof(GamepadButtonFlagsExt))) - if ((bool)activators[button].IsChecked) - currentProfile.umc_trigger |= button; - MainWindow.profileManager.UpdateOrCreateProfile(currentProfile, false); MainWindow.profileManager.SerializeProfile(currentProfile); } @@ -561,7 +559,7 @@ private void cB_Input_SelectionChanged(object sender, SelectionChangedEventArgs private void cB_UMC_MotionDefaultOffOn_SelectionChanged(object sender, RoutedEventArgs e) { - if (cB_Input.SelectedIndex == -1) + if (cB_UMC_MotionDefaultOffOn.SelectedIndex == -1) return; }