aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Headless.SDL2/Program.cs
diff options
context:
space:
mode:
authorMutantAura <44103205+MutantAura@users.noreply.github.com>2022-01-03 11:49:29 +0000
committerGitHub <noreply@github.com>2022-01-03 12:49:29 +0100
commit686757105c83a1485117ff5f5d30b2fad4df39b1 (patch)
tree0605169608fa384f5d79caa7a924d1771c60d870 /Ryujinx.Headless.SDL2/Program.cs
parent16c649934fde134d7e8fc9539cf562dd129fbaac (diff)
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
Diffstat (limited to 'Ryujinx.Headless.SDL2/Program.cs')
-rw-r--r--Ryujinx.Headless.SDL2/Program.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/Ryujinx.Headless.SDL2/Program.cs b/Ryujinx.Headless.SDL2/Program.cs
index 2b169478..6e2172e3 100644
--- a/Ryujinx.Headless.SDL2/Program.cs
+++ b/Ryujinx.Headless.SDL2/Program.cs
@@ -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;
}