Skip to content

Commit

Permalink
Fix history being hidden when search is centered and item quantity ba…
Browse files Browse the repository at this point in the history
…r is disabled
  • Loading branch information
Caedis committed Mar 7, 2024
1 parent dc400ea commit b63d29d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/java/codechicken/nei/ItemPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ public int getHeight(GuiContainer gui) {
}

protected int resizeFooter(GuiContainer gui) {
if (!NEIClientConfig.showItemQuantityWidget() && NEIClientConfig.isSearchWidgetCentered()) return 0;
if (!NEIClientConfig.showItemQuantityWidget() && NEIClientConfig.isSearchWidgetCentered()
&& !NEIClientConfig.showHistoryPanelWidget()) {
return 0;
}

final int BUTTON_SIZE = 20;
more.w = less.w = BUTTON_SIZE;
Expand Down Expand Up @@ -197,8 +200,13 @@ protected int resizeFooter(GuiContainer gui) {
historyPanel.x = x;
historyPanel.w = w;
historyPanel.h = ItemsGrid.SLOT_SIZE * NEIClientConfig.getIntSetting("inventory.history.useRows");
historyPanel.y = quantity.y - PanelWidget.PADDING - historyPanel.h;
return quantity.h + historyPanel.h + PanelWidget.PADDING * 2;
if (NEIClientConfig.showItemQuantityWidget() || !NEIClientConfig.isSearchWidgetCentered()) {
historyPanel.y = quantity.y - historyPanel.h - PanelWidget.PADDING;
} else {
historyPanel.y = y + h - historyPanel.h - PanelWidget.PADDING;
}
return ((NEIClientConfig.showItemQuantityWidget() || !NEIClientConfig.isSearchWidgetCentered()) ? quantity.h
: 0) + historyPanel.h + PanelWidget.PADDING * 2;
}

return quantity.h + PanelWidget.PADDING;
Expand Down

0 comments on commit b63d29d

Please sign in to comment.