Status bar should sync with per-game setting window
This commit is contained in:
parent
75257de2fb
commit
f7010212ef
2 changed files with 15 additions and 4 deletions
|
@ -557,6 +557,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
{
|
||||
_volume = value;
|
||||
|
||||
ConfigurationState config = ConfigurationState.Instance(SelectedApplication != null);
|
||||
config.System.AudioVolume.Value = value;
|
||||
|
||||
if (_isGameRunning)
|
||||
{
|
||||
AppHost.Device.SetVolume(_volume);
|
||||
|
@ -1324,7 +1327,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
|
||||
public void SetAspectRatio(AspectRatio aspectRatio)
|
||||
{
|
||||
ConfigurationState.Shared.Graphics.AspectRatio.Value = aspectRatio;
|
||||
ConfigurationState.Instance(SelectedApplication != null).Graphics.AspectRatio.Value = aspectRatio;
|
||||
}
|
||||
|
||||
public async Task InstallFirmwareFromFile()
|
||||
|
|
|
@ -33,20 +33,24 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||
|
||||
private void VsyncStatus_PointerReleased(object sender, PointerReleasedEventArgs e)
|
||||
{
|
||||
ConfigurationState config = ConfigurationState.Instance(Window.ViewModel.SelectedApplication != null);
|
||||
Window.ViewModel.AppHost.ToggleVSync();
|
||||
config.Graphics.EnableVsync.Value = Window.ViewModel.AppHost.Device.EnableDeviceVsync;
|
||||
|
||||
Logger.Info?.Print(LogClass.Application, $"VSync toggled to: {Window.ViewModel.AppHost.Device.EnableDeviceVsync}");
|
||||
}
|
||||
|
||||
private void DockedStatus_PointerReleased(object sender, PointerReleasedEventArgs e)
|
||||
{
|
||||
ConfigurationState.Shared.System.EnableDockedMode.Value = !ConfigurationState.Shared.System.EnableDockedMode.Value;
|
||||
ConfigurationState config = ConfigurationState.Instance(Window.ViewModel.SelectedApplication != null);
|
||||
config.System.EnableDockedMode.Value = !config.System.EnableDockedMode.Value;
|
||||
}
|
||||
|
||||
private void AspectRatioStatus_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AspectRatio aspectRatio = ConfigurationState.Shared.Graphics.AspectRatio.Value;
|
||||
ConfigurationState.Shared.Graphics.AspectRatio.Value = (int)aspectRatio + 1 > Enum.GetNames(typeof(AspectRatio)).Length - 1 ? AspectRatio.Fixed4x3 : aspectRatio + 1;
|
||||
ConfigurationState config = ConfigurationState.Instance(Window.ViewModel.SelectedApplication != null);
|
||||
AspectRatio aspectRatio = config.Graphics.AspectRatio.Value;
|
||||
config.Graphics.AspectRatio.Value = (int)aspectRatio + 1 > Enum.GetNames(typeof(AspectRatio)).Length - 1 ? AspectRatio.Fixed4x3 : aspectRatio + 1;
|
||||
}
|
||||
|
||||
private void Refresh_OnClick(object sender, RoutedEventArgs e)
|
||||
|
@ -56,6 +60,8 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||
|
||||
private void VolumeStatus_OnPointerWheelChanged(object sender, PointerWheelEventArgs e)
|
||||
{
|
||||
ConfigurationState config = ConfigurationState.Instance(Window.ViewModel.SelectedApplication != null);
|
||||
|
||||
// Change the volume by 5% at a time
|
||||
float newValue = Window.ViewModel.Volume + (float)e.Delta.Y * 0.05f;
|
||||
|
||||
|
@ -66,6 +72,8 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||
_ => newValue,
|
||||
};
|
||||
|
||||
config.System.AudioVolume.Value = Window.ViewModel.Volume;
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue