Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d0ac83b493 |
@@ -52,7 +52,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
[ObservableProperty] private object _configViewModel;
|
[ObservableProperty] private object _configViewModel;
|
||||||
[ObservableProperty] private string _profileName;
|
[ObservableProperty] private string _profileName;
|
||||||
private bool _isLoaded;
|
private bool _isLoaded;
|
||||||
public bool InitInputPage { get; set; }
|
|
||||||
|
|
||||||
private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
private static readonly InputConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions());
|
||||||
|
|
||||||
@@ -93,8 +92,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
public bool CanClearLed => SelectedGamepad.Name.ContainsIgnoreCase("DualSense");
|
public bool CanClearLed => SelectedGamepad.Name.ContainsIgnoreCase("DualSense");
|
||||||
|
|
||||||
public bool IsModified { get; set; }
|
public bool IsModified { get; set; }
|
||||||
public bool IsInputConfigChanged { get; set; }
|
|
||||||
|
|
||||||
public event Action NotifyChangesEvent;
|
public event Action NotifyChangesEvent;
|
||||||
|
|
||||||
public PlayerIndex PlayerIdChoose
|
public PlayerIndex PlayerIdChoose
|
||||||
@@ -124,12 +121,13 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
}
|
}
|
||||||
_isLoaded = false;
|
_isLoaded = false;
|
||||||
|
|
||||||
LoadConfiguration();
|
LoadConfiguration();
|
||||||
LoadDevice();
|
LoadDevice();
|
||||||
LoadProfiles();
|
LoadProfiles();
|
||||||
|
|
||||||
_isLoaded = true;
|
_isLoaded = true;
|
||||||
|
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -298,10 +296,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
{
|
{
|
||||||
ConfigViewModel = new ControllerInputViewModel(this, new GamepadInputConfig(controllerInputConfig));
|
ConfigViewModel = new ControllerInputViewModel(this, new GamepadInputConfig(controllerInputConfig));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
IsInputConfigChanged |= InitInputPage; // If the field has been changed, the control settings will be overwritten
|
|
||||||
InitInputPage = true; // initialization variable
|
|
||||||
}
|
|
||||||
|
|
||||||
public void LoadDevice()
|
public void LoadDevice()
|
||||||
{
|
{
|
||||||
@@ -822,13 +817,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
{
|
{
|
||||||
IsModified = false;
|
IsModified = false;
|
||||||
|
|
||||||
if (!IsInputConfigChanged)
|
|
||||||
{
|
|
||||||
return; //If the input settings were not touched, then do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
IsInputConfigChanged = false; // Input settings have been changed
|
|
||||||
|
|
||||||
List<InputConfig> newConfig = [];
|
List<InputConfig> newConfig = [];
|
||||||
|
|
||||||
newConfig.AddRange(ConfigurationState.Instance.Hid.InputConfig.Value);
|
newConfig.AddRange(ConfigurationState.Instance.Hid.InputConfig.Value);
|
||||||
|
|||||||
@@ -65,9 +65,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
if (!float.IsNaN(_changeSlider) && _changeSlider != (float)check.Value)
|
if (!float.IsNaN(_changeSlider) && _changeSlider != (float)check.Value)
|
||||||
{
|
{
|
||||||
(DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true;
|
(DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true;
|
||||||
|
|
||||||
FlagInputConfigChanged();
|
|
||||||
|
|
||||||
_changeSlider = (float)check.Value;
|
_changeSlider = (float)check.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,9 +75,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
if (sender is CheckBox { IsPointerOver: true })
|
if (sender is CheckBox { IsPointerOver: true })
|
||||||
{
|
{
|
||||||
(DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true;
|
(DataContext as ControllerInputViewModel)!.ParentModel.IsModified = true;
|
||||||
|
|
||||||
FlagInputConfigChanged();
|
|
||||||
|
|
||||||
_currentAssigner?.Cancel();
|
_currentAssigner?.Cancel();
|
||||||
_currentAssigner = null;
|
_currentAssigner = null;
|
||||||
}
|
}
|
||||||
@@ -108,8 +102,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
|
|
||||||
PointerPressed += MouseClick;
|
PointerPressed += MouseClick;
|
||||||
|
|
||||||
FlagInputConfigChanged();
|
|
||||||
|
|
||||||
ControllerInputViewModel viewModel = (DataContext as ControllerInputViewModel);
|
ControllerInputViewModel viewModel = (DataContext as ControllerInputViewModel);
|
||||||
|
|
||||||
IKeyboard keyboard =
|
IKeyboard keyboard =
|
||||||
@@ -216,11 +208,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FlagInputConfigChanged()
|
|
||||||
{
|
|
||||||
(DataContext as ControllerInputViewModel)!.ParentModel.IsInputConfigChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MouseClick(object sender, PointerPressedEventArgs e)
|
private void MouseClick(object sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
||||||
@@ -252,6 +239,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
{
|
{
|
||||||
gamepad?.ClearLed();
|
gamepad?.ClearLed();
|
||||||
}
|
}
|
||||||
|
|
||||||
_currentAssigner?.Cancel();
|
_currentAssigner?.Cancel();
|
||||||
_currentAssigner = null;
|
_currentAssigner = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
|
|
||||||
if (result == UserResult.Yes)
|
if (result == UserResult.Yes)
|
||||||
{
|
{
|
||||||
ViewModel.InitInputPage = false;
|
|
||||||
ViewModel.Save();
|
ViewModel.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,8 +60,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
|
|
||||||
PointerPressed += MouseClick;
|
PointerPressed += MouseClick;
|
||||||
|
|
||||||
FlagInputConfigChanged();
|
|
||||||
|
|
||||||
if (DataContext is not KeyboardInputViewModel viewModel)
|
if (DataContext is not KeyboardInputViewModel viewModel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -186,11 +184,6 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FlagInputConfigChanged()
|
|
||||||
{
|
|
||||||
(DataContext as KeyboardInputViewModel)!.ParentModel.IsInputConfigChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void MouseClick(object sender, PointerPressedEventArgs e)
|
private void MouseClick(object sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
||||||
|
|||||||
@@ -148,8 +148,11 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
{
|
{
|
||||||
if ((firmwarePath.ExistsAsFile && firmwarePath.Extension is "xci" or "zip") ||
|
if ((firmwarePath.ExistsAsFile && firmwarePath.Extension is "xci" or "zip") ||
|
||||||
firmwarePath.ExistsAsDirectory)
|
firmwarePath.ExistsAsDirectory)
|
||||||
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
ViewModel.HandleFirmwareInstallation(firmwarePath));
|
ViewModel.HandleFirmwareInstallation(firmwarePath));
|
||||||
|
CommandLineState.FirmwareToInstallPathArg = null;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Logger.Notice.Print(LogClass.UI, "Invalid firmware type provided. Path must be a directory, or a .zip or .xci file.");
|
Logger.Notice.Print(LogClass.UI, "Invalid firmware type provided. Path must be a directory, or a .zip or .xci file.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Ryujinx.Ava.Utilities
|
|||||||
public static string OverrideBackendThreading { get; private set; }
|
public static string OverrideBackendThreading { get; private set; }
|
||||||
public static string OverrideHideCursor { get; private set; }
|
public static string OverrideHideCursor { get; private set; }
|
||||||
public static string BaseDirPathArg { get; private set; }
|
public static string BaseDirPathArg { get; private set; }
|
||||||
public static FilePath FirmwareToInstallPathArg { get; private set; }
|
public static FilePath FirmwareToInstallPathArg { get; set; }
|
||||||
public static string Profile { get; private set; }
|
public static string Profile { get; private set; }
|
||||||
public static string LaunchPathArg { get; private set; }
|
public static string LaunchPathArg { get; private set; }
|
||||||
public static string LaunchApplicationId { get; private set; }
|
public static string LaunchApplicationId { get; private set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user