aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-07-05 15:31:12 +0800
committershedaniel <daniel@shedaniel.me>2020-07-05 15:31:12 +0800
commit17150bedcdf80944a64e165976cf2491d409b1c0 (patch)
treef71725bf6c37fd2bc82fbf8bf07a4b98ba2d1584 /src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
parentaf1b3f780d8edb361c00421cdd991f3f2b86849c (diff)
downloadRoughlyEnoughItems-17150bedcdf80944a64e165976cf2491d409b1c0.tar.gz
RoughlyEnoughItems-17150bedcdf80944a64e165976cf2491d409b1c0.tar.bz2
RoughlyEnoughItems-17150bedcdf80944a64e165976cf2491d409b1c0.zip
Fix #370 and changes to how screens are handled
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
index 39bb93746..6d75f7d23 100644
--- a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
+++ b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
@@ -258,6 +258,13 @@ public class VillagerRecipeViewingScreen extends Screen implements RecipeScreen
scrollBarAlpha = 1;
return true;
}
+ for (Element entry : children())
+ if (entry.mouseClicked(mouseX, mouseY, int_1)) {
+ setFocused(entry);
+ if (int_1 == 0)
+ setDragging(true);
+ return true;
+ }
return super.mouseClicked(mouseX, mouseY, int_1);
}
@@ -354,12 +361,23 @@ public class VillagerRecipeViewingScreen extends Screen implements RecipeScreen
}
@Override
+ public boolean mouseReleased(double double_1, double double_2, int int_1) {
+ for (Element entry : children())
+ if (entry.mouseReleased(double_1, double_2, int_1))
+ return true;
+ return super.mouseReleased(double_1, double_2, int_1);
+ }
+
+ @Override
public boolean mouseDragged(double mouseX, double mouseY, int int_1, double double_3, double double_4) {
if (scrolling.mouseDragged(mouseX, mouseY, int_1, double_3, double_4)) {
scrollBarAlphaFutureTime = System.currentTimeMillis();
scrollBarAlphaFuture = 1f;
return true;
}
+ for (Element entry : children())
+ if (entry.mouseDragged(mouseX, mouseY, int_1, double_3, double_4))
+ return true;
return super.mouseDragged(mouseX, mouseY, int_1, double_3, double_4);
}