Skip to content

Commit

Permalink
Merge pull request #220 from CasperH2O/MotionActivationFix
Browse files Browse the repository at this point in the history
Small fix.
  • Loading branch information
CasperH2O authored Aug 4, 2022
2 parents 9a8cc1d + 863b323 commit 47f8c42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion HandheldCompanion/Views/Pages/ProfilesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
</StackPanel>

<DockPanel Grid.Column="1" Margin="12,0,0,0">
<ui:RadioButtons Name="cB_UMC_MotionDefaultOffOn" Grid.Column="1" HorizontalAlignment="Right" MaxColumns="1">
<ui:RadioButtons Name="cB_UMC_MotionDefaultOffOn" Grid.Column="1" HorizontalAlignment="Right" MaxColumns="1" SelectionChanged="cB_UMC_MotionDefaultOffOn_SelectionChanged">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="6">
<Label Content="{x:Static resx:Resources.ProfilesPage_UMCMotionOff}"></Label>
</ui:SimpleStackPanel>
Expand Down
12 changes: 5 additions & 7 deletions HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 47f8c42

Please sign in to comment.