1
0
forked from Clones/Controlify

vanilla keybind override and config system

This commit is contained in:
isXander
2023-02-01 13:27:21 +00:00
parent aad9447325
commit 89c4409371
19 changed files with 441 additions and 64 deletions

View File

@ -0,0 +1,33 @@
package dev.isxander.controlify.controller;
import dev.isxander.controlify.config.ControlifyConfig;
public class ControllerConfig {
public static final ControllerConfig DEFAULT = new ControllerConfig();
public float leftStickDeadzone = 0.2f;
public float rightStickDeadzone = 0.2f;
// not sure if triggers need deadzones
public float leftTriggerDeadzone = 0.0f;
public float rightTriggerDeadzone = 0.0f;
public float leftTriggerActivationThreshold = 0.5f;
public float rightTriggerActivationThreshold = 0.5f;
public String customName = null;
public void notifyChanged() {
ControlifyConfig.save();
}
public void overwrite(ControllerConfig from) {
this.leftStickDeadzone = from.leftStickDeadzone;
this.rightStickDeadzone = from.rightStickDeadzone;
this.leftTriggerDeadzone = from.leftTriggerDeadzone;
this.rightTriggerDeadzone = from.rightTriggerDeadzone;
this.leftTriggerActivationThreshold = from.leftTriggerActivationThreshold;
this.rightTriggerActivationThreshold = from.rightTriggerActivationThreshold;
this.customName = from.customName;
}
}