Add custom refresh rate mode to VSync option
This commit is contained in:
@@ -57,6 +57,8 @@ using Key = Ryujinx.Input.Key;
|
||||
using MouseButton = Ryujinx.Input.MouseButton;
|
||||
using ScalingFilter = Ryujinx.Common.Configuration.ScalingFilter;
|
||||
using Size = Avalonia.Size;
|
||||
using Switch = Ryujinx.HLE.Switch;
|
||||
using VSyncMode = Ryujinx.Common.Configuration.VSyncMode;
|
||||
|
||||
namespace Ryujinx.Ava
|
||||
{
|
||||
@@ -203,6 +205,9 @@ namespace Ryujinx.Ava
|
||||
ConfigurationState.Instance.Graphics.ScalingFilter.Event += UpdateScalingFilter;
|
||||
ConfigurationState.Instance.Graphics.ScalingFilterLevel.Event += UpdateScalingFilterLevel;
|
||||
ConfigurationState.Instance.Graphics.EnableColorSpacePassthrough.Event += UpdateColorSpacePassthrough;
|
||||
ConfigurationState.Instance.Graphics.VSyncMode.Event += UpdateVSyncMode;
|
||||
ConfigurationState.Instance.Graphics.CustomVSyncInterval.Event += UpdateCustomVSyncIntervalValue;
|
||||
ConfigurationState.Instance.Graphics.EnableCustomVSyncInterval.Event += UpdateCustomVSyncIntervalEnabled;
|
||||
|
||||
ConfigurationState.Instance.System.EnableInternetAccess.Event += UpdateEnableInternetAccessState;
|
||||
ConfigurationState.Instance.Multiplayer.LanInterfaceId.Event += UpdateLanInterfaceIdState;
|
||||
@@ -295,6 +300,66 @@ namespace Ryujinx.Ava
|
||||
_renderer.Window?.SetColorSpacePassthrough((bool)ConfigurationState.Instance.Graphics.EnableColorSpacePassthrough.Value);
|
||||
}
|
||||
|
||||
public void UpdateVSyncMode(object sender, ReactiveEventArgs<VSyncMode> e)
|
||||
{
|
||||
if (Device != null)
|
||||
{
|
||||
Device.VSyncMode = e.NewValue;
|
||||
Device.UpdateVSyncInterval();
|
||||
}
|
||||
_renderer.Window?.ChangeVSyncMode((Ryujinx.Graphics.GAL.VSyncMode)e.NewValue);
|
||||
|
||||
_viewModel.ShowCustomVSyncIntervalPicker = (e.NewValue == VSyncMode.Custom);
|
||||
}
|
||||
|
||||
public void VSyncModeToggle()
|
||||
{
|
||||
VSyncMode oldVSyncMode = Device.VSyncMode;
|
||||
VSyncMode newVSyncMode = VSyncMode.Switch;
|
||||
bool customVSyncIntervalEnabled = ConfigurationState.Instance.Graphics.EnableCustomVSyncInterval.Value;
|
||||
|
||||
switch (oldVSyncMode)
|
||||
{
|
||||
case VSyncMode.Switch:
|
||||
newVSyncMode = VSyncMode.Unbounded;
|
||||
break;
|
||||
case VSyncMode.Unbounded:
|
||||
if (customVSyncIntervalEnabled)
|
||||
{
|
||||
newVSyncMode = VSyncMode.Custom;
|
||||
}
|
||||
else
|
||||
{
|
||||
newVSyncMode = VSyncMode.Switch;
|
||||
}
|
||||
|
||||
break;
|
||||
case VSyncMode.Custom:
|
||||
newVSyncMode = VSyncMode.Switch;
|
||||
break;
|
||||
}
|
||||
|
||||
UpdateVSyncMode(this, new ReactiveEventArgs<VSyncMode>(oldVSyncMode, newVSyncMode));
|
||||
}
|
||||
|
||||
private void UpdateCustomVSyncIntervalValue(object sender, ReactiveEventArgs<int> e)
|
||||
{
|
||||
if (Device != null)
|
||||
{
|
||||
Device.TargetVSyncInterval = e.NewValue;
|
||||
Device.UpdateVSyncInterval();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateCustomVSyncIntervalEnabled(object sender, ReactiveEventArgs<bool> e)
|
||||
{
|
||||
if (Device != null)
|
||||
{
|
||||
Device.CustomVSyncIntervalEnabled = e.NewValue;
|
||||
Device.UpdateVSyncInterval();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowCursor()
|
||||
{
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
@@ -505,12 +570,6 @@ namespace Ryujinx.Ava
|
||||
Device.Configuration.MultiplayerDisableP2p = e.NewValue;
|
||||
}
|
||||
|
||||
public void ToggleVSync()
|
||||
{
|
||||
Device.EnableDeviceVsync = !Device.EnableDeviceVsync;
|
||||
_renderer.Window.ChangeVSyncMode(Device.EnableDeviceVsync);
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
_isActive = false;
|
||||
@@ -864,7 +923,7 @@ namespace Ryujinx.Ava
|
||||
_viewModel.UiHandler,
|
||||
(SystemLanguage)ConfigurationState.Instance.System.Language.Value,
|
||||
(RegionCode)ConfigurationState.Instance.System.Region.Value,
|
||||
ConfigurationState.Instance.Graphics.EnableVsync,
|
||||
ConfigurationState.Instance.Graphics.VSyncMode,
|
||||
ConfigurationState.Instance.System.EnableDockedMode,
|
||||
ConfigurationState.Instance.System.EnablePtc,
|
||||
ConfigurationState.Instance.System.EnableInternetAccess,
|
||||
@@ -881,7 +940,8 @@ namespace Ryujinx.Ava
|
||||
ConfigurationState.Instance.Multiplayer.Mode,
|
||||
ConfigurationState.Instance.Multiplayer.DisableP2p,
|
||||
ConfigurationState.Instance.Multiplayer.LdnPassphrase,
|
||||
ConfigurationState.Instance.Multiplayer.LdnServer));
|
||||
ConfigurationState.Instance.Multiplayer.LdnServer,
|
||||
ConfigurationState.Instance.Graphics.CustomVSyncInterval.Value));
|
||||
}
|
||||
|
||||
private static IHardwareDeviceDriver InitializeAudio()
|
||||
@@ -1002,7 +1062,7 @@ namespace Ryujinx.Ava
|
||||
Device.Gpu.SetGpuThread();
|
||||
Device.Gpu.InitializeShaderCache(_gpuCancellationTokenSource.Token);
|
||||
|
||||
_renderer.Window.ChangeVSyncMode(Device.EnableDeviceVsync);
|
||||
_renderer.Window.ChangeVSyncMode((Ryujinx.Graphics.GAL.VSyncMode)Device.VSyncMode);
|
||||
|
||||
while (_isActive)
|
||||
{
|
||||
@@ -1063,6 +1123,7 @@ namespace Ryujinx.Ava
|
||||
{
|
||||
// Run a status update only when a frame is to be drawn. This prevents from updating the ui and wasting a render when no frame is queued.
|
||||
string dockedMode = ConfigurationState.Instance.System.EnableDockedMode ? LocaleManager.Instance[LocaleKeys.Docked] : LocaleManager.Instance[LocaleKeys.Handheld];
|
||||
string vSyncMode = Device.VSyncMode.ToString();
|
||||
|
||||
UpdateShaderCount();
|
||||
|
||||
@@ -1072,7 +1133,7 @@ namespace Ryujinx.Ava
|
||||
}
|
||||
|
||||
StatusUpdatedEvent?.Invoke(this, new StatusUpdatedEventArgs(
|
||||
Device.EnableDeviceVsync,
|
||||
vSyncMode,
|
||||
LocaleManager.Instance[LocaleKeys.VolumeShort] + $": {(int)(Device.GetVolume() * 100)}%",
|
||||
dockedMode,
|
||||
ConfigurationState.Instance.Graphics.AspectRatio.Value.ToText(),
|
||||
@@ -1175,8 +1236,16 @@ namespace Ryujinx.Ava
|
||||
{
|
||||
switch (currentHotkeyState)
|
||||
{
|
||||
case KeyboardHotkeyState.ToggleVSync:
|
||||
ToggleVSync();
|
||||
case KeyboardHotkeyState.ToggleVSyncMode:
|
||||
VSyncModeToggle();
|
||||
break;
|
||||
case KeyboardHotkeyState.CustomVSyncIntervalDecrement:
|
||||
Device.DecrementCustomVSyncInterval();
|
||||
_viewModel.CustomVSyncInterval -= 1;
|
||||
break;
|
||||
case KeyboardHotkeyState.CustomVSyncIntervalIncrement:
|
||||
Device.IncrementCustomVSyncInterval();
|
||||
_viewModel.CustomVSyncInterval += 1;
|
||||
break;
|
||||
case KeyboardHotkeyState.Screenshot:
|
||||
ScreenshotRequested = true;
|
||||
@@ -1263,9 +1332,9 @@ namespace Ryujinx.Ava
|
||||
{
|
||||
KeyboardHotkeyState state = KeyboardHotkeyState.None;
|
||||
|
||||
if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ToggleVsync))
|
||||
if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ToggleVSyncMode))
|
||||
{
|
||||
state = KeyboardHotkeyState.ToggleVSync;
|
||||
state = KeyboardHotkeyState.ToggleVSyncMode;
|
||||
}
|
||||
else if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.Screenshot))
|
||||
{
|
||||
@@ -1299,6 +1368,14 @@ namespace Ryujinx.Ava
|
||||
{
|
||||
state = KeyboardHotkeyState.VolumeDown;
|
||||
}
|
||||
else if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.CustomVSyncIntervalIncrement))
|
||||
{
|
||||
state = KeyboardHotkeyState.CustomVSyncIntervalIncrement;
|
||||
}
|
||||
else if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.CustomVSyncIntervalDecrement))
|
||||
{
|
||||
state = KeyboardHotkeyState.CustomVSyncIntervalDecrement;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -142,9 +142,19 @@
|
||||
"SettingsTabSystemSystemLanguageLatinAmericanSpanish": "Latin American Spanish",
|
||||
"SettingsTabSystemSystemLanguageSimplifiedChinese": "Simplified Chinese",
|
||||
"SettingsTabSystemSystemLanguageTraditionalChinese": "Traditional Chinese",
|
||||
"SettingsTabSystemSystemTimeZone": "System TimeZone:",
|
||||
"SettingsTabSystemSystemTimeZone": "System Time Zone:",
|
||||
"SettingsTabSystemSystemTime": "System Time:",
|
||||
"SettingsTabSystemEnableVsync": "VSync",
|
||||
"SettingsTabSystemVSyncMode": "VSync:",
|
||||
"SettingsTabSystemEnableCustomVSyncInterval": "Enable custom refresh rate (Experimental)",
|
||||
"SettingsTabSystemVSyncModeSwitch": "Switch",
|
||||
"SettingsTabSystemVSyncModeUnbounded": "Unbounded",
|
||||
"SettingsTabSystemVSyncModeCustom": "Custom Refresh Rate",
|
||||
"SettingsTabSystemVSyncModeTooltip": "Emulated Vertical Sync. 'Switch' emulates the Switch's refresh rate of 60Hz. 'Unbounded' is an unbounded refresh rate.",
|
||||
"SettingsTabSystemVSyncModeTooltipCustom": "Emulated Vertical Sync. 'Switch' emulates the Switch's refresh rate of 60Hz. 'Unbounded' is an unbounded refresh rate. 'Custom' emulates the specified custom refresh rate.",
|
||||
"SettingsTabSystemEnableCustomVSyncIntervalTooltip": "Allows the user to specify an emulated refresh rate. In some titles, this may speed up or slow down the rate of gameplay logic. In other titles, it may allow for capping FPS at some multiple of the refresh rate, or lead to unpredictable behavior. This is an experimental feature, with no guarantees for how gameplay will be affected. \n\nLeave OFF if unsure.",
|
||||
"SettingsTabSystemCustomVSyncIntervalValueTooltip": "The custom refresh rate target value.",
|
||||
"SettingsTabSystemCustomVSyncIntervalSliderTooltip": "The custom refresh rate, as a percentage of the normal Switch refresh rate.",
|
||||
"SettingsTabSystemCustomVSyncIntervalValue": "Custom Refresh Rate Value:",
|
||||
"SettingsTabSystemEnablePptc": "PPTC (Profiled Persistent Translation Cache)",
|
||||
"SettingsTabSystemEnableLowPowerPptc": "Low-power PPTC cache",
|
||||
"SettingsTabSystemEnableFsIntegrityChecks": "FS Integrity Checks",
|
||||
@@ -153,6 +163,7 @@
|
||||
"SettingsTabSystemAudioBackendOpenAL": "OpenAL",
|
||||
"SettingsTabSystemAudioBackendSoundIO": "SoundIO",
|
||||
"SettingsTabSystemAudioBackendSDL2": "SDL2",
|
||||
"SettingsTabSystemCustomVSyncInterval": "Interval",
|
||||
"SettingsTabSystemHacks": "Hacks",
|
||||
"SettingsTabSystemHacksNote": "May cause instability",
|
||||
"SettingsTabSystemDramSize": "DRAM size:",
|
||||
@@ -720,11 +731,13 @@
|
||||
"RyujinxUpdater": "Ryujinx Updater",
|
||||
"SettingsTabHotkeys": "Keyboard Hotkeys",
|
||||
"SettingsTabHotkeysHotkeys": "Keyboard Hotkeys",
|
||||
"SettingsTabHotkeysToggleVsyncHotkey": "Toggle VSync:",
|
||||
"SettingsTabHotkeysToggleVSyncModeHotkey": "Toggle VSync mode:",
|
||||
"SettingsTabHotkeysScreenshotHotkey": "Screenshot:",
|
||||
"SettingsTabHotkeysShowUiHotkey": "Show UI:",
|
||||
"SettingsTabHotkeysPauseHotkey": "Pause:",
|
||||
"SettingsTabHotkeysToggleMuteHotkey": "Mute:",
|
||||
"SettingsTabHotkeysIncrementCustomVSyncIntervalHotkey": "Raise custom refresh rate",
|
||||
"SettingsTabHotkeysDecrementCustomVSyncIntervalHotkey": "Lower custom refresh rate",
|
||||
"ControllerMotionTitle": "Motion Control Settings",
|
||||
"ControllerRumbleTitle": "Rumble Settings",
|
||||
"SettingsSelectThemeFileDialogTitle": "Select Theme File",
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
<Color x:Key="AppListBackgroundColor">#b3ffffff</Color>
|
||||
<Color x:Key="AppListHoverBackgroundColor">#80cccccc</Color>
|
||||
<Color x:Key="SecondaryTextColor">#A0000000</Color>
|
||||
<Color x:Key="VsyncEnabled">#FF2EEAC9</Color>
|
||||
<Color x:Key="VsyncDisabled">#FFFF4554</Color>
|
||||
<Color x:Key="Switch">#FF2EEAC9</Color>
|
||||
<Color x:Key="Unbounded">#FFFF4554</Color>
|
||||
<Color x:Key="Custom">#6483F5</Color>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<SolidColorBrush x:Key="DataGridSelectionBackgroundBrush"
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace Ryujinx.Ava.Common
|
||||
public enum KeyboardHotkeyState
|
||||
{
|
||||
None,
|
||||
ToggleVSync,
|
||||
ToggleVSyncMode,
|
||||
Screenshot,
|
||||
ShowUI,
|
||||
Pause,
|
||||
@@ -12,5 +12,7 @@ namespace Ryujinx.Ava.Common
|
||||
ResScaleDown,
|
||||
VolumeUp,
|
||||
VolumeDown,
|
||||
CustomVSyncIntervalIncrement,
|
||||
CustomVSyncIntervalDecrement,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
{
|
||||
public class HotkeyConfig : BaseModel
|
||||
{
|
||||
private Key _toggleVsync;
|
||||
public Key ToggleVsync
|
||||
private Key _toggleVSyncMode;
|
||||
public Key ToggleVSyncMode
|
||||
{
|
||||
get => _toggleVsync;
|
||||
get => _toggleVSyncMode;
|
||||
set
|
||||
{
|
||||
_toggleVsync = value;
|
||||
_toggleVSyncMode = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
@@ -104,11 +104,33 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
}
|
||||
}
|
||||
|
||||
private Key _customVSyncIntervalIncrement;
|
||||
public Key CustomVSyncIntervalIncrement
|
||||
{
|
||||
get => _customVSyncIntervalIncrement;
|
||||
set
|
||||
{
|
||||
_customVSyncIntervalIncrement = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private Key _customVSyncIntervalDecrement;
|
||||
public Key CustomVSyncIntervalDecrement
|
||||
{
|
||||
get => _customVSyncIntervalDecrement;
|
||||
set
|
||||
{
|
||||
_customVSyncIntervalDecrement = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public HotkeyConfig(KeyboardHotkeys config)
|
||||
{
|
||||
if (config != null)
|
||||
{
|
||||
ToggleVsync = config.ToggleVsync;
|
||||
ToggleVSyncMode = config.ToggleVSyncMode;
|
||||
Screenshot = config.Screenshot;
|
||||
ShowUI = config.ShowUI;
|
||||
Pause = config.Pause;
|
||||
@@ -117,6 +139,8 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
ResScaleDown = config.ResScaleDown;
|
||||
VolumeUp = config.VolumeUp;
|
||||
VolumeDown = config.VolumeDown;
|
||||
CustomVSyncIntervalIncrement = config.CustomVSyncIntervalIncrement;
|
||||
CustomVSyncIntervalDecrement = config.CustomVSyncIntervalDecrement;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +148,7 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
{
|
||||
var config = new KeyboardHotkeys
|
||||
{
|
||||
ToggleVsync = ToggleVsync,
|
||||
ToggleVSyncMode = ToggleVSyncMode,
|
||||
Screenshot = Screenshot,
|
||||
ShowUI = ShowUI,
|
||||
Pause = Pause,
|
||||
@@ -133,6 +157,8 @@ namespace Ryujinx.Ava.UI.Models.Input
|
||||
ResScaleDown = ResScaleDown,
|
||||
VolumeUp = VolumeUp,
|
||||
VolumeDown = VolumeDown,
|
||||
CustomVSyncIntervalIncrement = CustomVSyncIntervalIncrement,
|
||||
CustomVSyncIntervalDecrement = CustomVSyncIntervalDecrement,
|
||||
};
|
||||
|
||||
return config;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Ryujinx.Ava.UI.Models
|
||||
TitleId = info.ProgramId;
|
||||
UserId = info.UserId;
|
||||
|
||||
var appData = App.MainWindow.ViewModel.Applications.FirstOrDefault(x => x.IdString.Equals(TitleIdString, StringComparison.OrdinalIgnoreCase));
|
||||
var appData = MainWindow.MainWindowViewModel.Applications.FirstOrDefault(x => x.IdString.Equals(TitleIdString, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
InGameList = appData != null;
|
||||
|
||||
|
||||
@@ -4,18 +4,17 @@ namespace Ryujinx.Ava.UI.Models
|
||||
{
|
||||
internal class StatusUpdatedEventArgs : EventArgs
|
||||
{
|
||||
public bool VSyncEnabled { get; }
|
||||
public string VSyncMode { get; }
|
||||
public string VolumeStatus { get; }
|
||||
public string AspectRatio { get; }
|
||||
public string DockedMode { get; }
|
||||
public string FifoStatus { get; }
|
||||
public string GameStatus { get; }
|
||||
|
||||
public uint ShaderCount { get; }
|
||||
|
||||
public StatusUpdatedEventArgs(bool vSyncEnabled, string volumeStatus, string dockedMode, string aspectRatio, string gameStatus, string fifoStatus, uint shaderCount)
|
||||
public StatusUpdatedEventArgs(string vSyncMode, string volumeStatus, string dockedMode, string aspectRatio, string gameStatus, string fifoStatus, uint shaderCount)
|
||||
{
|
||||
VSyncEnabled = vSyncEnabled;
|
||||
VSyncMode = vSyncMode;
|
||||
VolumeStatus = volumeStatus;
|
||||
DockedMode = dockedMode;
|
||||
AspectRatio = aspectRatio;
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private string _searchText;
|
||||
private Timer _searchTimer;
|
||||
private string _dockedStatusText;
|
||||
private string _vSyncModeText;
|
||||
private string _fifoStatusText;
|
||||
private string _gameStatusText;
|
||||
private string _volumeStatusText;
|
||||
@@ -80,7 +81,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private bool _showStatusSeparator;
|
||||
private Brush _progressBarForegroundColor;
|
||||
private Brush _progressBarBackgroundColor;
|
||||
private Brush _vsyncColor;
|
||||
private Brush _vSyncModeColor;
|
||||
private byte[] _selectedIcon;
|
||||
private bool _isAppletMenuActive;
|
||||
private int _statusBarProgressMaximum;
|
||||
@@ -111,6 +112,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private WindowState _windowState;
|
||||
private double _windowWidth;
|
||||
private double _windowHeight;
|
||||
private int _customVSyncInterval;
|
||||
private int _customVSyncIntervalPercentageProxy;
|
||||
|
||||
private bool _isActive;
|
||||
private bool _isSubMenuOpen;
|
||||
@@ -145,6 +148,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
Volume = ConfigurationState.Instance.System.AudioVolume;
|
||||
}
|
||||
CustomVSyncInterval = ConfigurationState.Instance.Graphics.CustomVSyncInterval.Value;
|
||||
}
|
||||
|
||||
public void Initialize(
|
||||
@@ -447,17 +451,87 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public Brush VsyncColor
|
||||
public Brush VSyncModeColor
|
||||
{
|
||||
get => _vsyncColor;
|
||||
get => _vSyncModeColor;
|
||||
set
|
||||
{
|
||||
_vsyncColor = value;
|
||||
_vSyncModeColor = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowCustomVSyncIntervalPicker
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_isGameRunning)
|
||||
{
|
||||
return AppHost.Device.VSyncMode ==
|
||||
VSyncMode.Custom;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int CustomVSyncIntervalPercentageProxy
|
||||
{
|
||||
get => _customVSyncIntervalPercentageProxy;
|
||||
set
|
||||
{
|
||||
int newInterval = (int)((value / 100f) * 60);
|
||||
_customVSyncInterval = newInterval;
|
||||
_customVSyncIntervalPercentageProxy = value;
|
||||
if (_isGameRunning)
|
||||
{
|
||||
AppHost.Device.CustomVSyncInterval = newInterval;
|
||||
AppHost.Device.UpdateVSyncInterval();
|
||||
}
|
||||
OnPropertyChanged((nameof(CustomVSyncInterval)));
|
||||
OnPropertyChanged((nameof(CustomVSyncIntervalPercentageText)));
|
||||
}
|
||||
}
|
||||
|
||||
public string CustomVSyncIntervalPercentageText
|
||||
{
|
||||
get
|
||||
{
|
||||
string text = CustomVSyncIntervalPercentageProxy.ToString() + "%";
|
||||
return text;
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public int CustomVSyncInterval
|
||||
{
|
||||
get => _customVSyncInterval;
|
||||
set
|
||||
{
|
||||
_customVSyncInterval = value;
|
||||
int newPercent = (int)((value / 60f) * 100);
|
||||
_customVSyncIntervalPercentageProxy = newPercent;
|
||||
if (_isGameRunning)
|
||||
{
|
||||
AppHost.Device.CustomVSyncInterval = value;
|
||||
AppHost.Device.UpdateVSyncInterval();
|
||||
}
|
||||
OnPropertyChanged(nameof(CustomVSyncIntervalPercentageProxy));
|
||||
OnPropertyChanged(nameof(CustomVSyncIntervalPercentageText));
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] SelectedIcon
|
||||
{
|
||||
get => _selectedIcon;
|
||||
@@ -578,6 +652,17 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public string VSyncModeText
|
||||
{
|
||||
get => _vSyncModeText;
|
||||
set
|
||||
{
|
||||
_vSyncModeText = value;
|
||||
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public string DockedStatusText
|
||||
{
|
||||
get => _dockedStatusText;
|
||||
@@ -1292,17 +1377,18 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
Application.Current!.Styles.TryGetResource(args.VSyncEnabled
|
||||
? "VsyncEnabled"
|
||||
: "VsyncDisabled",
|
||||
Application.Current!.Styles.TryGetResource(args.VSyncMode,
|
||||
Application.Current.ActualThemeVariant,
|
||||
out object color);
|
||||
|
||||
if (color is Color clr)
|
||||
{
|
||||
VsyncColor = new SolidColorBrush(clr);
|
||||
VSyncModeColor = new SolidColorBrush(clr);
|
||||
}
|
||||
|
||||
VSyncModeText = args.VSyncMode == "Custom" ? "Custom" : "VSync";
|
||||
ShowCustomVSyncIntervalPicker =
|
||||
args.VSyncMode == VSyncMode.Custom.ToString();
|
||||
DockedStatusText = args.DockedMode;
|
||||
AspectRatioStatusText = args.AspectRatio;
|
||||
GameStatusText = args.GameStatus;
|
||||
@@ -1495,6 +1581,27 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public void ToggleVSyncMode()
|
||||
{
|
||||
AppHost.VSyncModeToggle();
|
||||
OnPropertyChanged(nameof(ShowCustomVSyncIntervalPicker));
|
||||
}
|
||||
|
||||
public void VSyncModeSettingChanged()
|
||||
{
|
||||
if (_isGameRunning)
|
||||
{
|
||||
AppHost.Device.CustomVSyncInterval = ConfigurationState.Instance.Graphics.CustomVSyncInterval.Value;
|
||||
AppHost.Device.UpdateVSyncInterval();
|
||||
}
|
||||
|
||||
CustomVSyncInterval = ConfigurationState.Instance.Graphics.CustomVSyncInterval.Value;
|
||||
OnPropertyChanged(nameof(ShowCustomVSyncIntervalPicker));
|
||||
OnPropertyChanged(nameof(CustomVSyncIntervalPercentageProxy));
|
||||
OnPropertyChanged(nameof(CustomVSyncIntervalPercentageText));
|
||||
OnPropertyChanged(nameof(CustomVSyncInterval));
|
||||
}
|
||||
|
||||
public async Task ExitCurrentState()
|
||||
{
|
||||
if (WindowState is WindowState.FullScreen)
|
||||
|
||||
@@ -52,6 +52,10 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private int _graphicsBackendIndex;
|
||||
private int _scalingFilter;
|
||||
private int _scalingFilterLevel;
|
||||
private int _customVSyncInterval;
|
||||
private bool _enableCustomVSyncInterval;
|
||||
private int _customVSyncIntervalPercentageProxy;
|
||||
private VSyncMode _vSyncMode;
|
||||
|
||||
public event Action CloseWindow;
|
||||
public event Action SaveSettingsEvent;
|
||||
@@ -154,7 +158,74 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
public bool EnableDockedMode { get; set; }
|
||||
public bool EnableKeyboard { get; set; }
|
||||
public bool EnableMouse { get; set; }
|
||||
public bool EnableVsync { get; set; }
|
||||
public VSyncMode VSyncMode
|
||||
{
|
||||
get => _vSyncMode;
|
||||
set
|
||||
{
|
||||
if (value == VSyncMode.Custom ||
|
||||
value == VSyncMode.Switch ||
|
||||
value == VSyncMode.Unbounded)
|
||||
{
|
||||
_vSyncMode = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int CustomVSyncIntervalPercentageProxy
|
||||
{
|
||||
get => _customVSyncIntervalPercentageProxy;
|
||||
set
|
||||
{
|
||||
int newInterval = (int)((value / 100f) * 60);
|
||||
_customVSyncInterval = newInterval;
|
||||
_customVSyncIntervalPercentageProxy = value;
|
||||
OnPropertyChanged((nameof(CustomVSyncInterval)));
|
||||
OnPropertyChanged((nameof(CustomVSyncIntervalPercentageText)));
|
||||
}
|
||||
}
|
||||
|
||||
public string CustomVSyncIntervalPercentageText
|
||||
{
|
||||
get
|
||||
{
|
||||
string text = CustomVSyncIntervalPercentageProxy.ToString() + "%";
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableCustomVSyncInterval
|
||||
{
|
||||
get => _enableCustomVSyncInterval;
|
||||
set
|
||||
{
|
||||
_enableCustomVSyncInterval = value;
|
||||
if (_vSyncMode == VSyncMode.Custom && !value)
|
||||
{
|
||||
VSyncMode = VSyncMode.Switch;
|
||||
}
|
||||
else if (value)
|
||||
{
|
||||
VSyncMode = VSyncMode.Custom;
|
||||
}
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int CustomVSyncInterval
|
||||
{
|
||||
get => _customVSyncInterval;
|
||||
set
|
||||
{
|
||||
_customVSyncInterval = value;
|
||||
int newPercent = (int)((value / 60f) * 100);
|
||||
_customVSyncIntervalPercentageProxy = newPercent;
|
||||
OnPropertyChanged(nameof(CustomVSyncIntervalPercentageProxy));
|
||||
OnPropertyChanged(nameof(CustomVSyncIntervalPercentageText));
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
public bool EnablePptc { get; set; }
|
||||
public bool EnableLowPowerPptc { get; set; }
|
||||
public bool EnableInternetAccess { get; set; }
|
||||
@@ -484,7 +555,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
CurrentDate = currentDateTime.Date;
|
||||
CurrentTime = currentDateTime.TimeOfDay;
|
||||
|
||||
EnableVsync = config.Graphics.EnableVsync;
|
||||
EnableCustomVSyncInterval = config.Graphics.EnableCustomVSyncInterval.Value;
|
||||
CustomVSyncInterval = config.Graphics.CustomVSyncInterval;
|
||||
VSyncMode = config.Graphics.VSyncMode;
|
||||
EnableFsIntegrityChecks = config.System.EnableFsIntegrityChecks;
|
||||
DramSize = config.System.DramSize;
|
||||
IgnoreMissingServices = config.System.IgnoreMissingServices;
|
||||
@@ -590,7 +663,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
|
||||
config.System.SystemTimeOffset.Value = Convert.ToInt64((CurrentDate.ToUnixTimeSeconds() + CurrentTime.TotalSeconds) - DateTimeOffset.Now.ToUnixTimeSeconds());
|
||||
config.Graphics.EnableVsync.Value = EnableVsync;
|
||||
config.Graphics.VSyncMode.Value = VSyncMode;
|
||||
config.Graphics.EnableCustomVSyncInterval.Value = EnableCustomVSyncInterval;
|
||||
config.Graphics.CustomVSyncInterval.Value = CustomVSyncInterval;
|
||||
config.System.EnableFsIntegrityChecks.Value = EnableFsIntegrityChecks;
|
||||
config.System.DramSize.Value = DramSize;
|
||||
config.System.IgnoreMissingServices.Value = IgnoreMissingServices;
|
||||
@@ -660,6 +735,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
config.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
||||
|
||||
MainWindow.UpdateGraphicsConfig();
|
||||
MainWindow.MainWindowViewModel.VSyncModeSettingChanged();
|
||||
|
||||
SaveSettingsEvent?.Invoke();
|
||||
|
||||
|
||||
@@ -79,15 +79,69 @@
|
||||
MaxHeight="18"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Name="VsyncStatus"
|
||||
Name="VSyncMode"
|
||||
Margin="5,0,5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{Binding VsyncColor}"
|
||||
Foreground="{Binding VSyncModeColor}"
|
||||
IsVisible="{Binding !ShowLoadProgress}"
|
||||
PointerReleased="VsyncStatus_PointerReleased"
|
||||
Text="VSync"
|
||||
TextAlignment="Start" />
|
||||
PointerReleased="VSyncMode_PointerReleased"
|
||||
Text="{Binding VSyncModeText}"
|
||||
TextAlignment="Start"/>
|
||||
<Button MinWidth="0"
|
||||
Width="20"
|
||||
IsVisible="{Binding ShowCustomVSyncIntervalPicker}"
|
||||
Margin="-5,0,5,0"
|
||||
Background="Transparent"
|
||||
BorderThickness="0">
|
||||
<ui:SymbolIcon Symbol="Settings"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Width="14"
|
||||
Height="14"/>
|
||||
<Button.Styles>
|
||||
<Style Selector=":checked">
|
||||
<Style Selector="^:checked ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundColor}" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="Border#SeparatorBorder">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
</Style>
|
||||
</Button.Styles>
|
||||
<Button.Flyout>
|
||||
<Flyout Placement="Top" ShowMode="TransientWithDismissOnPointerMoveAway">
|
||||
<StackPanel Margin="0,0,0,10"
|
||||
Orientation="Horizontal">
|
||||
<ui:NumberBox ToolTip.Tip="{ext:Locale SettingsTabSystemCustomVSyncIntervalValueTooltip}"
|
||||
Value="{Binding CustomVSyncInterval}"
|
||||
Width="175"
|
||||
SmallChange="1.0"
|
||||
LargeChange="10"
|
||||
SimpleNumberFormat="F0"
|
||||
SpinButtonPlacementMode="Hidden"
|
||||
Minimum="10"
|
||||
Maximum="1000" />
|
||||
<Slider Value="{Binding CustomVSyncIntervalPercentageProxy}"
|
||||
ToolTip.Tip="{ext:Locale SettingsTabSystemCustomVSyncIntervalSliderTooltip}"
|
||||
MinWidth="175"
|
||||
Margin="10,-3,0,0"
|
||||
Height="32"
|
||||
Padding="0,-5"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True"
|
||||
LargeChange="10"
|
||||
SmallChange="1"
|
||||
VerticalAlignment="Center"
|
||||
Minimum="10"
|
||||
Maximum="400" />
|
||||
<TextBlock Margin="5,0"
|
||||
Width="40"
|
||||
Text="{Binding CustomVSyncIntervalPercentageText}"/>
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
<Border
|
||||
Width="2"
|
||||
Height="12"
|
||||
|
||||
@@ -38,11 +38,10 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||
}
|
||||
}
|
||||
|
||||
private void VsyncStatus_PointerReleased(object sender, PointerReleasedEventArgs e)
|
||||
private void VSyncMode_PointerReleased(object sender, PointerReleasedEventArgs e)
|
||||
{
|
||||
Window.ViewModel.AppHost.ToggleVSync();
|
||||
|
||||
Logger.Info?.Print(LogClass.Application, $"VSync toggled to: {Window.ViewModel.AppHost.Device.EnableDeviceVsync}");
|
||||
Window.ViewModel.ToggleVSyncMode();
|
||||
Logger.Info?.Print(LogClass.Application, $"VSync Mode toggled to: {Window.ViewModel.AppHost.Device.VSyncMode}");
|
||||
}
|
||||
|
||||
private void DockedStatus_PointerReleased(object sender, PointerReleasedEventArgs e)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl
|
||||
<UserControl
|
||||
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsHotkeysView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -50,9 +50,9 @@
|
||||
Classes="h1"
|
||||
Text="{ext:Locale SettingsTabHotkeysHotkeys}" />
|
||||
<StackPanel>
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleVsyncHotkey}" />
|
||||
<ToggleButton Name="ToggleVsync">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ToggleVsync, Converter={StaticResource Key}}" />
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysToggleVSyncModeHotkey}" />
|
||||
<ToggleButton Name="ToggleVSyncMode">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.ToggleVSyncMode, Converter={StaticResource Key}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
@@ -103,6 +103,18 @@
|
||||
<TextBlock Text="{Binding KeyboardHotkey.VolumeDown, Converter={StaticResource Key}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysIncrementCustomVSyncIntervalHotkey}" />
|
||||
<ToggleButton Name="CustomVSyncIntervalIncrement">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalIncrement, Converter={StaticResource Key}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
|
||||
<TextBlock Text="{ext:Locale SettingsTabHotkeysDecrementCustomVSyncIntervalHotkey}" />
|
||||
<ToggleButton Name="CustomVSyncIntervalDecrement">
|
||||
<TextBlock Text="{Binding KeyboardHotkey.CustomVSyncIntervalDecrement, Converter={StaticResource Key}}" />
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -82,8 +82,8 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
||||
|
||||
switch (button.Name)
|
||||
{
|
||||
case "ToggleVsync":
|
||||
viewModel.KeyboardHotkey.ToggleVsync = buttonValue.AsHidType<Key>();
|
||||
case "ToggleVSyncMode":
|
||||
viewModel.KeyboardHotkey.ToggleVSyncMode = buttonValue.AsHidType<Key>();
|
||||
break;
|
||||
case "Screenshot":
|
||||
viewModel.KeyboardHotkey.Screenshot = buttonValue.AsHidType<Key>();
|
||||
@@ -109,6 +109,12 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
||||
case "VolumeDown":
|
||||
viewModel.KeyboardHotkey.VolumeDown = buttonValue.AsHidType<Key>();
|
||||
break;
|
||||
case "CustomVSyncIntervalIncrement":
|
||||
viewModel.KeyboardHotkey.CustomVSyncIntervalIncrement = buttonValue.AsHidType<Key>();
|
||||
break;
|
||||
case "CustomVSyncIntervalDecrement":
|
||||
viewModel.KeyboardHotkey.CustomVSyncIntervalDecrement = buttonValue.AsHidType<Key>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||
@@ -181,11 +182,78 @@
|
||||
Width="350"
|
||||
ToolTip.Tip="{ext:Locale TimeTooltip}" />
|
||||
</StackPanel>
|
||||
<CheckBox IsChecked="{Binding EnableVsync}">
|
||||
<StackPanel Margin="0,0,0,10"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Text="{ext:Locale SettingsTabSystemEnableVsync}"
|
||||
ToolTip.Tip="{ext:Locale VSyncToggleTooltip}" />
|
||||
</CheckBox>
|
||||
VerticalAlignment="Center"
|
||||
Text="{ext:Locale SettingsTabSystemVSyncMode}"
|
||||
ToolTip.Tip="{ext:Locale SettingsTabSystemVSyncModeTooltip}"
|
||||
Width="250" />
|
||||
<ComboBox
|
||||
IsVisible="{Binding EnableCustomVSyncInterval}"
|
||||
SelectedIndex="{Binding VSyncMode}"
|
||||
ToolTip.Tip="{ext:Locale SettingsTabSystemVSyncModeTooltipCustom}"
|
||||
HorizontalContentAlignment="Left"
|
||||
Width="350">
|
||||
<ComboBoxItem>
|
||||
<TextBlock Text="{ext:Locale SettingsTabSystemVSyncModeSwitch}" />
|
||||
</ComboBoxItem>
|
||||
<ComboBoxItem>
|
||||
<TextBlock Text="{ext:Locale SettingsTabSystemVSyncModeUnbounded}" />
|
||||
</ComboBoxItem>
|
||||
<ComboBoxItem>
|
||||
<TextBlock Text="{ext:Locale SettingsTabSystemVSyncModeCustom}" />
|
||||
</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<ComboBox
|
||||
IsVisible="{Binding !EnableCustomVSyncInterval}"
|
||||
SelectedIndex="{Binding VSyncMode}"
|
||||
ToolTip.Tip="{ext:Locale SettingsTabSystemVSyncModeTooltip}"
|
||||
HorizontalContentAlignment="Left"
|
||||
Width="350">
|
||||
<ComboBoxItem>
|
||||
<TextBlock Text="{ext:Locale SettingsTabSystemVSyncModeSwitch}" />
|
||||
</ComboBoxItem>
|
||||
<ComboBoxItem>
|
||||
<TextBlock Text="{ext:Locale SettingsTabSystemVSyncModeUnbounded}" />
|
||||
</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
<StackPanel IsVisible="{Binding EnableCustomVSyncInterval}"
|
||||
Margin="0,0,0,10"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{ext:Locale SettingsTabSystemCustomVSyncIntervalValue}"
|
||||
ToolTip.Tip="{ext:Locale SettingsTabSystemCustomVSyncIntervalValueTooltip}"
|
||||
Width="250" />
|
||||
<ui:NumberBox IsVisible="{Binding EnableCustomVSyncInterval}"
|
||||
ToolTip.Tip="{ext:Locale SettingsTabSystemCustomVSyncIntervalValueTooltip}"
|
||||
Value="{Binding CustomVSyncInterval}"
|
||||
Width="165"
|
||||
SmallChange="1.0"
|
||||
LargeChange="10"
|
||||
SimpleNumberFormat="F0"
|
||||
SpinButtonPlacementMode="Hidden"
|
||||
Minimum="6"
|
||||
Maximum="1000" />
|
||||
<Slider Value="{Binding CustomVSyncIntervalPercentageProxy}"
|
||||
ToolTip.Tip="{ext:Locale SettingsTabSystemCustomVSyncIntervalSliderTooltip}"
|
||||
MinWidth="175"
|
||||
Margin="10,-3,0,0"
|
||||
Height="32"
|
||||
Padding="0,-5"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True"
|
||||
LargeChange="10"
|
||||
SmallChange="1"
|
||||
VerticalAlignment="Center"
|
||||
Minimum="10"
|
||||
Maximum="400" />
|
||||
<TextBlock Margin="5,0"
|
||||
Width="40"
|
||||
Text="{Binding CustomVSyncIntervalPercentageText}"/>
|
||||
</StackPanel>
|
||||
<CheckBox IsChecked="{Binding EnableFsIntegrityChecks}">
|
||||
<TextBlock
|
||||
Text="{ext:Locale SettingsTabSystemEnableFsIntegrityChecks}"
|
||||
@@ -244,6 +312,11 @@
|
||||
ToolTip.Tip="{ext:Locale IgnoreAppletTooltip}">
|
||||
<TextBlock Text="{ext:Locale SettingsTabSystemIgnoreApplet}" />
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
IsChecked="{Binding EnableCustomVSyncInterval}"
|
||||
ToolTip.Tip="{ext:Locale SettingsTabSystemEnableCustomVSyncIntervalTooltip}">
|
||||
<TextBlock Text="{ext:Locale SettingsTabSystemEnableCustomVSyncInterval}" />
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
@@ -38,6 +38,8 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
{
|
||||
public partial class MainWindow : StyleableAppWindow
|
||||
{
|
||||
internal static MainWindowViewModel MainWindowViewModel { get; private set; }
|
||||
|
||||
public MainWindowViewModel ViewModel { get; }
|
||||
|
||||
internal readonly AvaHostUIHandler UiHandler;
|
||||
@@ -73,7 +75,7 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
DataContext = ViewModel = new MainWindowViewModel
|
||||
DataContext = ViewModel = MainWindowViewModel = new MainWindowViewModel
|
||||
{
|
||||
Window = this
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user