aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2022-10-31 11:22:06 +0100
committerGitHub <noreply@github.com>2022-10-31 11:22:06 +0100
commit4d7b03d86e24e24952f55da9f2f7ccfa7a624a6e (patch)
tree56afce63eae7125b1fcb9b2221be1583e5cda0f4 /src
parentdcde56974e3ae3b8eb05a1c93ca2a1adbeca01d8 (diff)
downloadNotEnoughUpdates-4d7b03d86e24e24952f55da9f2f7ccfa7a624a6e.tar.gz
NotEnoughUpdates-4d7b03d86e24e24952f55da9f2f7ccfa7a624a6e.tar.bz2
NotEnoughUpdates-4d7b03d86e24e24952f55da9f2f7ccfa7a624a6e.zip
Make recipe tabs work again (#407)
why do people always break my code :sob:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java19
1 files changed, 17 insertions, 2 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 57732583..cc9f36fa 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java
@@ -295,7 +295,7 @@ public class GuiItemRecipe extends GuiScreen {
NotEnoughUpdates.INSTANCE.openGui = RecipeHistory.getNext();
}
- ArrowPagesUtils.onPageSwitchMouse(
+ if (ArrowPagesUtils.onPageSwitchMouse(
guiLeft,
guiTop,
topLeft,
@@ -303,7 +303,22 @@ public class GuiItemRecipe extends GuiScreen {
getCurrentRecipeList().size(),
pageChange ->
changeRecipe(currentTab, pageChange)
- );
+ )) return;
+
+ for (int i = 0; i < tabs.size(); i++) {
+ if (isWithinRect(
+ mouseX - guiLeft,
+ mouseY - guiTop,
+ TAB_POS_X,
+ TAB_POS_Y + TAB_OFFSET_Y * i,
+ TAB_SIZE_X,
+ TAB_SIZE_Y
+ )) {
+ changeRecipe(i, currentIndex);
+ Utils.playPressSound();
+ return;
+ }
+ }
for (RecipeSlot slot : getAllRenderedSlots()) {
if (isWithinRect(mouseX, mouseY, slot.getX(this), slot.getY(this), SLOT_SIZE, SLOT_SIZE)) {