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")
|
||||
.defaultBind(GamepadBinds.DPAD_RIGHT)
|
||||
.category(MISC_CATEGORY)
|
||||
.vanillaOverride(options.keyPlayerList, () -> false)
|
||||
.build());
|
||||
register(VMOUSE_MOVE_UP = ControllerBindingBuilder.create(controller)
|
||||
.identifier("controlify", "vmouse_move_up")
|
||||
|
@ -18,6 +18,7 @@ public class InGameInputHandler {
|
||||
private final Minecraft minecraft;
|
||||
|
||||
private double lookInputX, lookInputY;
|
||||
private boolean shouldShowPlayerList;
|
||||
|
||||
public InGameInputHandler(Controller<?, ?> controller) {
|
||||
this.controller = controller;
|
||||
@ -38,6 +39,8 @@ public class InGameInputHandler {
|
||||
}
|
||||
|
||||
protected void handleKeybinds() {
|
||||
shouldShowPlayerList = false;
|
||||
|
||||
if (Minecraft.getInstance().screen != null)
|
||||
return;
|
||||
|
||||
@ -63,6 +66,8 @@ public class InGameInputHandler {
|
||||
if (controller.bindings().TOGGLE_HUD_VISIBILITY.justPressed()) {
|
||||
minecraft.options.hideGui = !minecraft.options.hideGui;
|
||||
}
|
||||
|
||||
shouldShowPlayerList = controller.bindings().SHOW_PLAYER_LIST.held();
|
||||
}
|
||||
|
||||
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 {
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user