1
0
forked from Clones/Controlify

better theme handling and better mouse hide handling (still not perfect)

This commit is contained in:
isXander
2023-02-03 20:57:42 +00:00
parent c9b0870af3
commit ee774dcfee
14 changed files with 94 additions and 84 deletions

View File

@ -47,7 +47,7 @@ public enum Bind {
}
public ResourceLocation textureLocation(Controller controller) {
return new ResourceLocation("controlify", "textures/gui/buttons/" + controller.config().theme.id(controller) + "/" + identifier + ".png");
return new ResourceLocation("controlify", "textures/gui/buttons/" + controller.config().theme.id() + "/" + identifier + ".png");
}
public static Bind fromIdentifier(String identifier) {

View File

@ -1,28 +0,0 @@
package dev.isxander.controlify.bindings;
import dev.isxander.controlify.controller.Controller;
import dev.isxander.yacl.api.NameableEnum;
import net.minecraft.network.chat.Component;
import java.util.function.Function;
public enum ControllerTheme implements NameableEnum {
AUTO(c -> c.type().theme().id(c)),
XBOX_ONE(c -> "xbox"),
DUALSHOCK4(c -> "dualshock4");
private final Function<Controller, String> idGetter;
ControllerTheme(Function<Controller, String> idGetter) {
this.idGetter = idGetter;
}
public String id(Controller controller) {
return idGetter.apply(controller);
}
@Override
public Component getDisplayName() {
return Component.translatable("controlify.controller_theme." + name().toLowerCase());
}
}