diff --git a/DS4Windows/DS4Forms/ProfileEditor.xaml b/DS4Windows/DS4Forms/ProfileEditor.xaml index 73ba27b..d456a2c 100644 --- a/DS4Windows/DS4Forms/ProfileEditor.xaml +++ b/DS4Windows/DS4Forms/ProfileEditor.xaml @@ -601,83 +601,93 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + - diff --git a/DS4Windows/DS4Forms/ViewModels/ProfileSettingsViewModel.cs b/DS4Windows/DS4Forms/ViewModels/ProfileSettingsViewModel.cs index dd88b4e..65a6230 100644 --- a/DS4Windows/DS4Forms/ViewModels/ProfileSettingsViewModel.cs +++ b/DS4Windows/DS4Forms/ViewModels/ProfileSettingsViewModel.cs @@ -23,6 +23,58 @@ namespace DS4WinWPF.DS4Forms.ViewModels private ImageBrush lightbarImgBrush = new ImageBrush(); private SolidColorBrush lightbarColBrush = new SolidColorBrush(); + public int LightbarModeIndex + { + get + { + int index = 0; + switch(Global.LightbarSettingsInfo[device].Mode) + { + case LightbarMode.DS4Win: + index = 0; break; + case LightbarMode.Passthru: + index = 1; break; + default: break; + } + + return index; + } + set + { + LightbarMode temp = LightbarMode.DS4Win; + switch(value) + { + case 0: + temp = LightbarMode.DS4Win; break; + case 1: + temp = LightbarMode.Passthru; break; + default: break; + } + + Global.LightbarSettingsInfo[device].Mode = temp; + LightbarModeIndexChanged?.Invoke(this, EventArgs.Empty); + } + } + public event EventHandler LightbarModeIndexChanged; + + public Visibility DS4WinLightVisible + { + get + { + Visibility temp = Visibility.Visible; + switch(Global.LightbarSettingsInfo[device].Mode) + { + case LightbarMode.DS4Win: + temp = Visibility.Visible; break; + case LightbarMode.Passthru: + temp = Visibility.Collapsed; break; + } + + return temp; + } + } + public event EventHandler DS4WinLightVisibleChanged; + public System.Windows.Media.Brush LightbarBrush { get @@ -602,7 +654,6 @@ namespace DS4WinWPF.DS4Forms.ViewModels } } - public OutContType ContType { get => Global.OutContType[device]; @@ -1495,6 +1546,11 @@ namespace DS4WinWPF.DS4Forms.ViewModels { OutputMouseSpeed = CalculateOutputMouseSpeed(ButtonMouseSensitivity); }; + + LightbarModeIndexChanged += (sender, args) => + { + DS4WinLightVisibleChanged?.Invoke(this, EventArgs.Empty); + }; } private void ProfileSettingsViewModel_MainColorChanged(object sender, EventArgs e)