Compare commits

..
Author SHA1 Message Date
Martin Robertz 8bc00f94fd Merge remote-tracking branch 'origin/adjust-NEI-overlay-to-gt-oregen-changes' into dev 2023-06-16 20:34:17 +02:00
chochem 12cc231224 fix fieldname 2023-06-14 17:36:57 +01:00
glowredman 7612571e97 Adjust to changed oregenPattern API 2023-06-14 17:15:00 +02:00
glowredman c7c82407ef Update buildscript 2023-06-14 17:13:01 +02:00
chochem d90fcdc40c remove testing debug 2023-06-13 02:00:10 +01:00
chochem edc0e689b1 add compat for old worlds 2023-06-13 02:00:10 +01:00
chochem dff048466b adjust to oregen changes 2023-06-13 02:00:10 +01:00
2 changed files with 9 additions and 15 deletions

No files matched your search

@@ -388,22 +388,10 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
// the value of the height field will be different from in other mouseover methods, which
// could be confusing...
// First, invoke scroll handling over recipe handler tabbar. Makes sure it is not overwritten by recipe
// handler-specific scroll behavior.
if (recipeTabs.mouseScrolled(i)) return;
for (int recipe : getRecipeIndices()) if (handler.mouseScrolled(this, i, recipe)) return;
// If shift is held, try switching to the next recipe handler. Replicates the GuiRecipeTabs.mouseScrolled()
// without the checking for the cursor being inside the tabbar.
if (NEIClientUtils.shiftKey()) {
if (i < 0) nextType();
else prevType();
if (recipeTabs.mouseScrolled(i)) return;
return;
}
// Finally, if nothing else has handled scrolling, try changing to the next recipe page.
if (new Rectangle(guiLeft, guiTop, xSize, ySize).contains(GuiDraw.getMousePosition())) {
if (i > 0) prevPage();
else nextPage();
@@ -6,6 +6,8 @@ import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import org.lwjgl.input.Keyboard;
import codechicken.nei.Button;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.NEIClientUtils;
@@ -198,8 +200,12 @@ public class GuiRecipeTabs {
protected boolean mouseScrolled(int i) {
Point mousePosition = getMousePosition();
// Switch between recipe handlers if the cursor is over the tabbar.
if (NEIClientConfig.areJEIStyleTabsVisible() && area.contains(mousePosition)) {
// Switch recipe handler tabs if either left shift is held or the tab
// bar is enable and the mouse cursor is positioned over said tab bar.
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || (NEIClientConfig.areJEIStyleTabsVisible()
&& (mousePosition.x >= area.x && mousePosition.x <= (area.x + area.width)
&& mousePosition.y >= area.y
&& mousePosition.y <= (area.y + area.height)))) {
if (i < 0) guiRecipe.nextType();
else guiRecipe.prevType();