From 742cbb2aed8e45873fdb06366b437d277d019957 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:51:13 +0200 Subject: Buttons tooltip delay (#302) Added a option to change the delay for rendering the tooltip of new buttons Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../moulberry/notenoughupdates/listener/RenderListener.java | 2 +- .../options/seperateSections/InventoryButtons.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index a49b9e6d..2abb2ee8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -703,7 +703,7 @@ public class RenderListener { buttonHovered = button; } - if (currentTime - buttonHoveredMillis > 600) { + if (currentTime - buttonHoveredMillis > NotEnoughUpdates.INSTANCE.config.inventoryButtons.tooltipDelay) { String command = button.command.trim(); if (!command.startsWith("/")) { command = "/" + command; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/InventoryButtons.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/InventoryButtons.java index 685aeb98..36dd1a01 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/InventoryButtons.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/InventoryButtons.java @@ -23,6 +23,7 @@ import com.google.gson.annotations.Expose; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorBoolean; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorButton; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorDropdown; +import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorSlider; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigOption; public class InventoryButtons { @@ -51,4 +52,16 @@ public class InventoryButtons { values = {"Mouse Down", "Mouse Up"} ) public int clickType = 0; + + @Expose + @ConfigOption( + name = "Tooltip Delay", + desc = "Change the Tooltip Delay in milliseconds" + ) + @ConfigEditorSlider( + minValue = 0, + maxValue = 1500, + minStep = 50 + ) + public int tooltipDelay = 600; } -- cgit