forked from Clones/Controlify
✏️ Remove vanilla override from show player list
This commit is contained in:
@ -240,7 +240,6 @@ public class ControllerBindings<T extends ControllerState> {
|
|||||||
.identifier("controlify", "show_player_list")
|
.identifier("controlify", "show_player_list")
|
||||||
.defaultBind(GamepadBinds.DPAD_RIGHT)
|
.defaultBind(GamepadBinds.DPAD_RIGHT)
|
||||||
.category(MISC_CATEGORY)
|
.category(MISC_CATEGORY)
|
||||||
.vanillaOverride(options.keyPlayerList, () -> false)
|
|
||||||
.build());
|
.build());
|
||||||
register(VMOUSE_MOVE_UP = ControllerBindingBuilder.create(controller)
|
register(VMOUSE_MOVE_UP = ControllerBindingBuilder.create(controller)
|
||||||
.identifier("controlify", "vmouse_move_up")
|
.identifier("controlify", "vmouse_move_up")
|
||||||
|
@ -18,6 +18,7 @@ public class InGameInputHandler {
|
|||||||
private final Minecraft minecraft;
|
private final Minecraft minecraft;
|
||||||
|
|
||||||
private double lookInputX, lookInputY;
|
private double lookInputX, lookInputY;
|
||||||
|
private boolean shouldShowPlayerList;
|
||||||
|
|
||||||
public InGameInputHandler(Controller<?, ?> controller) {
|
public InGameInputHandler(Controller<?, ?> controller) {
|
||||||
this.controller = controller;
|
this.controller = controller;
|
||||||
@ -38,6 +39,8 @@ public class InGameInputHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void handleKeybinds() {
|
protected void handleKeybinds() {
|
||||||
|
shouldShowPlayerList = false;
|
||||||
|
|
||||||
if (Minecraft.getInstance().screen != null)
|
if (Minecraft.getInstance().screen != null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -63,6 +66,8 @@ public class InGameInputHandler {
|
|||||||
if (controller.bindings().TOGGLE_HUD_VISIBILITY.justPressed()) {
|
if (controller.bindings().TOGGLE_HUD_VISIBILITY.justPressed()) {
|
||||||
minecraft.options.hideGui = !minecraft.options.hideGui;
|
minecraft.options.hideGui = !minecraft.options.hideGui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shouldShowPlayerList = controller.bindings().SHOW_PLAYER_LIST.held();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void handlePlayerLookInput() {
|
protected void handlePlayerLookInput() {
|
||||||
@ -131,6 +136,10 @@ public class InGameInputHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean shouldShowPlayerList() {
|
||||||
|
return this.shouldShowPlayerList;
|
||||||
|
}
|
||||||
|
|
||||||
public record FunctionalLookInputModifier(BiFunction<Float, Controller<?, ?>, Float> x, BiFunction<Float, Controller<?, ?>, Float> y) implements LookInputModifier {
|
public record FunctionalLookInputModifier(BiFunction<Float, Controller<?, ?>, Float> x, BiFunction<Float, Controller<?, ?>, Float> y) implements LookInputModifier {
|
||||||
@Override
|
@Override
|
||||||
public float modifyX(float x, Controller<?, ?> controller) {
|
public float modifyX(float x, Controller<?, ?> controller) {
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package dev.isxander.controlify.mixins.core;
|
||||||
|
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||||
|
import dev.isxander.controlify.Controlify;
|
||||||
|
import dev.isxander.controlify.ingame.InGameInputHandler;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
|
||||||
|
@Mixin(Gui.class)
|
||||||
|
public class GuiMixin {
|
||||||
|
@ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/KeyMapping;isDown()Z"))
|
||||||
|
private boolean shouldShowPlayerList(boolean keyDown) {
|
||||||
|
return keyDown || Controlify.instance().inGameInputHandler().map(InGameInputHandler::shouldShowPlayerList).orElse(false);
|
||||||
|
}
|
||||||
|
}
|
@ -23,6 +23,7 @@
|
|||||||
"compat.yacl.SliderControllerElementMixin",
|
"compat.yacl.SliderControllerElementMixin",
|
||||||
"compat.yacl.YACLScreenMixin",
|
"compat.yacl.YACLScreenMixin",
|
||||||
"core.ClientPacketListenerMixin",
|
"core.ClientPacketListenerMixin",
|
||||||
|
"core.GuiMixin",
|
||||||
"core.KeyboardHandlerMixin",
|
"core.KeyboardHandlerMixin",
|
||||||
"core.MinecraftMixin",
|
"core.MinecraftMixin",
|
||||||
"core.MouseHandlerMixin",
|
"core.MouseHandlerMixin",
|
||||||
|
Reference in New Issue
Block a user