mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-25 14:34:54 +00:00
Adjust recipe handler scrolling again (#393)
* Update buildscript * Rework recipe handler tab scrolling again Move the recipe handler tab scrolling before the handler-specific scrolling again. This ensures that tab scrolling while hovering over the tab bar will always be possible, regardless of how a recipe handler handles scrolling itself. This mostly reverts back to how this feature was implemented originally with one change: the Shift-scrolling behavior is moved outside the recipe tabs scroll handler after the recipe handler-specific scroll handling to prevent this from overwriting any other behavior.
This commit is contained in:
1 parent
f3aa12483d
commit
1ab3350eb8
3 files changed
+24
-16
No files matched your search
@@ -6,8 +6,6 @@ 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;
|
||||
@@ -200,12 +198,8 @@ public class GuiRecipeTabs {
|
||||
protected boolean mouseScrolled(int i) {
|
||||
Point mousePosition = getMousePosition();
|
||||
|
||||
// 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)))) {
|
||||
// Switch between recipe handlers if the cursor is over the tabbar.
|
||||
if (NEIClientConfig.areJEIStyleTabsVisible() && area.contains(mousePosition)) {
|
||||
if (i < 0) guiRecipe.nextType();
|
||||
else guiRecipe.prevType();
|
||||
|
||||
|
||||
Reference in new issue
Block a user