aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2022-10-21 17:51:13 +0200
committerGitHub <noreply@github.com>2022-10-21 17:51:13 +0200
commit742cbb2aed8e45873fdb06366b437d277d019957 (patch)
treeb3fe17442aad89059d7f5610918e49864a961e96 /src
parent78f879c96dc2fee6a86a6803dddff9109d203e4b (diff)
downloadNotEnoughUpdates-742cbb2aed8e45873fdb06366b437d277d019957.tar.gz
NotEnoughUpdates-742cbb2aed8e45873fdb06366b437d277d019957.tar.bz2
NotEnoughUpdates-742cbb2aed8e45873fdb06366b437d277d019957.zip
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>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/InventoryButtons.java13
2 files changed, 14 insertions, 1 deletions
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;
}