diff --git a/common/src/main/java/net/blay09/mods/trashslot/client/TrashSlotGuiHandler.java b/common/src/main/java/net/blay09/mods/trashslot/client/TrashSlotGuiHandler.java index 70d0d6c..7a5c22a 100644 --- a/common/src/main/java/net/blay09/mods/trashslot/client/TrashSlotGuiHandler.java +++ b/common/src/main/java/net/blay09/mods/trashslot/client/TrashSlotGuiHandler.java @@ -245,7 +245,8 @@ private static boolean runKeyBindings(Screen screen, int keyCode, int scanCode, hintMessage.withStyle(ChatFormatting.GOLD); showHint(Hints.LOCKED, hintMessage, 5000, true); } else { - var hintMessage = Component.translatable("trashslot.hint.unlocked", ModKeyMappings.keyBindToggleSlotLock.getBinding().key().getDisplayName()); + var hintMessage = Component.translatable("trashslot.hint.unlocked", + ModKeyMappings.keyBindToggleSlotLock.getBinding().key().getDisplayName()); hintMessage.withStyle(ChatFormatting.GOLD); showHint(Hints.UNLOCKED, hintMessage, 5000, true); } @@ -305,8 +306,24 @@ public static void onBackgroundDrawn(ContainerScreenDrawEvent.Background event) } boolean isMouseSlot = screenAccessor.callIsHovering(trashSlot, event.getMouseX(), event.getMouseY()); - if (isMouseSlot && screen.getMenu().getCarried().isEmpty() && trashSlot.hasItem()) { - event.getGuiGraphics().renderTooltip(Minecraft.getInstance().font, trashSlot.getItem(), event.getMouseX(), event.getMouseY()); + if (isMouseSlot) { + if (screen.getMenu().getCarried().isEmpty() && trashSlot.hasItem()) { + event.getGuiGraphics().renderTooltip(Minecraft.getInstance().font, trashSlot.getItem(), event.getMouseX(), event.getMouseY()); + } else { + if (TrashSlotConfig.getActive().instantDeletion) { + event.getGuiGraphics() + .renderTooltip(Minecraft.getInstance().font, + Component.translatable("tooltip.trashslot.destroy_item"), + event.getMouseX(), + event.getMouseY()); + } else { + event.getGuiGraphics() + .renderTooltip(Minecraft.getInstance().font, + Component.translatable("tooltip.trashslot.trash_item"), + event.getMouseX(), + event.getMouseY()); + } + } } } diff --git a/common/src/main/resources/assets/trashslot/lang/en_us.json b/common/src/main/resources/assets/trashslot/lang/en_us.json index 64599b8..540dc7f 100644 --- a/common/src/main/resources/assets/trashslot/lang/en_us.json +++ b/common/src/main/resources/assets/trashslot/lang/en_us.json @@ -22,5 +22,7 @@ "trashslot.hint.deletedWhileHidden": "Item trashed!", "trashslot.hint.deletionDenied": "Item cannot be trashed!", "trashslot.hint.locked": "Trash slot locked. Press %s to unlock it.", - "trashslot.hint.unlocked": "Trash slot unlocked. Press %s to lock it." + "trashslot.hint.unlocked": "Trash slot unlocked. Press %s to lock it.", + "tooltip.trashslot.destroy_item": "Destroy Item", + "tooltip.trashslot.trash_item": "Trash Item" }