forked from Clones/Controlify
joystick axis rendering (no textures), improve config error handling and fix joystick deadzones being unordered
This commit is contained in:
@ -105,8 +105,14 @@ public class ControlifyConfig {
|
||||
}
|
||||
|
||||
private void applyControllerConfig(Controller<?, ?> controller, JsonObject object) {
|
||||
controller.setConfig(GSON, object.getAsJsonObject("config"));
|
||||
controller.bindings().fromJson(object.getAsJsonObject("bindings"));
|
||||
try {
|
||||
controller.setConfig(GSON, object.getAsJsonObject("config"));
|
||||
controller.bindings().fromJson(object.getAsJsonObject("bindings"));
|
||||
} catch (Exception e) {
|
||||
Controlify.LOGGER.error("Failed to load controller data for " + controller.uid() + ". Resetting to default!", e);
|
||||
controller.resetConfig();
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
public GlobalSettings globalSettings() {
|
||||
|
@ -27,6 +27,7 @@ import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
@ -190,7 +191,8 @@ public class YACLHelper {
|
||||
.collect(Collectors.toMap(
|
||||
i -> joystick.mapping().axis(i).identifier(),
|
||||
i -> i,
|
||||
(x, y) -> x
|
||||
(x, y) -> x,
|
||||
LinkedHashMap::new
|
||||
))
|
||||
.values();
|
||||
var jsCfg = joystick.config();
|
||||
|
Reference in New Issue
Block a user