Skip to content

Commit e2d54d5

Browse files
committed
fix scroll bar covering slots
anticipate fix for slot groups + bogosorter
1 parent 4805134 commit e2d54d5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityWorkbench.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,6 @@ public IWidget createRecipeMemoryGrid(PanelSyncManager syncManager) {
341341
}
342342

343343
public IWidget createInventoryPage(PanelSyncManager syncManager) {
344-
var connected = new SlotGroup("connected_inventory", 8, true);
345-
syncManager.registerSlotGroup(connected);
346344

347345
if (this.connectedInventory.getSlots() == 0) {
348346
return Flow.column()
@@ -358,6 +356,10 @@ public IWidget createInventoryPage(PanelSyncManager syncManager) {
358356
// but that causes problems
359357
List<ItemSlot> list = new ArrayList<>(this.connectedInventory.getSlots());
360358

359+
int rowSize = Math.min(this.connectedInventory.getSlots(), 8);
360+
var connected = new SlotGroup("connected_inventory", rowSize, true);
361+
syncManager.registerSlotGroup(connected);
362+
361363
for (int i = 0; i < this.connectedInventory.getSlots(); i++) {
362364
list.add(new ItemSlot()
363365
.setEnabledIf(itemSlot -> {
@@ -387,10 +389,9 @@ public IWidget createInventoryPage(PanelSyncManager syncManager) {
387389
.background(GTGuiTextures.DISPLAY)
388390
.child(new Grid()
389391
.scrollable(new VerticalScrollData(), null)
390-
.coverChildrenWidth()
392+
.width(18 * 8 + 4)
391393
.height(18 * 6)
392-
.minElementMargin(0, 0)
393-
.mapTo(8, list, (index, value) -> value));
394+
.mapTo(rowSize, list));
394395
}
395396

396397
public void sendHandlerToClient(PacketBuffer buffer) {

0 commit comments

Comments
 (0)