Skip to content

Commit

Permalink
[BUGFIX] Fix Launch Overlay on Startup resetting when leaving Overlay…
Browse files Browse the repository at this point in the history
… settings page.
  • Loading branch information
Soapwood committed Apr 11, 2024
1 parent fbaa23d commit 06b6315
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 76 deletions.
39 changes: 1 addition & 38 deletions VXMusicDesktop/MVVM/View/OverlayView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,43 +54,6 @@
<StackPanel Orientation="Vertical"
Margin="0,0,0,10">

<!-- <Border Width="300" -->
<!-- Height="60" -->
<!-- CornerRadius="10" -->
<!-- HorizontalAlignment="Left" -->
<!-- Margin="20,0,10,20"> -->
<!-- -->
<!-- <Border.Background> -->
<!-- <LinearGradientBrush x:Name="OverlayMenuOption1BoxBorderGradientBrush" StartPoint="0,0" EndPoint="1,2"> -->
<!-- <GradientStop Offset="0.0"> -->
<!-- <GradientStop.Color> -->
<!-- <Binding Source="{StaticResource SecondaryColor}" Converter="{StaticResource SolidColorBrushToColorConverter}"/> -->
<!-- </GradientStop.Color> -->
<!-- </GradientStop> -->
<!-- -->
<!-- <GradientStop Offset="0.5"> -->
<!-- <GradientStop.Color> -->
<!-- <Binding Source="{StaticResource Accent1Colour}" Converter="{StaticResource SolidColorBrushToColorConverter}"/> -->
<!-- </GradientStop.Color> -->
<!-- </GradientStop> -->
<!-- </LinearGradientBrush> -->
<!-- </Border.Background> -->
<!-- -->
<!-- <StackPanel Orientation="Horizontal"> -->
<!-- <TextBlock x:Name="LaunchOverlayTextBlock" -->
<!-- Text="Launch Overlay" -->
<!-- Foreground="{StaticResource TextBasic}" -->
<!-- FontSize="12" -->
<!-- Margin="20,0,20,0" -->
<!-- VerticalAlignment="Center"/> -->
<!-- <ToggleButton Style="{StaticResource SwitchButtonStyle}" -->
<!-- Width="80" Height="60" -->
<!-- Margin="78,0,0,0" -->
<!-- IsChecked="{Binding LaunchOverlayOnStartup}" -->
<!-- Checked="SetLaunchOverlayOnStartupEnabled" Unchecked="SetLaunchOverlayOnStartupDisabled" /> -->
<!-- </StackPanel> -->
<!-- </Border> -->

<Border Width="300"
Height="60"
CornerRadius="10"
Expand Down Expand Up @@ -125,7 +88,7 @@
Width="80" Height="60"
Margin="20,0,0,0"
IsChecked="{Binding LaunchOverlayOnStartup}"
Checked="SetLaunchOverlayOnStartupEnabled" Unchecked="SetLaunchOverlayOnStartupDisabled" />
Command="{Binding LaunchOverlayOnStartupToggleButton}" />
</StackPanel>
</Border>
</StackPanel>
Expand Down
15 changes: 0 additions & 15 deletions VXMusicDesktop/MVVM/View/OverlayView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,5 @@ private void OnThemeChanged(object sender, EventArgs e)
? ColourSchemeManager.SecondaryColour
: ColourSchemeManager.TextBasic;
}

private void SetLaunchOverlayOnStartupEnabled(object commandParameter, RoutedEventArgs routedEventArgs)
{
VXUserSettings.Overlay.SetLaunchOverlayOnStartup(true);
}

private void SetLaunchOverlayOnStartupDisabled(object commandParameter, RoutedEventArgs routedEventArgs)
{
VXUserSettings.Overlay.SetLaunchOverlayOnStartup(false);
}

private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
throw new NotImplementedException();
}
}
}
28 changes: 5 additions & 23 deletions VXMusicDesktop/MVVM/ViewModel/OverlayViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@ public class OverlayViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;


private RelayCommand launchOverlayOnStartupButtonChecked;
public ICommand LaunchOverlayOnStartupButtonChecked => launchOverlayOnStartupButtonChecked ??= new RelayCommand(SetLaunchOverlayOnStartupEnabled);
private RelayCommand launchOverlayOnStartupButtonUnchecked;
public ICommand LaunchOverlayOnStartupButtonUnhecked => launchOverlayOnStartupButtonUnchecked ??= new RelayCommand(SetLaunchOverlayOnStartupDisabled);
private RelayCommand launchOverlayOnStartupToggleButton;
public ICommand LaunchOverlayOnStartupToggleButton => launchOverlayOnStartupToggleButton ??= new RelayCommand(SetLaunchOverlayOnStartup);

private bool _launchOverlayOnStartup;

public OverlayViewModel()
{
_launchOverlayOnStartup = VXUserSettings.Overlay.GetCurrentOverlayLaunchOnStartup();
LaunchOverlayOnStartup = VXUserSettings.Overlay.GetCurrentOverlayLaunchOnStartup();
}

protected virtual void OnPropertyChanged(string propertyName)
Expand All @@ -45,24 +42,9 @@ public bool LaunchOverlayOnStartup
}
}

private void SetLaunchOverlayOnStartupEnabled(object commandParameter)
{
//App.VXMusicSession.SetNotificationService(NotificationService.SteamVR);
//NotificationSettings.SetNotificationServiceInSettings(NotificationService.SteamVR);
//ProcessNotificationServiceState();
//VXMusicSession.RaiseSteamVrNotificationEnabled();
//VXMusicSession.VXMusicOverlay.

}

private void SetLaunchOverlayOnStartupDisabled(object commandParameter)
public void SetLaunchOverlayOnStartup(object commandParameter)
{
//App.VXMusicSession.SetNotificationService(NotificationService.XSOverlay);
//NotificationSettings.SetNotificationServiceInSettings(NotificationService.XSOverlay);
//ProcessNotificationServiceState();
//VXMusicSession.RaiseXsOverlayNotificationEnabled();
//VXMusicSession.VXMusicOverlay.SetRightHandOverlayTrackedDevice();

VXUserSettings.Overlay.SetLaunchOverlayOnStartup(LaunchOverlayOnStartup);
}
}
}

0 comments on commit 06b6315

Please sign in to comment.