Skip to content

Commit

Permalink
yep
Browse files Browse the repository at this point in the history
KrLite committed Jan 13, 2024
1 parent 927d3df commit 739950e
Showing 4 changed files with 21 additions and 8 deletions.
10 changes: 8 additions & 2 deletions src/main/java/net/krlite/taptab/TapTab.java
Original file line number Diff line number Diff line change
@@ -26,14 +26,20 @@ public class TapTab implements ModInitializer {
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_UNKNOWN,
"key." + ID + ".category",
() -> Tooltip.of(Text.of("test"))
() -> Tooltip.of(Text.translatable(
"key." + ID + ".unbound.tooltip",
Text.translatable(MinecraftClient.getInstance().options.playerListKey.getTranslationKey())
))
));
public static final KeyBinding REVERSE_MODIFIER = KeyBindingHelper.registerKeyBinding(new TooltipKeyBinding(
"key." + ID + ".reverse_modifier",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_UNKNOWN,
"key." + ID + ".category",
() -> Tooltip.of(Text.of("test"))
() -> Tooltip.of(Text.translatable(
"key." + ID + ".unbound.tooltip",
Text.translatable(MinecraftClient.getInstance().options.sneakKey.getTranslationKey())
))
));
public static final KeyBinding SLOT_MODIFIER = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key." + ID + ".slot_modifier",
Original file line number Diff line number Diff line change
@@ -19,11 +19,12 @@ public class KeyBindingEntryMixin {
method = "update",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/widget/ButtonWidget;setTooltip(Lnet/minecraft/client/gui/tooltip/Tooltip;)V"
target = "Lnet/minecraft/client/gui/widget/ButtonWidget;setTooltip(Lnet/minecraft/client/gui/tooltip/Tooltip;)V",
ordinal = 1
)
)
private void appendTooltip(ButtonWidget buttonWidget, Tooltip tooltip) {
if (binding instanceof TooltipKeyBinding tooltipKeyBinding && tooltip == null) {
if (binding instanceof TooltipKeyBinding tooltipKeyBinding) {
buttonWidget.setTooltip(tooltipKeyBinding.tooltipSupplier().get());
}
}
7 changes: 5 additions & 2 deletions src/main/resources/assets/taptab/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"key.taptab.category" : "Tap Tab",

"key.taptab.cycle" : "Cycle Hotbar to the Above Line",
"key.taptab.reverse_modifier": "Modifier: Cycle in Reverse Order",
"key.taptab.slot_modifier" : "Modifier: Cycle Only Main Hand"
"key.taptab.reverse_modifier": "Holding: Cycle in Reverse Order",
"key.taptab.slot_modifier" : "Holding: Cycle Only Main Hand",

"key.taptab.unbound.tooltip" : "§7Stay unbound to use key §r[%s]"
}
7 changes: 5 additions & 2 deletions src/main/resources/assets/taptab/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"key.taptab.category" : "Tap Tab",

"key.taptab.cycle" : "循环快捷栏到上方一行",
"key.taptab.reverse_modifier": "修饰键:反方向循环",
"key.taptab.slot_modifier" : "修饰键:只循环主手物品"
"key.taptab.reverse_modifier": "按住:反转循环方向",
"key.taptab.slot_modifier" : "按住:只循环主手物品",

"key.taptab.unbound.tooltip" : "§7保持未绑定以使用按键 §r[%s]"
}

0 comments on commit 739950e

Please sign in to comment.