1
0
forked from Clones/Controlify

(unused) abstract joystick renderer system + debug logging + tm joystick mapping

This commit is contained in:
isXander
2023-04-14 15:29:52 +01:00
parent 6092c896fe
commit bf874fef4f
25 changed files with 598 additions and 267 deletions

View File

@ -65,7 +65,7 @@ public class GamepadBind implements IBind<GamepadState> {
private ResourceLocation getTexture(BuiltinGamepadTheme theme) {
String themeId = theme.id();
if (theme == BuiltinGamepadTheme.DEFAULT)
themeId = gamepad.type().identifier();
themeId = gamepad.type().themeId();
return new ResourceLocation("controlify", "textures/gui/gamepad/" + themeId + "/" + identifier + ".png");
}

View File

@ -41,7 +41,7 @@ public class JoystickAxisBind implements IBind<JoystickState> {
public void draw(PoseStack matrices, int x, int centerY) {
JoystickMapping mapping = joystick.mapping();
String type = joystick.type().identifier();
String type = joystick.type().themeId();
String axis = mapping.axes()[axisIndex].identifier();
String direction = mapping.axes()[axisIndex].getDirectionIdentifier(axisIndex, this.direction);
var texture = new ResourceLocation("controlify", "textures/gui/joystick/" + type + "/axis_" + axis + "_" + direction + ".png");

View File

@ -30,7 +30,7 @@ public class JoystickButtonBind implements IBind<JoystickState> {
@Override
public void draw(PoseStack matrices, int x, int centerY) {
String type = joystick.type().identifier();
String type = joystick.type().themeId();
String button = joystick.mapping().buttons()[buttonIndex].identifier();
var texture = new ResourceLocation("controlify", "textures/gui/joystick/" + type + "/button_" + button + ".png");

View File

@ -32,7 +32,7 @@ public class JoystickHatBind implements IBind<JoystickState> {
@Override
public void draw(PoseStack matrices, int x, int centerY) {
String type = joystick.type().identifier();
String type = joystick.type().themeId();
String hat = joystick.mapping().hats()[hatIndex].identifier();
String direction = "centered";
if (hatState.isUp())