Search in sources :

Example 1 with BooleanProperty

use of network.rs485.logisticspipes.property.BooleanProperty in project LogisticsPipes by RS485.

the class GuiSupplierPipe method actionPerformed.

@Override
protected void actionPerformed(GuiButton guibutton) throws IOException {
    if (guibutton.id == 0) {
        if (hasPatternUpgrade) {
            final PatternMode newMode = patternModeOverlay.write(EnumProperty::next);
            buttonList.get(0).displayString = newMode.toString();
        } else {
            final SupplyMode newMode = requestModeOverlay.write(EnumProperty::next);
            buttonList.get(0).displayString = newMode.toString();
        }
    } else if (hasPatternUpgrade) {
        if (guibutton.id == 1) {
            limitedPropertyOverlay.write(BooleanProperty::toggle);
            buttonList.get(1).displayString = getLimitationText();
        } else if (guibutton.id >= 2 && guibutton.id <= 10) {
            MainProxy.sendPacketToServer(PacketHandler.getPacket(SlotFinderOpenGuiPacket.class).setSlot(guibutton.id - 2).setModulePos(supplierModule));
        }
    }
    super.actionPerformed(guibutton);
}
Also used : EnumProperty(network.rs485.logisticspipes.property.EnumProperty) PatternMode(logisticspipes.modules.ModuleActiveSupplier.PatternMode) SlotFinderOpenGuiPacket(logisticspipes.network.packets.pipe.SlotFinderOpenGuiPacket) SupplyMode(logisticspipes.modules.ModuleActiveSupplier.SupplyMode)

Aggregations

PatternMode (logisticspipes.modules.ModuleActiveSupplier.PatternMode)1 SupplyMode (logisticspipes.modules.ModuleActiveSupplier.SupplyMode)1 SlotFinderOpenGuiPacket (logisticspipes.network.packets.pipe.SlotFinderOpenGuiPacket)1 EnumProperty (network.rs485.logisticspipes.property.EnumProperty)1