mirror of
https://github.com/love2d/love.git
synced 2026-08-18 11:44:15 +02:00
Replaced Joystick:saveGamepadMapping with love.joystick.saveGamepadMappings, which saves all gamepad mappings from both recently-used joysticks and recently-modified mappings. saveGamepadMappings returns a string of newline-separated mappings and takes an optional filename argument which writes it to a file.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -57,7 +58,7 @@ public:
|
||||
bool setGamepadMapping(const std::string &guid, Joystick::GamepadInput gpinput, Joystick::JoystickInput joyinput);
|
||||
Joystick::JoystickInput getGamepadMapping(const std::string &guid, Joystick::GamepadInput gpinput);
|
||||
void loadGamepadMappings(const std::string &mappings);
|
||||
std::string saveGamepadMapping(const std::string &pguid);
|
||||
std::string saveGamepadMappings();
|
||||
|
||||
private:
|
||||
|
||||
@@ -76,6 +77,10 @@ private:
|
||||
// Persistent list of all Joysticks which have been connected at some point.
|
||||
std::list<Joystick *> joysticks;
|
||||
|
||||
// Persistent map indicating GUIDs for Gamepads which have been connected or
|
||||
// modified at some point.
|
||||
std::map<std::string, bool> recentGamepadGUIDs;
|
||||
|
||||
}; // JoystickModule
|
||||
|
||||
} // sdl
|
||||
|
||||
Reference in New Issue
Block a user