From 2281b3b59e1792c641a368d48c6b65851a4d370a Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 19 Apr 2024 13:29:53 -0400 Subject: [PATCH] Move around VMs + Make most settings reactive --- .../Input/ControllerInputViewModel.cs | 5 +- .../Input/KeyboardInputViewModel.cs | 5 +- .../SettingsInputViewModel.cs} | 15 +- .../{ => Settings}/SettingsViewModel.cs | 395 ++++++++++++++++-- .../Views/Input/ControllerInputView.axaml.cs | 2 +- .../UI/Views/Input/KeyboardInputView.axaml | 2 +- .../UI/Views/Input/KeyboardInputView.axaml.cs | 2 +- .../UI/Views/Input/RumbleInputView.axaml.cs | 1 + .../UI/Views/Settings/SettingsAudioView.axaml | 2 +- .../UI/Views/Settings/SettingsCPUView.axaml | 2 +- .../Views/Settings/SettingsGraphicsView.axaml | 2 +- .../Views/Settings/SettingsHotkeysView.axaml | 2 +- .../Settings/SettingsHotkeysView.axaml.cs | 2 +- .../UI/Views/Settings/SettingsInputView.axaml | 11 +- .../Views/Settings/SettingsInputView.axaml.cs | 7 +- .../Views/Settings/SettingsLoggingView.axaml | 4 +- .../Views/Settings/SettingsNetworkView.axaml | 2 +- .../Views/Settings/SettingsSystemView.axaml | 8 +- .../Settings/SettingsSystemView.axaml.cs | 2 +- .../UI/Views/Settings/SettingsUIView.axaml | 2 +- .../UI/Views/Settings/SettingsUIView.axaml.cs | 2 +- src/Ryujinx/UI/Windows/SettingsWindow.axaml | 2 +- .../UI/Windows/SettingsWindow.axaml.cs | 2 +- 23 files changed, 390 insertions(+), 89 deletions(-) rename src/Ryujinx/UI/ViewModels/{Input/InputViewModel.cs => Settings/SettingsInputViewModel.cs} (98%) rename src/Ryujinx/UI/ViewModels/{ => Settings}/SettingsViewModel.cs (65%) diff --git a/src/Ryujinx/UI/ViewModels/Input/ControllerInputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/ControllerInputViewModel.cs index 6ee79a371..018af14ba 100644 --- a/src/Ryujinx/UI/ViewModels/Input/ControllerInputViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/Input/ControllerInputViewModel.cs @@ -1,5 +1,6 @@ using Avalonia.Svg.Skia; using Ryujinx.Ava.UI.Models.Input; +using Ryujinx.Ava.UI.ViewModels.Settings; using Ryujinx.Ava.UI.Views.Input; namespace Ryujinx.Ava.UI.ViewModels.Input @@ -54,9 +55,9 @@ namespace Ryujinx.Ava.UI.ViewModels.Input } } - public readonly InputViewModel ParentModel; + public readonly SettingsInputViewModel ParentModel; - public ControllerInputViewModel(InputViewModel model, GamepadInputConfig config) + public ControllerInputViewModel(SettingsInputViewModel model, GamepadInputConfig config) { ParentModel = model; model.NotifyChangesEvent += OnParentModelChanged; diff --git a/src/Ryujinx/UI/ViewModels/Input/KeyboardInputViewModel.cs b/src/Ryujinx/UI/ViewModels/Input/KeyboardInputViewModel.cs index 0b530eb09..80a3403e3 100644 --- a/src/Ryujinx/UI/ViewModels/Input/KeyboardInputViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/Input/KeyboardInputViewModel.cs @@ -1,5 +1,6 @@ using Avalonia.Svg.Skia; using Ryujinx.Ava.UI.Models.Input; +using Ryujinx.Ava.UI.ViewModels.Settings; namespace Ryujinx.Ava.UI.ViewModels.Input { @@ -53,9 +54,9 @@ namespace Ryujinx.Ava.UI.ViewModels.Input } } - public readonly InputViewModel ParentModel; + public readonly SettingsInputViewModel ParentModel; - public KeyboardInputViewModel(InputViewModel model, KeyboardInputConfig config) + public KeyboardInputViewModel(SettingsInputViewModel model, KeyboardInputConfig config) { ParentModel = model; model.NotifyChangesEvent += OnParentModelChanged; diff --git a/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs b/src/Ryujinx/UI/ViewModels/Settings/SettingsInputViewModel.cs similarity index 98% rename from src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs rename to src/Ryujinx/UI/ViewModels/Settings/SettingsInputViewModel.cs index 910382aef..29b269a5c 100644 --- a/src/Ryujinx/UI/ViewModels/Input/InputViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/Settings/SettingsInputViewModel.cs @@ -9,6 +9,7 @@ using Ryujinx.Ava.Input; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models.Input; +using Ryujinx.Ava.UI.ViewModels.Input; using Ryujinx.Ava.UI.Windows; using Ryujinx.Common; using Ryujinx.Common.Configuration; @@ -30,9 +31,9 @@ using ConfigGamepadInputId = Ryujinx.Common.Configuration.Hid.Controller.Gamepad using ConfigStickInputId = Ryujinx.Common.Configuration.Hid.Controller.StickInputId; using Key = Ryujinx.Common.Configuration.Hid.Key; -namespace Ryujinx.Ava.UI.ViewModels.Input +namespace Ryujinx.Ava.UI.ViewModels.Settings { - public class InputViewModel : BaseModel, IDisposable + public class SettingsInputViewModel : BaseModel, IDisposable { private const string Disabled = "disabled"; private const string ProControllerResource = "Ryujinx.UI.Common/Resources/Controller_ProCon.svg"; @@ -102,12 +103,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input get => _playerId; set { - if (SettingsViewModel.IsModified) - { - return; - } - - SettingsViewModel.IsModified = false; _playerId = value; if (!Enum.IsDefined(typeof(PlayerIndex), _playerId)) @@ -244,7 +239,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input public InputConfig Config { get; set; } - public InputViewModel(UserControl owner, SettingsViewModel settingsViewModel) : this() + public SettingsInputViewModel(UserControl owner, SettingsViewModel settingsViewModel) : this() { SettingsViewModel = settingsViewModel; @@ -269,7 +264,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input } } - public InputViewModel() + public SettingsInputViewModel() { PlayerIndexes = new ObservableCollection(); Controllers = new ObservableCollection(); diff --git a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx/UI/ViewModels/Settings/SettingsViewModel.cs similarity index 65% rename from src/Ryujinx/UI/ViewModels/SettingsViewModel.cs rename to src/Ryujinx/UI/ViewModels/Settings/SettingsViewModel.cs index 9f2589071..893a86b44 100644 --- a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/Settings/SettingsViewModel.cs @@ -5,6 +5,7 @@ using LibHac.Tools.FsSystem; using Ryujinx.Audio.Backends.OpenAL; using Ryujinx.Audio.Backends.SDL2; using Ryujinx.Audio.Backends.SoundIo; +using Ryujinx.Ava; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Models.Input; @@ -27,7 +28,7 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using TimeZone = Ryujinx.Ava.UI.Models.TimeZone; -namespace Ryujinx.Ava.UI.ViewModels +namespace Ryujinx.Ava.UI.ViewModels.Settings { public class SettingsViewModel : BaseModel { @@ -57,7 +58,7 @@ namespace Ryujinx.Ava.UI.ViewModels public bool IsModified { get => _isModified; - set + private set { DirtyEvent?.Invoke(value); _isModified = value; @@ -142,31 +143,261 @@ namespace Ryujinx.Ava.UI.ViewModels public bool IsMacOS => OperatingSystem.IsMacOS(); - public bool EnableDiscordIntegration { get; set; } - public bool CheckUpdatesOnStart { get; set; } - public bool ShowConfirmExit { get; set; } - public bool RememberWindowState { get; set; } - public int HideCursor { get; set; } - public bool EnableVsync { get; set; } - public bool EnablePptc { get; set; } - public bool EnableInternetAccess { get; set; } - public bool EnableFsIntegrityChecks { get; set; } - public bool IgnoreMissingServices { get; set; } - public bool ExpandDramSize { get; set; } - public bool EnableShaderCache { get; set; } - public bool EnableTextureRecompression { get; set; } - public bool EnableMacroHLE { get; set; } - public bool EnableColorSpacePassthrough { get; set; } + private bool _enableDiscordIntegration; + public bool EnableDiscordIntegration + { + get => _enableDiscordIntegration; + set + { + _enableDiscordIntegration = value; + CheckIfModified(); + } + } + + private bool _checkUpdatesOnStart; + public bool CheckUpdatesOnStart + { + get => _checkUpdatesOnStart; + set + { + _checkUpdatesOnStart = value; + CheckIfModified(); + } + } + + private bool _showConfirmExit; + public bool ShowConfirmExit + { + get => _showConfirmExit; + set + { + _showConfirmExit = value; + CheckIfModified(); + } + } + + private int _hideCursor; + public int HideCursor + { + get => _hideCursor; + set + { + _hideCursor = value; + CheckIfModified(); + } + } + + private bool _enableVsync; + public bool EnableVsync + { + get => _enableVsync; + set + { + _enableVsync = value; + CheckIfModified(); + } + } + + private bool _enablePptc; + public bool EnablePptc + { + get => _enablePptc; + set + { + _enablePptc = value; + CheckIfModified(); + } + } + + private bool _enableInternetAccess; + public bool EnableInternetAccess + { + get => _enableInternetAccess; + set + { + _enableInternetAccess = value; + CheckIfModified(); + } + } + + private bool _enableFsIntegrityChecks; + public bool EnableFsIntegrityChecks + { + get => _enableFsIntegrityChecks; + set + { + _enableFsIntegrityChecks = value; + CheckIfModified(); + } + } + + private bool _ignoreMissingServices; + public bool IgnoreMissingServices + { + get => _ignoreMissingServices; + set + { + _ignoreMissingServices = value; + CheckIfModified(); + } + } + + private bool _expandedDramSize; + public bool ExpandDramSize + { + get => _expandedDramSize; + set + { + _expandedDramSize = value; + CheckIfModified(); + } + } + + private bool _enableShaderCache; + public bool EnableShaderCache + { + get => _enableShaderCache; + set + { + _enableShaderCache = value; + CheckIfModified(); + } + } + + private bool _enableTextureRecompression; + public bool EnableTextureRecompression + { + get => _enableTextureRecompression; + set + { + _enableTextureRecompression = value; + CheckIfModified(); + } + } + + private bool _enableMacroHLE; + public bool EnableMacroHLE + { + get => _enableMacroHLE; + set + { + _enableMacroHLE = value; + CheckIfModified(); + } + } + + private bool _enableColorSpacePassthrough; + public bool EnableColorSpacePassthrough + { + get => _enableColorSpacePassthrough; + set + { + _enableColorSpacePassthrough = value; + CheckIfModified(); + } + } + public bool ColorSpacePassthroughAvailable => IsMacOS; - public bool EnableFileLog { get; set; } - public bool EnableStub { get; set; } - public bool EnableInfo { get; set; } - public bool EnableWarn { get; set; } - public bool EnableError { get; set; } - public bool EnableTrace { get; set; } - public bool EnableGuest { get; set; } - public bool EnableFsAccessLog { get; set; } - public bool EnableDebug { get; set; } + + private bool _enableFileLog; + public bool EnableFileLog + { + get => _enableFileLog; + set + { + _enableFileLog = value; + CheckIfModified(); + } + } + + private bool _enableStub; + public bool EnableStub + { + get => _enableStub; + set + { + _enableStub = value; + CheckIfModified(); + } + } + + private bool _enableInfo; + public bool EnableInfo + { + get => _enableInfo; + set + { + _enableInfo = value; + CheckIfModified(); + } + } + + private bool _enableWarn; + public bool EnableWarn + { + get => _enableWarn; + set + { + _enableWarn = value; + CheckIfModified(); + } + } + + private bool _enableError; + public bool EnableError + { + get => _enableError; + set + { + _enableError = value; + CheckIfModified(); + } + } + + private bool _enableTrace; + public bool EnableTrace + { + get => _enableTrace; + set + { + _enableTrace = value; + CheckIfModified(); + } + } + + private bool _enableGuest; + public bool EnableGuest + { + get => _enableGuest; + set + { + _enableGuest = value; + CheckIfModified(); + } + } + + private bool _enableFsAccessLog; + public bool EnableFsAccessLog + { + get => _enableFsAccessLog; + set + { + _enableFsAccessLog = value; + CheckIfModified(); + } + } + + private bool _enableDebug; + public bool EnableDebug + { + get => _enableDebug; + set + { + _enableDebug = value; + CheckIfModified(); + } + } + public bool IsOpenAlEnabled { get; set; } public bool IsSoundIoEnabled { get; set; } public bool IsSDL2Enabled { get; set; } @@ -298,6 +529,93 @@ namespace Ryujinx.Ava.UI.ViewModels } } + public void CheckIfModified() + { + bool isDirty = false; + + ConfigurationState config = ConfigurationState.Instance; + + isDirty |= config.EnableDiscordIntegration.Value != EnableDiscordIntegration; + isDirty |= config.CheckUpdatesOnStart.Value != CheckUpdatesOnStart; + isDirty |= config.ShowConfirmExit.Value != ShowConfirmExit; + isDirty |= config.HideCursor.Value != (HideCursorMode)HideCursor; + + // isDirty |= config.UI.GameDirs.Value != GameDirectories.ToList(); + + isDirty |= config.UI.BaseStyle.Value != (BaseStyleIndex == 0 ? "Light" : "Dark"); + + // Keyboard Hotkeys + // isDirty |= config.Hid.Hotkeys.Value != KeyboardHotkey.GetConfig(); + + // System + isDirty |= config.System.Region.Value != (Region)Region; + isDirty |= config.System.Language.Value != (Language)Language; + + if (_validTzRegions.Contains(TimeZone)) + { + isDirty |= config.System.TimeZone.Value != TimeZone; + } + + // isDirty |= config.System.SystemTimeOffset.Value != Convert.ToInt64((CurrentDate.ToUnixTimeSeconds() + CurrentTime.TotalSeconds) - DateTimeOffset.Now.ToUnixTimeSeconds()); + isDirty |= config.Graphics.EnableVsync.Value != EnableVsync; + isDirty |= config.System.EnableFsIntegrityChecks.Value != EnableFsIntegrityChecks; + isDirty |= config.System.ExpandRam.Value != ExpandDramSize; + isDirty |= config.System.IgnoreMissingServices.Value != IgnoreMissingServices; + + // CPU + isDirty |= config.System.EnablePtc.Value != EnablePptc; + isDirty |= config.System.MemoryManagerMode.Value != (MemoryManagerMode)MemoryMode; + isDirty |= config.System.UseHypervisor.Value != UseHypervisor; + + // Graphics + isDirty |= config.Graphics.GraphicsBackend.Value != (GraphicsBackend)GraphicsBackendIndex; + isDirty |= config.Graphics.PreferredGpu.Value != _gpuIds.ElementAtOrDefault(PreferredGpuIndex); + isDirty |= config.Graphics.EnableShaderCache.Value != EnableShaderCache; + isDirty |= config.Graphics.EnableTextureRecompression.Value != EnableTextureRecompression; + isDirty |= config.Graphics.EnableMacroHLE.Value != EnableMacroHLE; + isDirty |= config.Graphics.EnableColorSpacePassthrough.Value != EnableColorSpacePassthrough; + isDirty |= config.Graphics.ResScale.Value != (ResolutionScale == 4 ? -1 : ResolutionScale + 1); + isDirty |= config.Graphics.ResScaleCustom.Value != CustomResolutionScale; + isDirty |= config.Graphics.MaxAnisotropy.Value != (MaxAnisotropy == 0 ? -1 : MathF.Pow(2, MaxAnisotropy)); + isDirty |= config.Graphics.AspectRatio.Value != (AspectRatio)AspectRatio; + isDirty |= config.Graphics.AntiAliasing.Value != (AntiAliasing)AntiAliasingEffect; + isDirty |= config.Graphics.ScalingFilter.Value != (ScalingFilter)ScalingFilter; + isDirty |= config.Graphics.ScalingFilterLevel.Value != ScalingFilterLevel; + + if (ConfigurationState.Instance.Graphics.BackendThreading != (BackendThreading)GraphicsBackendMultithreadingIndex) + { + DriverUtilities.ToggleOGLThreading(GraphicsBackendMultithreadingIndex == (int)BackendThreading.Off); + } + + isDirty |= config.Graphics.BackendThreading.Value != (BackendThreading)GraphicsBackendMultithreadingIndex; + isDirty |= config.Graphics.ShadersDumpPath.Value != ShaderDumpPath; + + // Audio + isDirty |= config.System.AudioBackend.Value != (AudioBackend)AudioBackend; + isDirty |= config.System.AudioVolume.Value != Volume / 100; + + // Network + isDirty |= config.System.EnableInternetAccess.Value != EnableInternetAccess; + + // Logging + isDirty |= config.Logger.EnableFileLog.Value != EnableFileLog; + isDirty |= config.Logger.EnableStub.Value != EnableStub; + isDirty |= config.Logger.EnableInfo.Value != EnableInfo; + isDirty |= config.Logger.EnableWarn.Value != EnableWarn; + isDirty |= config.Logger.EnableError.Value != EnableError; + isDirty |= config.Logger.EnableTrace.Value != EnableTrace; + isDirty |= config.Logger.EnableGuest.Value != EnableGuest; + isDirty |= config.Logger.EnableDebug.Value != EnableDebug; + isDirty |= config.Logger.EnableFsAccessLog.Value != EnableFsAccessLog; + isDirty |= config.System.FsGlobalAccessLogMode.Value != FsGlobalAccessLogMode; + isDirty |= config.Logger.GraphicsDebugLevel.Value != (GraphicsDebugLevel)OpenglDebugLevel; + + isDirty |= config.Multiplayer.LanInterfaceId.Value != _networkInterfaces[NetworkInterfaceList[NetworkInterfaceIndex]]; + isDirty |= config.Multiplayer.Mode.Value != (MultiplayerMode)MultiplayerModeIndex; + + IsModified = isDirty; + } + public async Task CheckSoundBackends() { IsOpenAlEnabled = OpenALHardwareDeviceDriver.IsSupported; @@ -402,19 +720,12 @@ namespace Ryujinx.Ava.UI.ViewModels EnableDiscordIntegration = config.EnableDiscordIntegration; CheckUpdatesOnStart = config.CheckUpdatesOnStart; ShowConfirmExit = config.ShowConfirmExit; - RememberWindowState = config.RememberWindowState; HideCursor = (int)config.HideCursor.Value; GameDirectories.Clear(); GameDirectories.AddRange(config.UI.GameDirs.Value); - BaseStyleIndex = config.UI.BaseStyle.Value switch - { - "Auto" => 0, - "Light" => 1, - "Dark" => 2, - _ => 0 - }; + BaseStyleIndex = config.UI.BaseStyle == "Light" ? 0 : 1; // Keyboard Hotkeys KeyboardHotkey = new HotkeyConfig(config.Hid.Hotkeys.Value); @@ -424,11 +735,10 @@ namespace Ryujinx.Ava.UI.ViewModels Language = (int)config.System.Language.Value; TimeZone = config.System.TimeZone; - DateTime currentHostDateTime = DateTime.Now; - TimeSpan systemDateTimeOffset = TimeSpan.FromSeconds(config.System.SystemTimeOffset); - DateTime currentDateTime = currentHostDateTime.Add(systemDateTimeOffset); + DateTime currentDateTime = DateTime.Now; + CurrentDate = currentDateTime.Date; - CurrentTime = currentDateTime.TimeOfDay; + CurrentTime = currentDateTime.TimeOfDay.Add(TimeSpan.FromSeconds(config.System.SystemTimeOffset)); EnableVsync = config.Graphics.EnableVsync; EnableFsIntegrityChecks = config.System.EnableFsIntegrityChecks; @@ -489,7 +799,6 @@ namespace Ryujinx.Ava.UI.ViewModels config.EnableDiscordIntegration.Value = EnableDiscordIntegration; config.CheckUpdatesOnStart.Value = CheckUpdatesOnStart; config.ShowConfirmExit.Value = ShowConfirmExit; - config.RememberWindowState.Value = RememberWindowState; config.HideCursor.Value = (HideCursorMode)HideCursor; if (_directoryChanged) @@ -498,13 +807,7 @@ namespace Ryujinx.Ava.UI.ViewModels config.UI.GameDirs.Value = gameDirs; } - config.UI.BaseStyle.Value = BaseStyleIndex switch - { - 0 => "Auto", - 1 => "Light", - 2 => "Dark", - _ => "Auto" - }; + config.UI.BaseStyle.Value = BaseStyleIndex == 0 ? "Light" : "Dark"; // Keyboard Hotkeys config.Hid.Hotkeys.Value = KeyboardHotkey.GetConfig(); diff --git a/src/Ryujinx/UI/Views/Input/ControllerInputView.axaml.cs b/src/Ryujinx/UI/Views/Input/ControllerInputView.axaml.cs index 477401eeb..d4012c23f 100644 --- a/src/Ryujinx/UI/Views/Input/ControllerInputView.axaml.cs +++ b/src/Ryujinx/UI/Views/Input/ControllerInputView.axaml.cs @@ -71,7 +71,7 @@ namespace Ryujinx.Ava.UI.Views.Input if (e.ButtonValue.HasValue) { var buttonValue = e.ButtonValue.Value; - viewModel.ParentModel.SettingsViewModel.IsModified = true; + //viewModel.ParentModel.SettingsViewModel.CheckIfModified(); switch (button.Name) { diff --git a/src/Ryujinx/UI/Views/Input/KeyboardInputView.axaml b/src/Ryujinx/UI/Views/Input/KeyboardInputView.axaml index e4566f463..4c5aae098 100644 --- a/src/Ryujinx/UI/Views/Input/KeyboardInputView.axaml +++ b/src/Ryujinx/UI/Views/Input/KeyboardInputView.axaml @@ -672,4 +672,4 @@ - \ No newline at end of file + diff --git a/src/Ryujinx/UI/Views/Input/KeyboardInputView.axaml.cs b/src/Ryujinx/UI/Views/Input/KeyboardInputView.axaml.cs index 1a792088e..ff83d487e 100644 --- a/src/Ryujinx/UI/Views/Input/KeyboardInputView.axaml.cs +++ b/src/Ryujinx/UI/Views/Input/KeyboardInputView.axaml.cs @@ -68,7 +68,7 @@ namespace Ryujinx.Ava.UI.Views.Input if (e.ButtonValue.HasValue) { var buttonValue = e.ButtonValue.Value; - viewModel.ParentModel.SettingsViewModel.IsModified = true; + // viewModel.ParentModel.SettingsViewModel.CheckIfModified(); switch (button.Name) { diff --git a/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml.cs b/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml.cs index 58a4b416b..4c91ec99a 100644 --- a/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml.cs +++ b/src/Ryujinx/UI/Views/Input/RumbleInputView.axaml.cs @@ -2,6 +2,7 @@ using Avalonia.Controls; using FluentAvalonia.UI.Controls; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.ViewModels.Input; +using Ryujinx.Ava.UI.ViewModels.Settings; using System.Threading.Tasks; namespace Ryujinx.Ava.UI.Views.Input diff --git a/src/Ryujinx/UI/Views/Settings/SettingsAudioView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsAudioView.axaml index 657e07ee7..1c6a4deb4 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsAudioView.axaml +++ b/src/Ryujinx/UI/Views/Settings/SettingsAudioView.axaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" mc:Ignorable="d" x:DataType="viewModels:SettingsViewModel"> diff --git a/src/Ryujinx/UI/Views/Settings/SettingsCPUView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsCPUView.axaml index c74d3dd57..480b5183a 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsCPUView.axaml +++ b/src/Ryujinx/UI/Views/Settings/SettingsCPUView.axaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" mc:Ignorable="d" x:DataType="viewModels:SettingsViewModel"> diff --git a/src/Ryujinx/UI/Views/Settings/SettingsGraphicsView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsGraphicsView.axaml index 5cffc6848..40f0aa62e 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsGraphicsView.axaml +++ b/src/Ryujinx/UI/Views/Settings/SettingsGraphicsView.axaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" Design.Width="1000" mc:Ignorable="d" x:DataType="viewModels:SettingsViewModel"> diff --git a/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml index bffcada05..795546df6 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml +++ b/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" mc:Ignorable="d" x:DataType="viewModels:SettingsViewModel" diff --git a/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml.cs index fb0fe2bb1..3f6b00e66 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml.cs +++ b/src/Ryujinx/UI/Views/Settings/SettingsHotkeysView.axaml.cs @@ -5,9 +5,9 @@ using Avalonia.Interactivity; using Avalonia.LogicalTree; using Ryujinx.Ava.Input; using Ryujinx.Ava.UI.Helpers; -using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Input; using Ryujinx.Input.Assigner; +using Ryujinx.Ava.UI.ViewModels.Settings; using Key = Ryujinx.Common.Configuration.Hid.Key; namespace Ryujinx.Ava.UI.Views.Settings diff --git a/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml index ff4779a44..6b9c233f5 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml +++ b/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml @@ -7,12 +7,13 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:views="clr-namespace:Ryujinx.Ava.UI.Views.Input" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input" + xmlns:inputViewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models" mc:Ignorable="d" - x:DataType="viewModels:InputViewModel"> + x:DataType="viewModels:SettingsInputViewModel"> - + - + - + diff --git a/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml.cs index e9b5cab73..11325545b 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml.cs +++ b/src/Ryujinx/UI/Views/Settings/SettingsInputView.axaml.cs @@ -1,16 +1,15 @@ using Avalonia.Controls; -using Ryujinx.Ava.UI.ViewModels; -using Ryujinx.Ava.UI.ViewModels.Input; +using Ryujinx.Ava.UI.ViewModels.Settings; namespace Ryujinx.Ava.UI.Views.Settings { public partial class SettingsInputView : UserControl { - private InputViewModel ViewModel { get; set; } + private SettingsInputViewModel ViewModel { get; set; } public SettingsInputView(SettingsViewModel viewModel) { - DataContext = ViewModel = new InputViewModel(this, viewModel); + DataContext = ViewModel = new SettingsInputViewModel(this, viewModel); InitializeComponent(); } diff --git a/src/Ryujinx/UI/Views/Settings/SettingsLoggingView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsLoggingView.axaml index 0fc9ea1bb..828ed6f10 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsLoggingView.axaml +++ b/src/Ryujinx/UI/Views/Settings/SettingsLoggingView.axaml @@ -6,7 +6,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" mc:Ignorable="d" x:DataType="viewModels:SettingsViewModel"> @@ -117,4 +117,4 @@ - \ No newline at end of file + diff --git a/src/Ryujinx/UI/Views/Settings/SettingsNetworkView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsNetworkView.axaml index 67fac192d..15dbf53ff 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsNetworkView.axaml +++ b/src/Ryujinx/UI/Views/Settings/SettingsNetworkView.axaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" mc:Ignorable="d" x:DataType="viewModels:SettingsViewModel"> diff --git a/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml index e6f7c6e46..65a1b99e7 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml +++ b/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" mc:Ignorable="d" x:DataType="viewModels:SettingsViewModel"> @@ -154,7 +154,7 @@ SelectionChanged="TimeZoneBox_OnSelectionChanged" Text="{Binding Path=TimeZone, Mode=OneWay}" TextChanged="TimeZoneBox_OnTextChanged" - ToolTip.Tip="{locale:Locale TimezoneTooltip}" + ToolTip.Tip="{locale:Locale TimezoneTooltip}" ValueMemberBinding="{Binding Mode=OneWay, Converter={StaticResource TimeZone}}" /> @@ -221,4 +221,4 @@ - \ No newline at end of file + diff --git a/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs index 281d24916..6174e0e31 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs +++ b/src/Ryujinx/UI/Views/Settings/SettingsSystemView.axaml.cs @@ -1,5 +1,5 @@ using Avalonia.Controls; -using Ryujinx.Ava.UI.ViewModels; +using Ryujinx.Ava.UI.ViewModels.Settings; using TimeZone = Ryujinx.Ava.UI.Models.TimeZone; namespace Ryujinx.Ava.UI.Views.Settings diff --git a/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml b/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml index f9b9be44b..9e9424b10 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml +++ b/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" mc:Ignorable="d" x:DataType="viewModels:SettingsViewModel"> diff --git a/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs b/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs index 96e14afc5..3a04768ef 100644 --- a/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs +++ b/src/Ryujinx/UI/Views/Settings/SettingsUIView.axaml.cs @@ -2,7 +2,7 @@ using Avalonia.Controls; using Avalonia.Interactivity; using Avalonia.Platform.Storage; using Avalonia.VisualTree; -using Ryujinx.Ava.UI.ViewModels; +using Ryujinx.Ava.UI.ViewModels.Settings; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/src/Ryujinx/UI/Windows/SettingsWindow.axaml b/src/Ryujinx/UI/Windows/SettingsWindow.axaml index 800993532..9170a3750 100644 --- a/src/Ryujinx/UI/Windows/SettingsWindow.axaml +++ b/src/Ryujinx/UI/Windows/SettingsWindow.axaml @@ -7,7 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:window="clr-namespace:Ryujinx.Ava.UI.Windows" - xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" + xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Settings" xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" Width="1100" Height="768" diff --git a/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs b/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs index 5cfba4cef..ce8ba8b35 100644 --- a/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/SettingsWindow.axaml.cs @@ -4,9 +4,9 @@ using FluentAvalonia.Core; using FluentAvalonia.UI.Controls; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.UI.Helpers; -using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.Views.Settings; using Ryujinx.HLE.FileSystem; +using Ryujinx.Ava.UI.ViewModels.Settings; using System; namespace Ryujinx.Ava.UI.Windows