Migrate NEI-Utilities (#461)

Co-authored-by: slprime <history-21@yandex.ru>
This commit is contained in:
slprimeandslprime authored and GitHub committed 2024-02-21 17:12:28 +01:00
1 parent db1fd255bb
commit f7ba34c0af
10 files changed
+433 -14

No files matched your search

+27 -5
View File
@@ -34,6 +34,7 @@ public class ItemPanel extends PanelWidget {
public Button more;
public Button less;
public ItemQuantityField quantity;
public ItemHistoryPanel historyPanel;
public static class ItemPanelSlot {
@@ -134,6 +135,7 @@ public class ItemPanel extends PanelWidget {
};
quantity = new ItemQuantityField("quantity");
historyPanel = new ItemHistoryPanel();
}
@Deprecated
@@ -191,20 +193,40 @@ public class ItemPanel extends PanelWidget {
less.y = more.y + more.h;
}
return BUTTON_SIZE + 2;
if (NEIClientConfig.showHistoryPanelWidget()) {
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;
}
return quantity.h + PanelWidget.PADDING;
}
@Override
public void setVisible() {
super.setVisible();
if (grid.getPerPage() > 0 && NEIClientConfig.showItemQuantityWidget()) {
LayoutManager.addWidget(more);
LayoutManager.addWidget(less);
LayoutManager.addWidget(quantity);
if (grid.getPerPage() > 0) {
if (NEIClientConfig.showItemQuantityWidget()) {
LayoutManager.addWidget(more);
LayoutManager.addWidget(less);
LayoutManager.addWidget(quantity);
}
if (NEIClientConfig.showHistoryPanelWidget()) {
LayoutManager.addWidget(historyPanel);
}
}
}
@Override
public void resize(GuiContainer gui) {
super.resize(gui);
historyPanel.resize(gui);
}
protected ItemStack getDraggedStackWithQuantity(int mouseDownSlot) {
ItemStack stack = grid.getItem(mouseDownSlot);