1
0
forked from Clones/Controlify

joystick axis rendering (no textures), improve config error handling and fix joystick deadzones being unordered

This commit is contained in:
isXander
2023-02-17 00:46:40 +00:00
parent fa1a3331e6
commit 8e31472c07
89 changed files with 169 additions and 104 deletions

View File

@ -5,6 +5,7 @@ import com.google.gson.JsonElement;
import dev.isxander.controlify.bindings.ControllerBindings;
import dev.isxander.controlify.controller.gamepad.GamepadController;
import dev.isxander.controlify.controller.joystick.JoystickController;
import dev.isxander.controlify.debug.DebugProperties;
import org.hid4java.HidDevice;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
@ -24,6 +25,7 @@ public interface Controller<S extends ControllerState, C extends ControllerConfi
C config();
C defaultConfig();
void resetConfig();
void setConfig(Gson gson, JsonElement json);
ControllerType type();
@ -39,7 +41,7 @@ public interface Controller<S extends ControllerState, C extends ControllerConfi
return CONTROLLERS.get(joystickId);
}
if (GLFW.glfwJoystickIsGamepad(joystickId)) {
if (GLFW.glfwJoystickIsGamepad(joystickId) && !DebugProperties.FORCE_JOYSTICK) {
GamepadController controller = new GamepadController(joystickId, device);
CONTROLLERS.put(joystickId, controller);
return controller;
@ -94,6 +96,11 @@ public interface Controller<S extends ControllerState, C extends ControllerConfi
return config;
}
@Override
public void resetConfig() {
}
@Override
public void setConfig(Gson gson, JsonElement json) {