Use the joystick's name in new gamepad mappings, when possible. Resolves issue #1370.

This commit is contained in:
Alex Szpakowski
2018-02-16 18:20:35 -04:00
parent 1916c2a5fa
commit 8e83834722
+12 -2
View File
@@ -199,8 +199,18 @@ bool JoystickModule::setGamepadMapping(const std::string &guid, Joystick::Gamepa
}
else
{
// Use a generic name if we have to create a new mapping string.
mapstr = guid + ",Controller,";
std::string name = "Controller";
for (love::joystick::Joystick *stick : joysticks)
{
if (stick->getGUID() == guid)
{
name = stick->getName();
break;
}
}
mapstr = guid + "," + name + ",";
}
std::stringstream joyinputstream;