Ack Suggestions

Remaining ack suggestions

Update src/Ryujinx.Ava/UI/Models/Input/ControllerInputConfig.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

Update src/Ryujinx.Ava/UI/Models/Input/ControllerInputConfig.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>
This commit is contained in:
Isaac Marovitz 2023-05-28 17:44:13 -04:00
parent 71fa81017b
commit 5e8eedae37
6 changed files with 72 additions and 77 deletions

View file

@ -275,8 +275,8 @@
"KeyAltRight": "Alt Right",
"KeyOptLeft": "⌥ Left",
"KeyOptRight": "⌥ Right",
"KeyWinLeft": "Windows Left",
"KeyWinRight": "Windows Right",
"KeyWinLeft": " Left",
"KeyWinRight": " Right",
"KeyCmdLeft": "⌘ Left",
"KeyCmdRight": "⌘ Right",
"KeyMenu": "Menu",

View file

@ -339,7 +339,6 @@ namespace Ryujinx.Ava.UI.Models.Input
set
{
_deadzoneLeft = MathF.Round(value, 3);
OnPropertyChanged();
}
}
@ -351,7 +350,6 @@ namespace Ryujinx.Ava.UI.Models.Input
set
{
_deadzoneRight = MathF.Round(value, 3);
OnPropertyChanged();
}
}
@ -363,7 +361,6 @@ namespace Ryujinx.Ava.UI.Models.Input
set
{
_rangeLeft = MathF.Round(value, 3);
OnPropertyChanged();
}
}
@ -375,7 +372,6 @@ namespace Ryujinx.Ava.UI.Models.Input
set
{
_rangeRight = MathF.Round(value, 3);
OnPropertyChanged();
}
}
@ -387,7 +383,6 @@ namespace Ryujinx.Ava.UI.Models.Input
set
{
_triggerThreshold = MathF.Round(value, 3);
OnPropertyChanged();
}
}
@ -521,7 +516,7 @@ namespace Ryujinx.Ava.UI.Models.Input
ButtonSl = RightButtonSl,
ButtonSr = RightButtonSr,
ButtonR = ButtonR,
ButtonZr = ButtonZr,
ButtonZr = ButtonZr
},
LeftJoyconStick = new JoyconConfigControllerStick<GamepadInputId, StickInputId>
{
@ -529,7 +524,7 @@ namespace Ryujinx.Ava.UI.Models.Input
InvertStickX = LeftInvertStickX,
InvertStickY = LeftInvertStickY,
Rotate90CW = LeftRotate90,
StickButton = LeftStickButton,
StickButton = LeftStickButton
},
RightJoyconStick = new JoyconConfigControllerStick<GamepadInputId, StickInputId>
{
@ -537,7 +532,7 @@ namespace Ryujinx.Ava.UI.Models.Input
InvertStickX = RightInvertStickX,
InvertStickY = RightInvertStickY,
Rotate90CW = RightRotate90,
StickButton = RightStickButton,
StickButton = RightStickButton
},
Rumble = new RumbleConfigController
{
@ -550,7 +545,7 @@ namespace Ryujinx.Ava.UI.Models.Input
DeadzoneRight = DeadzoneRight,
RangeLeft = RangeLeft,
RangeRight = RangeRight,
TriggerThreshold = TriggerThreshold,
TriggerThreshold = TriggerThreshold
};
if (EnableCemuHookMotion)

View file

@ -383,7 +383,7 @@ namespace Ryujinx.Ava.UI.Models.Input
ButtonMinus = ButtonMinus,
ButtonZl = ButtonZl,
ButtonSl = LeftButtonSl,
ButtonSr = LeftButtonSr,
ButtonSr = LeftButtonSr
},
RightJoycon = new RightJoyconCommonConfig<Key>
{

View file

@ -56,6 +56,14 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
public InputViewModel parentModel;
public ControllerInputViewModel(InputViewModel model, ControllerInputConfig config)
{
parentModel = model;
model.NotifyChangesEvent += OnParentModelChanged;
OnParentModelChanged();
Config = config;
}
public async void ShowMotionConfig()
{
await MotionInputView.Show(this);
@ -66,15 +74,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
await RumbleInputView.Show(this);
}
public ControllerInputViewModel(InputViewModel model, ControllerInputConfig config)
{
parentModel = model;
model.NotifyChangesEvent += UpdateParentModelValues;
UpdateParentModelValues();
Config = config;
}
public void UpdateParentModelValues()
public void OnParentModelChanged()
{
IsLeft = parentModel.IsLeft;
IsRight = parentModel.IsRight;

View file

@ -58,12 +58,12 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
public KeyboardInputViewModel(InputViewModel model, KeyboardInputConfig config)
{
parentModel = model;
model.NotifyChangesEvent += UpdateParentModelValues;
UpdateParentModelValues();
model.NotifyChangesEvent += OnParentModelChanged;
OnParentModelChanged();
Config = config;
}
public void UpdateParentModelValues()
public void OnParentModelChanged()
{
IsLeft = parentModel.IsLeft;
IsRight = parentModel.IsRight;

View file

@ -893,7 +893,7 @@ namespace Ryujinx.UI.Windows
}
}
object pressedButton = assigner.GetPressedButton();
string pressedButton = assigner.GetPressedButton().ToString();
Application.Invoke(delegate
{
@ -903,7 +903,7 @@ namespace Ryujinx.UI.Windows
}
else if (pressedButton != "")
{
button.Label = pressedButton.ToString();
button.Label = pressedButton;
}
_middleMousePressed = false;