From e7da8e04dacd93956b2a5f011fda702ae4054dfc Mon Sep 17 00:00:00 2001 From: Thiakil Date: Wed, 28 Aug 2024 19:48:19 +0800 Subject: [PATCH] WIP gui for toggling RR --- .../client/gui/element/window/GuiTransporterConfig.java | 3 +++ .../mekanism/common/network/to_server/PacketGuiInteract.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/mekanism/client/gui/element/window/GuiTransporterConfig.java b/src/main/java/mekanism/client/gui/element/window/GuiTransporterConfig.java index d0f6df8d411..12bea87cad4 100644 --- a/src/main/java/mekanism/client/gui/element/window/GuiTransporterConfig.java +++ b/src/main/java/mekanism/client/gui/element/window/GuiTransporterConfig.java @@ -47,6 +47,9 @@ public GuiTransporterConfig(IGuiWrapper gui, int x, int y, TILE tile, SelectedWi addChild(new ColorButton(gui, relativeX + 112, relativeY + 49, 16, 16, () -> this.tile.getEjector().getOutputColor(), (element, mouseX, mouseY) -> PacketUtils.sendToServer(new PacketEjectColor(this.tile.getBlockPos(), MekClickType.left(Screen.hasShiftDown()))), (element, mouseX, mouseY) -> PacketUtils.sendToServer(new PacketEjectColor(this.tile.getBlockPos(), MekClickType.RIGHT)))); + addChild(new MekanismImageButton(gui, relativeX + 136, relativeY + 20, 14, getButtonLocation("round_robin"), + (element, mouseX, mouseY) -> PacketUtils.sendToServer(new PacketGuiInteract(GuiInteraction.ROUND_ROBIN_BUTTON, this.tile)))) + .setTooltip(MekanismLang.SORTER_ROUND_ROBIN_DESCRIPTION); addSideDataButton(RelativeSide.BOTTOM, 41, 64 + 16); addSideDataButton(RelativeSide.TOP, 41, 34); addSideDataButton(RelativeSide.FRONT, 41, 57); diff --git a/src/main/java/mekanism/common/network/to_server/PacketGuiInteract.java b/src/main/java/mekanism/common/network/to_server/PacketGuiInteract.java index 21c16c54537..3e9e80754b1 100644 --- a/src/main/java/mekanism/common/network/to_server/PacketGuiInteract.java +++ b/src/main/java/mekanism/common/network/to_server/PacketGuiInteract.java @@ -30,6 +30,7 @@ import mekanism.common.tile.machine.TileEntityDigitalMiner; import mekanism.common.tile.machine.TileEntityDimensionalStabilizer; import mekanism.common.tile.machine.TileEntityFormulaicAssemblicator; +import mekanism.common.tile.prefab.TileEntityConfigurableMachine; import mekanism.common.tile.qio.TileEntityQIODashboard; import mekanism.common.tile.qio.TileEntityQIOExporter; import mekanism.common.tile.qio.TileEntityQIOImporter; @@ -415,6 +416,8 @@ public enum GuiInteraction {//TODO: Cleanup this enum/the elements in it as it i ROUND_ROBIN_BUTTON((tile, player, extra) -> { if (tile instanceof IAdvancedTransportEjector sorter) { sorter.toggleRoundRobin(); + } else if (tile instanceof TileEntityConfigurableMachine machine) { + machine.getEjector().toggleRoundRobin(); } }), SINGLE_ITEM_BUTTON((tile, player, extra) -> {