Fix ControllerInputView
This commit is contained in:
parent
2017bfc37d
commit
bc1fd99f93
2 changed files with 8 additions and 8 deletions
|
@ -54,11 +54,11 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly InputViewModel _parentModel;
|
public InputViewModel ParentModel { get; }
|
||||||
|
|
||||||
public ControllerInputViewModel(InputViewModel model, GamepadInputConfig config)
|
public ControllerInputViewModel(InputViewModel model, GamepadInputConfig config)
|
||||||
{
|
{
|
||||||
_parentModel = model;
|
ParentModel = model;
|
||||||
model.NotifyChangesEvent += OnParentModelChanged;
|
model.NotifyChangesEvent += OnParentModelChanged;
|
||||||
OnParentModelChanged();
|
OnParentModelChanged();
|
||||||
Config = config;
|
Config = config;
|
||||||
|
@ -76,9 +76,9 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
||||||
|
|
||||||
public void OnParentModelChanged()
|
public void OnParentModelChanged()
|
||||||
{
|
{
|
||||||
IsLeft = _parentModel.IsLeft;
|
IsLeft = ParentModel.IsLeft;
|
||||||
IsRight = _parentModel.IsRight;
|
IsRight = ParentModel.IsRight;
|
||||||
Image = _parentModel.Image;
|
Image = ParentModel.Image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
||||||
|
|
||||||
var viewModel = (DataContext as ControllerInputViewModel);
|
var viewModel = (DataContext as ControllerInputViewModel);
|
||||||
|
|
||||||
IKeyboard keyboard = (IKeyboard)viewModel.parentModel.AvaloniaKeyboardDriver.GetGamepad("0"); // Open Avalonia keyboard for cancel operations.
|
IKeyboard keyboard = (IKeyboard)viewModel.ParentModel.AvaloniaKeyboardDriver.GetGamepad("0"); // Open Avalonia keyboard for cancel operations.
|
||||||
IButtonAssigner assigner = CreateButtonAssigner(isStick);
|
IButtonAssigner assigner = CreateButtonAssigner(isStick);
|
||||||
|
|
||||||
_currentAssigner.ButtonAssigned += (sender, e) =>
|
_currentAssigner.ButtonAssigned += (sender, e) =>
|
||||||
|
@ -71,7 +71,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
||||||
if (e.ButtonValue.HasValue)
|
if (e.ButtonValue.HasValue)
|
||||||
{
|
{
|
||||||
var buttonValue = e.ButtonValue.Value;
|
var buttonValue = e.ButtonValue.Value;
|
||||||
viewModel.parentModel.IsModified = true;
|
viewModel.ParentModel.IsModified = true;
|
||||||
|
|
||||||
switch (button.Name)
|
switch (button.Name)
|
||||||
{
|
{
|
||||||
|
@ -178,7 +178,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
||||||
{
|
{
|
||||||
IButtonAssigner assigner;
|
IButtonAssigner assigner;
|
||||||
|
|
||||||
assigner = new GamepadButtonAssigner((DataContext as ControllerInputViewModel).parentModel.SelectedGamepad, ((DataContext as ControllerInputViewModel).parentModel.Config as StandardControllerInputConfig).TriggerThreshold, forStick);
|
assigner = new GamepadButtonAssigner((DataContext as ControllerInputViewModel).ParentModel.SelectedGamepad, ((DataContext as ControllerInputViewModel).ParentModel.Config as StandardControllerInputConfig).TriggerThreshold, forStick);
|
||||||
|
|
||||||
return assigner;
|
return assigner;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue