1
0
forked from Clones/Controlify

refactor button guide, bindings and controller identification

This commit is contained in:
isXander
2023-02-19 21:56:14 +00:00
parent 23c048f401
commit 0f719c0f45
21 changed files with 334 additions and 220 deletions

View File

@ -31,9 +31,7 @@ public class JoystickButtonBind implements IBind<JoystickState> {
}
@Override
public void draw(PoseStack matrices, int x, int centerY, Controller<JoystickState, ?> controller) {
if (controller != joystick) return;
public void draw(PoseStack matrices, int x, int centerY) {
String type = joystick.type().identifier();
String button = joystick.mapping().button(buttonIndex).identifier();
var texture = new ResourceLocation("controlify", "textures/gui/joystick/" + type + "/button_" + button + ".png");
@ -56,6 +54,11 @@ public class JoystickButtonBind implements IBind<JoystickState> {
return object;
}
@Override
public Controller<JoystickState, ?> controller() {
return joystick;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;