*/
public static GamepadMapping getSettings() {
if (cachedSettings == null) {
LimeLog.info("Reading Gamepad Settings");
File gamepadFile = SettingsManager.getInstance().getGamepadFile();
GamepadMapping savedMapping = (GamepadMapping)SettingsManager.readSettings(gamepadFile, GamepadMapping.class);
cachedSettings = savedMapping;
}
if (cachedSettings == null) {
LimeLog.warning("Unable to get gamepad settings. Using default mapping instead.");
if (System.getProperty("os.name").contains("Windows")) {
cachedSettings = GamepadMapping.getWindowsDefaultMapping();
} else {
cachedSettings = new GamepadMapping();
}
writeSettings(cachedSettings);
}
return cachedSettings;
}