forked from Clones/Controlify
better theme handling and better mouse hide handling (still not perfect)
This commit is contained in:
@ -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) {
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user