diff options
| author | Hendrik Horstmann <65970327+heinrich26@users.noreply.github.com> | 2023-10-02 21:22:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-02 21:22:12 +0200 |
| commit | 8d742e5a471aa2399cd077a9cda9883a0b7c1bb7 (patch) | |
| tree | 47d176608c20a916999cad24814f5a790f1c6047 /src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java | |
| parent | f877ce10737f657fadab950d7fc7f5aee9e53d6c (diff) | |
| download | notenoughupdates-8d742e5a471aa2399cd077a9cda9883a0b7c1bb7.tar.gz notenoughupdates-8d742e5a471aa2399cd077a9cda9883a0b7c1bb7.tar.bz2 notenoughupdates-8d742e5a471aa2399cd077a9cda9883a0b7c1bb7.zip | |
Scrolling through recipes (#841)
* Enable recipe paging with mouse wheel
* Only scroll while no tooltip is displayed / tooltip-scrolling is disable
* Update GuiItemRecipe.java
Make the comment more clear.
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java index 3627a94e..6dc64ab6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.collect.ImmutableList; import io.github.moulberry.notenoughupdates.NEUManager; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.TooltipTextScrolling; import io.github.moulberry.notenoughupdates.core.util.ArrowPagesUtils; import io.github.moulberry.notenoughupdates.recipes.NeuRecipe; import io.github.moulberry.notenoughupdates.recipes.RecipeHistory; @@ -336,6 +337,17 @@ public class GuiItemRecipe extends GuiScreen { int mouseY = scaledResolution.getScaledHeight() - Mouse.getY() * scaledResolution.getScaledHeight() / Minecraft.getMinecraft().displayHeight - 1; getCurrentRecipe().genericMouseInput(mouseX, mouseY); + + + // Allow Paging with Scroll-Wheel + + // Block scrolling while Tooltip is displayed + if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.scrollableTooltips && + TooltipTextScrolling.didRenderTooltip) return; + + if (Mouse.getEventDWheel() != 0) { + ArrowPagesUtils.onPageSwitchScroll(currentIndex, getCurrentRecipeList().size(), pageChange -> changeRecipe(currentTab, pageChange)); + } } public void arrowKeyboardInput() { |
