From f9a9854ce9f60e8bedf02c7eb9810c3b0f2798ec Mon Sep 17 00:00:00 2001 From: DoKM Date: Sun, 1 Aug 2021 17:42:32 +0200 Subject: Add option to only show tooltips when holding keybind --- .../notenoughupdates/ItemPriceInformation.java | 4 ++++ .../options/seperateSections/TooltipTweaks.java | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'src') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java index 9c2c1ef9..1bca2a84 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java @@ -2,6 +2,7 @@ package io.github.moulberry.notenoughupdates; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.auction.APIManager; +import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.item.ItemStack; @@ -23,6 +24,9 @@ public class ItemPriceInformation { if(stack.getTagCompound().hasKey("disableNeuTooltip") && stack.getTagCompound().getBoolean("disableNeuTooltip")){ return false; } + if(NotEnoughUpdates.INSTANCE.config.tooltipTweaks.disablePriceKey && !KeybindHelper.isKeyDown(NotEnoughUpdates.INSTANCE.config.tooltipTweaks.disablePriceKeyKeybind)){ + return false; + } JsonObject auctionInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAuctionInfo(internalname); JsonObject bazaarInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalname); float lowestBinAvg = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAvgBin(internalname); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java index b7fb3433..71508144 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java @@ -2,6 +2,7 @@ package io.github.moulberry.notenoughupdates.options.seperateSections; import com.google.gson.annotations.Expose; import io.github.moulberry.notenoughupdates.core.config.annotations.*; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; import java.util.Arrays; @@ -60,6 +61,24 @@ public class TooltipTweaks { @ConfigEditorBoolean public boolean showPriceInfoAucItem = true; + @Expose + @ConfigOption( + name = "Price info keybind", + desc = "Only show price info if holding a key." + ) + @ConfigEditorBoolean + public boolean disablePriceKey = false; + + @Expose + @ConfigOption( + name = "Show Price info Keybind", + desc = "Hold this key to show a price info tooltip" + ) + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int disablePriceKeyKeybind = Keyboard.KEY_NONE; + + + @Expose @ConfigOption( name = "Show reforge stats", -- cgit