Fixed not being able to use JEI R and U keys on Grid with tabs, fixes #1499

This commit is contained in:
raoulvdberge
2017-10-29 22:29:31 +01:00
parent fbdc0f4752
commit 15681b6ba4
3 changed files with 7 additions and 12 deletions

View File

@@ -3,6 +3,7 @@
### 1.5.22 ### 1.5.22
- Added oredict, blocking, processing, ore inputs access to OpenComputers API (raoulvdberge) - Added oredict, blocking, processing, ore inputs access to OpenComputers API (raoulvdberge)
- The Crafter can now only store 1 stack size pattern per slot (raoulvdberge) - The Crafter can now only store 1 stack size pattern per slot (raoulvdberge)
- Fixed not being able to use JEI R and U keys on Grid with tabs (raoulvdberge)
### 1.5.21 ### 1.5.21
- Updated Portuguese (Brazilian) translation (Pinz714) - Updated Portuguese (Brazilian) translation (Pinz714)

View File

@@ -335,6 +335,10 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
return inBounds(7, 19 + getTabHeight(), 162, 18 * getVisibleRows(), mouseX, mouseY); return inBounds(7, 19 + getTabHeight(), 162, 18 * getVisibleRows(), mouseX, mouseY);
} }
public int getSlotNumber() {
return slotNumber;
}
private boolean isOverClear(int mouseX, int mouseY) { private boolean isOverClear(int mouseX, int mouseY) {
int y = getTabHeight() + getHeader() + (getVisibleRows() * 18) + 4; int y = getTabHeight() + getHeader() + (getVisibleRows() * 18) + 4;
@@ -400,7 +404,7 @@ public class GuiGrid extends GuiBase implements IGridDisplay {
drawItem(otx + 6, ty + 9 - (!selected ? 3 : 0), tab.getIcon()); drawItem(otx + 6, ty + 9 - (!selected ? 3 : 0), tab.getIcon());
if (inBounds(tx, ty, ContainerGrid.TAB_WIDTH, ContainerGrid.TAB_HEIGHT, mouseX, mouseY)) { if (inBounds(tx, ty, ContainerGrid.TAB_WIDTH, ContainerGrid.TAB_HEIGHT - (selected ? 2 : 7), mouseX, mouseY)) {
tabHovering = index; tabHovering = index;
} }
} }

View File

@@ -26,17 +26,7 @@ public class GuiHandlerGrid implements IAdvancedGuiHandler<GuiGrid> {
mouseY -= gui.getGuiTop(); mouseY -= gui.getGuiTop();
if (gui.getScrollbar() != null && !gui.getSearchField().isFocused() && gui.isOverSlotArea(mouseX, mouseY)) { if (gui.getScrollbar() != null && !gui.getSearchField().isFocused() && gui.isOverSlotArea(mouseX, mouseY)) {
mouseX -= 7; return gui.getSlotNumber() >= 0 && gui.getSlotNumber() < GuiGrid.STACKS.size() ? GuiGrid.STACKS.get(gui.getSlotNumber()).getIngredient() : null;
mouseY -= 19;
int x = mouseX / 18;
int y = mouseY / 18;
y += gui.getScrollbar().getOffset();
int slot = y * 9 + x;
return slot >= 0 && slot < GuiGrid.STACKS.size() ? GuiGrid.STACKS.get(slot).getIngredient() : null;
} }
return null; return null;