Implement analog stick range modifier (#2783)
* adjust position vector + GUI * remove brackets * Update configuration * Update ConfigurationFileFormat.cs * rebase + review changes * spacing * revert deletion * fix profile loading * spacing * comment spacing
This commit is contained in:
parent
16c649934f
commit
686757105c
7 changed files with 160 additions and 5 deletions
|
@ -196,6 +196,8 @@ namespace Ryujinx.Headless.SDL2
|
|||
ControllerType = ControllerType.JoyconPair,
|
||||
DeadzoneLeft = 0.1f,
|
||||
DeadzoneRight = 0.1f,
|
||||
RangeLeft = 1.0f,
|
||||
RangeRight = 1.0f,
|
||||
TriggerThreshold = 0.5f,
|
||||
LeftJoycon = new LeftJoyconCommonConfig<ConfigGamepadInputId>
|
||||
{
|
||||
|
@ -299,6 +301,18 @@ namespace Ryujinx.Headless.SDL2
|
|||
|
||||
Logger.Info?.Print(LogClass.Application, $"{config.PlayerIndex} configured with {inputTypeName} \"{config.Id}\"");
|
||||
|
||||
// If both stick ranges are 0 (usually indicative of an outdated profile load) then both sticks will be set to 1.0.
|
||||
if (config is StandardControllerInputConfig controllerConfig)
|
||||
{
|
||||
if (controllerConfig.RangeLeft <= 0.0f && controllerConfig.RangeRight <= 0.0f)
|
||||
{
|
||||
controllerConfig.RangeLeft = 1.0f;
|
||||
controllerConfig.RangeRight = 1.0f;
|
||||
|
||||
Logger.Info?.Print(LogClass.Application, $"{config.PlayerIndex} stick range reset. Save the profile now to update your configuration");
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue