forked from Clones/Controlify
more button guides
This commit is contained in:
@ -35,7 +35,7 @@ public class InGameButtonGuide implements ButtonGuideRegistry {
|
||||
}
|
||||
|
||||
public void renderHud(PoseStack poseStack, float tickDelta, int width, int height) {
|
||||
if (!controller.config().showGuide || minecraft.screen != null)
|
||||
if (!controller.config().showGuide || minecraft.screen != null || minecraft.options.renderDebug)
|
||||
return;
|
||||
|
||||
{
|
||||
@ -110,6 +110,7 @@ public class InGameButtonGuide implements ButtonGuideRegistry {
|
||||
}
|
||||
|
||||
private void registerDefaultActions() {
|
||||
var options = Minecraft.getInstance().options;
|
||||
registerGuideAction((client, player, level, hitResult, controller) -> {
|
||||
if (player.getAbilities().flying)
|
||||
return Optional.of(new GuideAction(controller.bindings().JUMP, Component.translatable("controlify.guide.fly_up"), ActionLocation.LEFT));
|
||||
@ -146,6 +147,20 @@ public class InGameButtonGuide implements ButtonGuideRegistry {
|
||||
}
|
||||
return Optional.empty();
|
||||
});
|
||||
registerGuideAction((client, player, level, hitResult, controller) -> {
|
||||
if (!options.keySprint.isDown()) {
|
||||
if (!player.input.getMoveVector().equals(Vec2.ZERO)) {
|
||||
if (player.isUnderWater())
|
||||
return Optional.of(new GuideAction(controller.bindings().SPRINT, Component.translatable("controlify.guide.start_swimming"), ActionLocation.LEFT));
|
||||
return Optional.of(new GuideAction(controller.bindings().SPRINT, Component.translatable("controlify.guide.start_sprinting"), ActionLocation.LEFT));
|
||||
}
|
||||
} else if (controller.config().toggleSprint) {
|
||||
if (player.isUnderWater())
|
||||
return Optional.of(new GuideAction(controller.bindings().SPRINT, Component.translatable("controlify.guide.stop_swimming"), ActionLocation.LEFT));
|
||||
return Optional.of(new GuideAction(controller.bindings().SPRINT, Component.translatable("controlify.guide.stop_sprinting"), ActionLocation.LEFT));
|
||||
}
|
||||
return Optional.empty();
|
||||
});
|
||||
registerGuideAction((client, player, level, hitResult, controller) -> {
|
||||
if (client.screen == null)
|
||||
return Optional.of(new GuideAction(controller.bindings().INVENTORY, Component.translatable("controlify.guide.inventory"), ActionLocation.RIGHT));
|
||||
@ -170,6 +185,11 @@ public class InGameButtonGuide implements ButtonGuideRegistry {
|
||||
return Optional.of(new GuideAction(controller.bindings().DROP, Component.translatable("controlify.guide.drop"), ActionLocation.RIGHT));
|
||||
return Optional.empty();
|
||||
});
|
||||
registerGuideAction((client, player, level, hitResult, controller) -> {
|
||||
if (player.hasItemInSlot(EquipmentSlot.MAINHAND) || player.hasItemInSlot(EquipmentSlot.OFFHAND))
|
||||
return Optional.of(new GuideAction(controller.bindings().SWAP_HANDS, Component.translatable("controlify.guide.swap_hands"), ActionLocation.RIGHT));
|
||||
return Optional.empty();
|
||||
});
|
||||
registerGuideAction((client, player, level, hitResult, controller) -> {
|
||||
if (hitResult.getType() == HitResult.Type.BLOCK && player.isCreative())
|
||||
return Optional.of(new GuideAction(controller.bindings().PICK_BLOCK, Component.translatable("controlify.guide.pick_block"), ActionLocation.RIGHT));
|
||||
|
@ -108,6 +108,10 @@
|
||||
"controlify.guide.fly_down": "Fly Down",
|
||||
"controlify.guide.start_sneaking": "Start Sneaking",
|
||||
"controlify.guide.stop_sneaking": "Stop Sneaking",
|
||||
"controlify.guide.start_swimming": "Start Swimming",
|
||||
"controlify.guide.start_sprinting": "Start Sprinting",
|
||||
"controlify.guide.stop_swimming": "Stop Swimming",
|
||||
"controlify.guide.stop_sprinting": "Stop Sprinting",
|
||||
"controlify.guide.sneak": "Sneak",
|
||||
"controlify.guide.dismount": "Dismount",
|
||||
"controlify.guide.swim_down": "Swim Down",
|
||||
|
@ -10,6 +10,7 @@
|
||||
"core.KeyboardHandlerMixin",
|
||||
"core.MinecraftMixin",
|
||||
"core.MouseHandlerMixin",
|
||||
"feature.accessibility.LocalPlayerMixin",
|
||||
"feature.bind.KeyMappingAccessor",
|
||||
"feature.guide.ClientPacketListenerMixin",
|
||||
"feature.guide.GuiMixin",
|
||||
|
Reference in New Issue
Block a user