Skip to content

Commit

Permalink
WIP gui for toggling RR
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Aug 28, 2024
1 parent d50f97b commit e7da8e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) -> {
Expand Down

0 comments on commit e7da8e0

Please sign in to comment.