From 1a4b36a327841a9ed9d3f0006e00908d5bce643a Mon Sep 17 00:00:00 2001 From: raaaaaven <168305416+raaaaaven@users.noreply.github.com> Date: Mon, 6 May 2024 16:03:31 +0100 Subject: Feature: Hide tooltips while in the Harp. (#1700) Co-authored-by: raven --- .../config/features/inventory/helper/HelperConfig.java | 6 ++++++ .../at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt | 11 +++++++++++ 2 files changed, 17 insertions(+) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/helper/HelperConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/helper/HelperConfig.java index a8a38af68..0960c46b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/helper/HelperConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/helper/HelperConfig.java @@ -35,6 +35,12 @@ public class HelperConfig { @ConfigEditorBoolean public boolean showNumbers = false; + @Expose + @ConfigOption(name = "Hide Tooltip", desc = "Hides the item tooltips inside the Harp.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideMelodyTooltip = false; + @Expose @ConfigOption(name = "Keybinds", desc = "") @Accordion diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt index 71ce9c41e..70fd79ab9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent +import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.InventoryUtils @@ -20,6 +21,7 @@ import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.client.Minecraft import net.minecraft.client.gui.ScaledResolution import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.client.player.inventory.ContainerLocalMenu import net.minecraft.item.Item import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.network.FMLNetworkEvent @@ -201,4 +203,13 @@ object HarpFeatures { event.move(2, "misc.harpKeybinds", "inventory.helper.harp.keybinds") event.move(2, "misc.harpNumbers", "inventory.helper.harp.showNumbers") } + + @SubscribeEvent + fun onTooltip(event: LorenzToolTipEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!config.hideMelodyTooltip) return + if (!isHarpGui(InventoryUtils.openInventoryName())) return + if (event.slot.inventory !is ContainerLocalMenu) return + event.cancel() + } } -- cgit