forked from Clones/Controlify
more themes, fix input events passing to ingame from screen, changelog, fix button guide sneak wrong in some places
This commit is contained in:
@ -16,7 +16,7 @@ public class ControllerPlayerMovement extends Input {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(boolean slowDown, float f) {
|
||||
public void tick(boolean slowDown, float movementMultiplier) {
|
||||
if (Minecraft.getInstance().screen != null || player == null) {
|
||||
this.up = false;
|
||||
this.down = false;
|
||||
@ -46,19 +46,25 @@ public class ControllerPlayerMovement extends Input {
|
||||
}
|
||||
|
||||
if (slowDown) {
|
||||
this.leftImpulse *= f;
|
||||
this.forwardImpulse *= f;
|
||||
this.leftImpulse *= movementMultiplier;
|
||||
this.forwardImpulse *= movementMultiplier;
|
||||
}
|
||||
|
||||
if (!this.jumping && bindings.JUMP.justPressed())
|
||||
// this over-complication is so exiting a GUI with the button still held doesn't trigger a jump.
|
||||
if (bindings.JUMP.justPressed())
|
||||
this.jumping = true;
|
||||
else
|
||||
this.jumping = bindings.JUMP.held();
|
||||
if (!bindings.JUMP.held())
|
||||
this.jumping = false;
|
||||
|
||||
if (player.getAbilities().flying || player.isInWater() || !controller.config().toggleSneak) {
|
||||
this.shiftKeyDown = bindings.SNEAK.held();
|
||||
if (player.getAbilities().flying || (player.isInWater() && !player.isOnGround()) || !controller.config().toggleSneak) {
|
||||
if (bindings.SNEAK.justPressed())
|
||||
this.shiftKeyDown = true;
|
||||
if (!bindings.SNEAK.held())
|
||||
this.shiftKeyDown = false;
|
||||
} else {
|
||||
this.shiftKeyDown = Minecraft.getInstance().options.keyShift.isDown();
|
||||
if (bindings.SNEAK.justPressed()) {
|
||||
this.shiftKeyDown = !this.shiftKeyDown;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -154,13 +154,10 @@ public class InGameButtonGuide implements IngameGuideRegistry {
|
||||
return Optional.of(Component.translatable("controlify.guide.dismount"));
|
||||
if (player.getAbilities().flying)
|
||||
return Optional.of(Component.translatable("controlify.guide.fly_down"));
|
||||
if (player.isInWater())
|
||||
if (player.isInWater() && !player.isOnGround())
|
||||
return Optional.of(Component.translatable("controlify.guide.swim_down"));
|
||||
if (ctx.controller().config().toggleSneak) {
|
||||
if (player.input.shiftKeyDown)
|
||||
return Optional.of(Component.translatable("controlify.guide.stop_sneaking"));
|
||||
else
|
||||
return Optional.of(Component.translatable("controlify.guide.start_sneaking"));
|
||||
return Optional.of(Component.translatable(player.input.shiftKeyDown ? "controlify.guide.stop_sneaking" : "controlify.guide.start_sneaking"));
|
||||
} else {
|
||||
if (!player.input.shiftKeyDown)
|
||||
return Optional.of(Component.translatable("controlify.guide.sneak"));
|
||||
|
Reference in New Issue
Block a user