Restructure + Ack suggestions

This commit is contained in:
Isaac Marovitz 2023-05-17 11:00:09 -04:00 committed by Isaac Marovitz
parent b71fa3784e
commit 12991ce070
11 changed files with 188 additions and 193 deletions

View file

@ -4,55 +4,10 @@ using Ryujinx.Common.Configuration.Hid.Controller;
using Ryujinx.Common.Configuration.Hid.Controller.Motion; using Ryujinx.Common.Configuration.Hid.Controller.Motion;
using System; using System;
namespace Ryujinx.Ava.UI.Models namespace Ryujinx.Ava.UI.Models.Input
{ {
public class ControllerInputConfig : BaseModel public class ControllerInputConfig : BaseModel
{ {
private StickInputId _leftJoystick;
private bool _leftInvertStickX;
private bool _leftInvertStickY;
private bool _leftRotate90;
private GamepadInputId _leftControllerStickButton;
private StickInputId _rightJoystick;
private bool _rightInvertStickX;
private bool _rightInvertStickY;
private bool _rightRotate90;
private GamepadInputId _rightControllerStickButton;
private GamepadInputId _buttonA;
private GamepadInputId _buttonB;
private GamepadInputId _buttonX;
private GamepadInputId _buttonY;
private GamepadInputId _buttonR;
private GamepadInputId _rightButtonSl;
private GamepadInputId _rightButtonSr;
private GamepadInputId _buttonZr;
private GamepadInputId _buttonPlus;
private GamepadInputId _dpadUp;
private GamepadInputId _dpadDown;
private GamepadInputId _dpadLeft;
private GamepadInputId _dpadRight;
private GamepadInputId _buttonL;
private GamepadInputId _leftButtonSl;
private GamepadInputId _leftButtonSr;
private GamepadInputId _buttonZl;
private GamepadInputId _buttonMinus;
private float _deadzoneLeft;
private float _deadzoneRight;
private float _rangeLeft;
private float _rangeRight;
private float _triggerThreshold;
private double _gyroDeadzone;
private int _sensitivity;
private bool _enableRumble;
private bool _enableMotion;
private float _weakRumble;
private float _strongRumble;
private MotionInputBackendType _motionBackend;
public bool EnableCemuHookMotion { get; set; } public bool EnableCemuHookMotion { get; set; }
public string DsuServerHost { get; set; } public string DsuServerHost { get; set; }
public int DsuServerPort { get; set; } public int DsuServerPort { get; set; }
@ -64,6 +19,7 @@ namespace Ryujinx.Ava.UI.Models
public ControllerType ControllerType { get; set; } public ControllerType ControllerType { get; set; }
public PlayerIndex PlayerIndex { get; set; } public PlayerIndex PlayerIndex { get; set; }
private StickInputId _leftJoystick;
public StickInputId LeftJoystick public StickInputId LeftJoystick
{ {
get => _leftJoystick; get => _leftJoystick;
@ -74,6 +30,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private bool _leftInvertStickX;
public bool LeftInvertStickX public bool LeftInvertStickX
{ {
get => _leftInvertStickX; get => _leftInvertStickX;
@ -84,6 +41,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private bool _leftInvertStickY;
public bool LeftInvertStickY public bool LeftInvertStickY
{ {
get => _leftInvertStickY; get => _leftInvertStickY;
@ -94,6 +52,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private bool _leftRotate90;
public bool LeftRotate90 public bool LeftRotate90
{ {
get => _leftRotate90; get => _leftRotate90;
@ -104,6 +63,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private GamepadInputId _leftControllerStickButton;
public GamepadInputId LeftControllerStickButton public GamepadInputId LeftControllerStickButton
{ {
get => _leftControllerStickButton; get => _leftControllerStickButton;
@ -114,6 +74,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private StickInputId _rightJoystick;
public StickInputId RightJoystick public StickInputId RightJoystick
{ {
get => _rightJoystick; get => _rightJoystick;
@ -124,6 +85,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private bool _rightInvertStickX;
public bool RightInvertStickX public bool RightInvertStickX
{ {
get => _rightInvertStickX; get => _rightInvertStickX;
@ -134,6 +96,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private bool _rightInvertStickY;
public bool RightInvertStickY public bool RightInvertStickY
{ {
get => _rightInvertStickY; get => _rightInvertStickY;
@ -144,6 +107,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private bool _rightRotate90;
public bool RightRotate90 public bool RightRotate90
{ {
get => _rightRotate90; get => _rightRotate90;
@ -154,6 +118,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private GamepadInputId _rightControllerStickButton;
public GamepadInputId RightControllerStickButton public GamepadInputId RightControllerStickButton
{ {
get => _rightControllerStickButton; get => _rightControllerStickButton;
@ -164,96 +129,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
public GamepadInputId ButtonA private GamepadInputId _dpadUp;
{
get => _buttonA;
set
{
_buttonA = value;
OnPropertyChanged();
}
}
public GamepadInputId ButtonB
{
get => _buttonB;
set
{
_buttonB = value;
OnPropertyChanged();
}
}
public GamepadInputId ButtonX
{
get => _buttonX;
set
{
_buttonX = value;
OnPropertyChanged();
}
}
public GamepadInputId ButtonY
{
get => _buttonY;
set
{
_buttonY = value;
OnPropertyChanged();
}
}
public GamepadInputId ButtonR
{
get => _buttonR;
set
{
_buttonR = value;
OnPropertyChanged();
}
}
public GamepadInputId RightButtonSl
{
get => _rightButtonSl;
set
{
_rightButtonSl = value;
OnPropertyChanged();
}
}
public GamepadInputId RightButtonSr
{
get => _rightButtonSr;
set
{
_rightButtonSr = value;
OnPropertyChanged();
}
}
public GamepadInputId ButtonZr
{
get => _buttonZr;
set
{
_buttonZr = value;
OnPropertyChanged();
}
}
public GamepadInputId ButtonPlus
{
get => _buttonPlus;
set
{
_buttonPlus = value;
OnPropertyChanged();
}
}
public GamepadInputId DpadUp public GamepadInputId DpadUp
{ {
get => _dpadUp; get => _dpadUp;
@ -264,6 +140,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private GamepadInputId _dpadDown;
public GamepadInputId DpadDown public GamepadInputId DpadDown
{ {
get => _dpadDown; get => _dpadDown;
@ -274,6 +151,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private GamepadInputId _dpadLeft;
public GamepadInputId DpadLeft public GamepadInputId DpadLeft
{ {
get => _dpadLeft; get => _dpadLeft;
@ -284,6 +162,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private GamepadInputId _dpadRight;
public GamepadInputId DpadRight public GamepadInputId DpadRight
{ {
get => _dpadRight; get => _dpadRight;
@ -294,6 +173,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private GamepadInputId _buttonL;
public GamepadInputId ButtonL public GamepadInputId ButtonL
{ {
get => _buttonL; get => _buttonL;
@ -304,36 +184,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
public GamepadInputId LeftButtonSl private GamepadInputId _buttonMinus;
{
get => _leftButtonSl;
set
{
_leftButtonSl = value;
OnPropertyChanged();
}
}
public GamepadInputId LeftButtonSr
{
get => _leftButtonSr;
set
{
_leftButtonSr = value;
OnPropertyChanged();
}
}
public GamepadInputId ButtonZl
{
get => _buttonZl;
set
{
_buttonZl = value;
OnPropertyChanged();
}
}
public GamepadInputId ButtonMinus public GamepadInputId ButtonMinus
{ {
get => _buttonMinus; get => _buttonMinus;
@ -344,6 +195,139 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private GamepadInputId _leftButtonSl;
public GamepadInputId LeftButtonSl
{
get => _leftButtonSl;
set
{
_leftButtonSl = value;
OnPropertyChanged();
}
}
private GamepadInputId _leftButtonSr;
public GamepadInputId LeftButtonSr
{
get => _leftButtonSr;
set
{
_leftButtonSr = value;
OnPropertyChanged();
}
}
private GamepadInputId _buttonZl;
public GamepadInputId ButtonZl
{
get => _buttonZl;
set
{
_buttonZl = value;
OnPropertyChanged();
}
}
private GamepadInputId _buttonA;
public GamepadInputId ButtonA
{
get => _buttonA;
set
{
_buttonA = value;
OnPropertyChanged();
}
}
private GamepadInputId _buttonB;
public GamepadInputId ButtonB
{
get => _buttonB;
set
{
_buttonB = value;
OnPropertyChanged();
}
}
private GamepadInputId _buttonX;
public GamepadInputId ButtonX
{
get => _buttonX;
set
{
_buttonX = value;
OnPropertyChanged();
}
}
private GamepadInputId _buttonY;
public GamepadInputId ButtonY
{
get => _buttonY;
set
{
_buttonY = value;
OnPropertyChanged();
}
}
private GamepadInputId _buttonR;
public GamepadInputId ButtonR
{
get => _buttonR;
set
{
_buttonR = value;
OnPropertyChanged();
}
}
private GamepadInputId _buttonPlus;
public GamepadInputId ButtonPlus
{
get => _buttonPlus;
set
{
_buttonPlus = value;
OnPropertyChanged();
}
}
private GamepadInputId _rightButtonSl;
public GamepadInputId RightButtonSl
{
get => _rightButtonSl;
set
{
_rightButtonSl = value;
OnPropertyChanged();
}
}
private GamepadInputId _rightButtonSr;
public GamepadInputId RightButtonSr
{
get => _rightButtonSr;
set
{
_rightButtonSr = value;
OnPropertyChanged();
}
}
private GamepadInputId _buttonZr;
public GamepadInputId ButtonZr
{
get => _buttonZr;
set
{
_buttonZr = value;
OnPropertyChanged();
}
}
private float _deadzoneLeft;
public float DeadzoneLeft public float DeadzoneLeft
{ {
get => _deadzoneLeft; get => _deadzoneLeft;
@ -355,6 +339,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private float _deadzoneRight;
public float DeadzoneRight public float DeadzoneRight
{ {
get => _deadzoneRight; get => _deadzoneRight;
@ -366,6 +351,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private float _rangeLeft;
public float RangeLeft public float RangeLeft
{ {
get => _rangeLeft; get => _rangeLeft;
@ -377,6 +363,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private float _rangeRight;
public float RangeRight public float RangeRight
{ {
get => _rangeRight; get => _rangeRight;
@ -388,6 +375,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
private float _triggerThreshold;
public float TriggerThreshold public float TriggerThreshold
{ {
get => _triggerThreshold; get => _triggerThreshold;
@ -399,17 +387,29 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
public int Sensitivity private bool _enableMotion;
public bool EnableMotion
{ {
get => _sensitivity; get => _enableMotion;
set set
{ {
_sensitivity = value; _enableMotion = value;
OnPropertyChanged(); OnPropertyChanged();
} }
} }
private MotionInputBackendType _motionBackend;
public MotionInputBackendType MotionBackend
{
get => _motionBackend;
set
{
_motionBackend = value;
OnPropertyChanged();
}
}
private double _gyroDeadzone;
public double GyroDeadzone public double GyroDeadzone
{ {
get => _gyroDeadzone; get => _gyroDeadzone;
@ -421,16 +421,19 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
public MotionInputBackendType MotionBackend private int _sensitivity;
public int Sensitivity
{ {
get => _motionBackend; get => _sensitivity;
set set
{ {
_motionBackend = value; _sensitivity = value;
OnPropertyChanged(); OnPropertyChanged();
} }
} }
private bool _enableRumble;
public bool EnableRumble public bool EnableRumble
{ {
get => _enableRumble; get => _enableRumble;
@ -441,16 +444,7 @@ namespace Ryujinx.Ava.UI.Models
} }
} }
public bool EnableMotion private float _weakRumble;
{
get => _enableMotion;
set
{
_enableMotion = value;
OnPropertyChanged();
}
}
public float WeakRumble public float WeakRumble
{ {
get => _weakRumble; get => _weakRumble;
@ -460,6 +454,8 @@ namespace Ryujinx.Ava.UI.Models
OnPropertyChanged(); OnPropertyChanged();
} }
} }
private float _strongRumble;
public float StrongRumble public float StrongRumble
{ {
get => _strongRumble; get => _strongRumble;

View file

@ -2,7 +2,7 @@ using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Configuration.Hid;
using Ryujinx.Common.Configuration.Hid.Keyboard; using Ryujinx.Common.Configuration.Hid.Keyboard;
namespace Ryujinx.Ava.UI.Models namespace Ryujinx.Ava.UI.Models.Input
{ {
public class KeyboardInputConfig : BaseModel public class KeyboardInputConfig : BaseModel
{ {

View file

@ -1,5 +1,5 @@
using Avalonia.Svg.Skia; using Avalonia.Svg.Skia;
using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models.Input;
using Ryujinx.Ava.UI.Views.Input; using Ryujinx.Ava.UI.Views.Input;
namespace Ryujinx.Ava.UI.ViewModels.Input namespace Ryujinx.Ava.UI.ViewModels.Input

View file

@ -7,7 +7,6 @@ using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.Input; using Ryujinx.Ava.Input;
using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models;
using Ryujinx.Ava.UI.Views.Input;
using Ryujinx.Ava.UI.Windows; using Ryujinx.Ava.UI.Windows;
using Ryujinx.Common; using Ryujinx.Common;
using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration;

View file

@ -1,5 +1,5 @@
using Avalonia.Svg.Skia; using Avalonia.Svg.Skia;
using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models.Input;
namespace Ryujinx.Ava.UI.ViewModels.Input namespace Ryujinx.Ava.UI.ViewModels.Input
{ {

View file

@ -4,7 +4,7 @@
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"

View file

@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models" xmlns:models="clr-namespace:Ryujinx.Ava.UI.Models"
xmlns:views="clr-namespace:Ryujinx.Ava.UI.Views.Input" xmlns:views="clr-namespace:Ryujinx.Ava.UI.Views.Input"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
d:DesignHeight="800" d:DesignHeight="800"

View file

@ -6,7 +6,7 @@ using Avalonia.LogicalTree;
using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models;
using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.ViewModels.Input;
using Ryujinx.Common.Configuration.Hid.Controller; using Ryujinx.Common.Configuration.Hid.Controller;
using Ryujinx.Input; using Ryujinx.Input;
using Ryujinx.Input.Assigner; using Ryujinx.Input.Assigner;

View file

@ -4,7 +4,7 @@
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"

View file

@ -6,7 +6,7 @@
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls" xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
mc:Ignorable="d" mc:Ignorable="d"
x:Class="Ryujinx.Ava.UI.Views.Input.MotionInputView" x:Class="Ryujinx.Ava.UI.Views.Input.MotionInputView"
x:DataType="viewModels:MotionInputViewModel" x:DataType="viewModels:MotionInputViewModel"

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels" xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
mc:Ignorable="d" mc:Ignorable="d"
x:Class="Ryujinx.Ava.UI.Views.Input.RumbleInputView" x:Class="Ryujinx.Ava.UI.Views.Input.RumbleInputView"
x:DataType="viewModels:RumbleInputViewModel" x:DataType="viewModels:RumbleInputViewModel"