Propogate those fields i forgot about

This commit is contained in:
Isaac Marovitz 2023-05-18 10:09:20 -04:00 committed by Isaac Marovitz
parent 53bc71f181
commit 281a078773
2 changed files with 93 additions and 85 deletions

View file

@ -474,69 +474,71 @@ namespace Ryujinx.Ava.UI.Models.Input
ControllerType = config.ControllerType; ControllerType = config.ControllerType;
PlayerIndex = config.PlayerIndex; PlayerIndex = config.PlayerIndex;
if (config is StandardControllerInputConfig controllerInput) if (config is not StandardControllerInputConfig controllerInput)
{ {
LeftJoystick = controllerInput.LeftJoyconStick.Joystick; return;
LeftInvertStickX = controllerInput.LeftJoyconStick.InvertStickX; }
LeftInvertStickY = controllerInput.LeftJoyconStick.InvertStickY;
LeftRotate90 = controllerInput.LeftJoyconStick.Rotate90CW;
LeftControllerStickButton = controllerInput.LeftJoyconStick.StickButton;
RightJoystick = controllerInput.RightJoyconStick.Joystick; LeftJoystick = controllerInput.LeftJoyconStick.Joystick;
RightInvertStickX = controllerInput.RightJoyconStick.InvertStickX; LeftInvertStickX = controllerInput.LeftJoyconStick.InvertStickX;
RightInvertStickY = controllerInput.RightJoyconStick.InvertStickY; LeftInvertStickY = controllerInput.LeftJoyconStick.InvertStickY;
RightRotate90 = controllerInput.RightJoyconStick.Rotate90CW; LeftRotate90 = controllerInput.LeftJoyconStick.Rotate90CW;
RightControllerStickButton = controllerInput.RightJoyconStick.StickButton; LeftControllerStickButton = controllerInput.LeftJoyconStick.StickButton;
DpadUp = controllerInput.LeftJoycon.DpadUp; RightJoystick = controllerInput.RightJoyconStick.Joystick;
DpadDown = controllerInput.LeftJoycon.DpadDown; RightInvertStickX = controllerInput.RightJoyconStick.InvertStickX;
DpadLeft = controllerInput.LeftJoycon.DpadLeft; RightInvertStickY = controllerInput.RightJoyconStick.InvertStickY;
DpadRight = controllerInput.LeftJoycon.DpadRight; RightRotate90 = controllerInput.RightJoyconStick.Rotate90CW;
ButtonL = controllerInput.LeftJoycon.ButtonL; RightControllerStickButton = controllerInput.RightJoyconStick.StickButton;
ButtonMinus = controllerInput.LeftJoycon.ButtonMinus;
LeftButtonSl = controllerInput.LeftJoycon.ButtonSl;
LeftButtonSr = controllerInput.LeftJoycon.ButtonSr;
ButtonZl = controllerInput.LeftJoycon.ButtonZl;
ButtonA = controllerInput.RightJoycon.ButtonA; DpadUp = controllerInput.LeftJoycon.DpadUp;
ButtonB = controllerInput.RightJoycon.ButtonB; DpadDown = controllerInput.LeftJoycon.DpadDown;
ButtonX = controllerInput.RightJoycon.ButtonX; DpadLeft = controllerInput.LeftJoycon.DpadLeft;
ButtonY = controllerInput.RightJoycon.ButtonY; DpadRight = controllerInput.LeftJoycon.DpadRight;
ButtonR = controllerInput.RightJoycon.ButtonR; ButtonL = controllerInput.LeftJoycon.ButtonL;
ButtonPlus = controllerInput.RightJoycon.ButtonPlus; ButtonMinus = controllerInput.LeftJoycon.ButtonMinus;
RightButtonSl = controllerInput.RightJoycon.ButtonSl; LeftButtonSl = controllerInput.LeftJoycon.ButtonSl;
RightButtonSr = controllerInput.RightJoycon.ButtonSr; LeftButtonSr = controllerInput.LeftJoycon.ButtonSr;
ButtonZr = controllerInput.RightJoycon.ButtonZr; ButtonZl = controllerInput.LeftJoycon.ButtonZl;
DeadzoneLeft = controllerInput.DeadzoneLeft; ButtonA = controllerInput.RightJoycon.ButtonA;
DeadzoneRight = controllerInput.DeadzoneRight; ButtonB = controllerInput.RightJoycon.ButtonB;
RangeLeft = controllerInput.RangeLeft; ButtonX = controllerInput.RightJoycon.ButtonX;
RangeRight = controllerInput.RangeRight; ButtonY = controllerInput.RightJoycon.ButtonY;
TriggerThreshold = controllerInput.TriggerThreshold; ButtonR = controllerInput.RightJoycon.ButtonR;
ButtonPlus = controllerInput.RightJoycon.ButtonPlus;
RightButtonSl = controllerInput.RightJoycon.ButtonSl;
RightButtonSr = controllerInput.RightJoycon.ButtonSr;
ButtonZr = controllerInput.RightJoycon.ButtonZr;
if (controllerInput.Motion != null) DeadzoneLeft = controllerInput.DeadzoneLeft;
DeadzoneRight = controllerInput.DeadzoneRight;
RangeLeft = controllerInput.RangeLeft;
RangeRight = controllerInput.RangeRight;
TriggerThreshold = controllerInput.TriggerThreshold;
if (controllerInput.Motion != null)
{
EnableMotion = controllerInput.Motion.EnableMotion;
MotionBackend = controllerInput.Motion.MotionBackend;
GyroDeadzone = controllerInput.Motion.GyroDeadzone;
Sensitivity = controllerInput.Motion.Sensitivity;
if (controllerInput.Motion is CemuHookMotionConfigController cemuHook)
{ {
EnableMotion = controllerInput.Motion.EnableMotion; EnableCemuHookMotion = true;
MotionBackend = controllerInput.Motion.MotionBackend; DsuServerHost = cemuHook.DsuServerHost;
GyroDeadzone = controllerInput.Motion.GyroDeadzone; DsuServerPort = cemuHook.DsuServerPort;
Sensitivity = controllerInput.Motion.Sensitivity; Slot = cemuHook.Slot;
AltSlot = cemuHook.AltSlot;
MirrorInput = cemuHook.MirrorInput;
}
if (controllerInput.Motion is CemuHookMotionConfigController cemuHook) if (controllerInput.Rumble != null)
{ {
EnableCemuHookMotion = true; EnableRumble = controllerInput.Rumble.EnableRumble;
DsuServerHost = cemuHook.DsuServerHost; WeakRumble = controllerInput.Rumble.WeakRumble;
DsuServerPort = cemuHook.DsuServerPort; StrongRumble = controllerInput.Rumble.StrongRumble;
Slot = cemuHook.Slot;
AltSlot = cemuHook.AltSlot;
MirrorInput = cemuHook.MirrorInput;
}
if (controllerInput.Rumble != null)
{
EnableRumble = controllerInput.Rumble.EnableRumble;
WeakRumble = controllerInput.Rumble.WeakRumble;
StrongRumble = controllerInput.Rumble.StrongRumble;
}
} }
} }
} }

View file

@ -322,38 +322,44 @@ namespace Ryujinx.Ava.UI.Models.Input
{ {
if (config != null) if (config != null)
{ {
if (config is StandardKeyboardInputConfig keyboardConfig) Id = config.Id;
ControllerType = config.ControllerType;
PlayerIndex = config.PlayerIndex;
if (config is not StandardKeyboardInputConfig keyboardConfig)
{ {
LeftStickUp = keyboardConfig.LeftJoyconStick.StickUp; return;
LeftStickDown = keyboardConfig.LeftJoyconStick.StickDown;
LeftStickLeft = keyboardConfig.LeftJoyconStick.StickLeft;
LeftStickRight = keyboardConfig.LeftJoyconStick.StickRight;
RightStickUp = keyboardConfig.RightJoyconStick.StickUp;
RightStickDown = keyboardConfig.RightJoyconStick.StickDown;
RightStickLeft = keyboardConfig.RightJoyconStick.StickLeft;
RightStickRight = keyboardConfig.RightJoyconStick.StickRight;
DpadUp = keyboardConfig.LeftJoycon.DpadUp;
DpadDown = keyboardConfig.LeftJoycon.DpadDown;
DpadLeft = keyboardConfig.LeftJoycon.DpadLeft;
DpadRight = keyboardConfig.LeftJoycon.DpadRight;
ButtonL = keyboardConfig.LeftJoycon.ButtonL;
ButtonMinus = keyboardConfig.LeftJoycon.ButtonMinus;
LeftButtonSl = keyboardConfig.LeftJoycon.ButtonSl;
LeftButtonSr = keyboardConfig.LeftJoycon.ButtonSr;
ButtonZl = keyboardConfig.LeftJoycon.ButtonZl;
ButtonA = keyboardConfig.RightJoycon.ButtonA;
ButtonB = keyboardConfig.RightJoycon.ButtonB;
ButtonX = keyboardConfig.RightJoycon.ButtonX;
ButtonY = keyboardConfig.RightJoycon.ButtonY;
ButtonR = keyboardConfig.RightJoycon.ButtonR;
ButtonPlus = keyboardConfig.RightJoycon.ButtonPlus;
RightButtonSl = keyboardConfig.RightJoycon.ButtonSl;
RightButtonSr = keyboardConfig.RightJoycon.ButtonSr;
ButtonZr = keyboardConfig.RightJoycon.ButtonZr;
} }
LeftStickUp = keyboardConfig.LeftJoyconStick.StickUp;
LeftStickDown = keyboardConfig.LeftJoyconStick.StickDown;
LeftStickLeft = keyboardConfig.LeftJoyconStick.StickLeft;
LeftStickRight = keyboardConfig.LeftJoyconStick.StickRight;
RightStickUp = keyboardConfig.RightJoyconStick.StickUp;
RightStickDown = keyboardConfig.RightJoyconStick.StickDown;
RightStickLeft = keyboardConfig.RightJoyconStick.StickLeft;
RightStickRight = keyboardConfig.RightJoyconStick.StickRight;
DpadUp = keyboardConfig.LeftJoycon.DpadUp;
DpadDown = keyboardConfig.LeftJoycon.DpadDown;
DpadLeft = keyboardConfig.LeftJoycon.DpadLeft;
DpadRight = keyboardConfig.LeftJoycon.DpadRight;
ButtonL = keyboardConfig.LeftJoycon.ButtonL;
ButtonMinus = keyboardConfig.LeftJoycon.ButtonMinus;
LeftButtonSl = keyboardConfig.LeftJoycon.ButtonSl;
LeftButtonSr = keyboardConfig.LeftJoycon.ButtonSr;
ButtonZl = keyboardConfig.LeftJoycon.ButtonZl;
ButtonA = keyboardConfig.RightJoycon.ButtonA;
ButtonB = keyboardConfig.RightJoycon.ButtonB;
ButtonX = keyboardConfig.RightJoycon.ButtonX;
ButtonY = keyboardConfig.RightJoycon.ButtonY;
ButtonR = keyboardConfig.RightJoycon.ButtonR;
ButtonPlus = keyboardConfig.RightJoycon.ButtonPlus;
RightButtonSl = keyboardConfig.RightJoycon.ButtonSl;
RightButtonSr = keyboardConfig.RightJoycon.ButtonSr;
ButtonZr = keyboardConfig.RightJoycon.ButtonZr;
} }
} }