From ad4c80576f468374f50f36923744505e1b4e6078 Mon Sep 17 00:00:00 2001 From: chihirobelmo Date: Fri, 21 Mar 2025 00:41:02 +0900 Subject: [PATCH 1/4] quick fix for a non neutral cursor x/y display --- .../Windows/AxisAssignWindow.xaml.cs | 43 +- .../Windows/MainWindow.xaml | 1098 +++++++++-------- .../Windows/MainWindowAxisAssign.cs | 54 +- 3 files changed, 618 insertions(+), 577 deletions(-) diff --git a/Falcon BMS Alternative Launcher/Windows/AxisAssignWindow.xaml.cs b/Falcon BMS Alternative Launcher/Windows/AxisAssignWindow.xaml.cs index e7fc83c..95778bf 100644 --- a/Falcon BMS Alternative Launcher/Windows/AxisAssignWindow.xaml.cs +++ b/Falcon BMS Alternative Launcher/Windows/AxisAssignWindow.xaml.cs @@ -326,21 +326,40 @@ private void ShowAxisStatus() + ((AxisNumName)phyAxNumTmp).ToString().Replace('_', ' ') + " : " + MainWindow.deviceControl.GetJoystickMappings()[devNumTmp].GetSanitizedProductName(); - if (whoCalledWindow != AxisName.Throttle.ToString() & whoCalledWindow != AxisName.Throttle_Right.ToString()) - return; - AxisValueProgress.Foreground = CommonConstants.LIGHTBLUE; - check_ABIDLE.Visibility = Visibility.Hidden; - if ( (Invert.IsChecked == false && CommonConstants.AXISMAX + AxisValueProgress.Value < IDLE) || (Invert.IsChecked == true && CommonConstants.AXISMIN + AxisValueProgress.Value < IDLE)) + + if (whoCalledWindow == AxisName.Cursor_X.ToString() | whoCalledWindow == AxisName.Cursor_Y.ToString()) { - AxisValueProgress.Foreground = CommonConstants.LIGHTRED; - check_ABIDLE.Visibility = Visibility.Visible; - check_ABIDLE.Content = "IDLE CUTOFF"; + if (Math.Abs(AxisValueProgress.Value) < CommonConstants.AXISMAX * 0.499 | CommonConstants.AXISMAX * 0.501 < Math.Abs(AxisValueProgress.Value)) + { + AxisValueProgress.Foreground = CommonConstants.LIGHTRED; + check_ABIDLE.Visibility = Visibility.Visible; + check_ABIDLE.Content = "NOT NEUTRAL"; + } + else + { + AxisValueProgress.Foreground = CommonConstants.LIGHTBLUE; + check_ABIDLE.Visibility = Visibility.Hidden; + check_ABIDLE.Content = "NOT NEUTRAL"; + } } - if ( (Invert.IsChecked == false && CommonConstants.AXISMAX + AxisValueProgress.Value > AB) || (Invert.IsChecked == true && CommonConstants.AXISMIN + AxisValueProgress.Value > AB) ) + + if (whoCalledWindow == AxisName.Throttle.ToString() | whoCalledWindow == AxisName.Throttle_Right.ToString()) { - AxisValueProgress.Foreground = CommonConstants.LIGHTGREEN; - check_ABIDLE.Visibility = Visibility.Visible; - check_ABIDLE.Content = "AB"; + AxisValueProgress.Foreground = CommonConstants.LIGHTBLUE; + check_ABIDLE.Visibility = Visibility.Hidden; + + if ((Invert.IsChecked == false && CommonConstants.AXISMAX + AxisValueProgress.Value < IDLE) || (Invert.IsChecked == true && CommonConstants.AXISMIN + AxisValueProgress.Value < IDLE)) + { + AxisValueProgress.Foreground = CommonConstants.LIGHTRED; + check_ABIDLE.Visibility = Visibility.Visible; + check_ABIDLE.Content = "IDLE CUTOFF"; + } + if ((Invert.IsChecked == false && CommonConstants.AXISMAX + AxisValueProgress.Value > AB) || (Invert.IsChecked == true && CommonConstants.AXISMIN + AxisValueProgress.Value > AB)) + { + AxisValueProgress.Foreground = CommonConstants.LIGHTGREEN; + check_ABIDLE.Visibility = Visibility.Visible; + check_ABIDLE.Content = "AB"; + } } } diff --git a/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml b/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml index e8b067a..28e110d 100644 --- a/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml +++ b/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml @@ -9,514 +9,516 @@ Title="FalconBMS Alternative Launcher" Height="768" Width="1024" MinHeight="768" MinWidth="1024" BorderThickness="0" Closed="Window_Closed" MouseDown="MetroWindow_MouseDown" FontSize="12" WindowStartupLocation="CenterScreen" ShowTitleBar="False" WindowStyle="None" Background="#a4a9ac" OverrideDefaultWindowCommandsBrush="#a4a9ac"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +