Search in sources :

Example 6 with PacketGuiButtonPress

use of mekanism.common.network.to_server.PacketGuiButtonPress in project Mekanism by mekanism.

the class GuiQIOTileFrequencySelect method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiFrequencySelector<>(this, 17));
    addButton(new MekanismImageButton(this, 6, 6, 14, getButtonLocation("back"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedTileButton.BACK_BUTTON, tile))));
}
Also used : PacketGuiButtonPress(mekanism.common.network.to_server.PacketGuiButtonPress) MekanismImageButton(mekanism.client.gui.element.button.MekanismImageButton)

Example 7 with PacketGuiButtonPress

use of mekanism.common.network.to_server.PacketGuiButtonPress in project Mekanism by mekanism.

the class GuiRobit method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiSecurityTab(this, robit, 120));
    addButton(GuiSideHolder.create(this, 176, 6, 106, false, false, SpecialColors.TAB_ROBIT_MENU));
    addButton(new MekanismImageButton(this, 179, 10, 18, getButtonLocation("main"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_MAIN, robit)), getOnHover(MekanismLang.ROBIT)));
    addButton(new MekanismImageButton(this, 179, 30, 18, getButtonLocation("crafting"), () -> {
        if (shouldOpenGui(RobitGuiType.CRAFTING)) {
            Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_CRAFTING, robit));
        }
    }, getOnHover(MekanismLang.ROBIT_CRAFTING)));
    addButton(new MekanismImageButton(this, 179, 50, 18, getButtonLocation("inventory"), () -> {
        if (shouldOpenGui(RobitGuiType.INVENTORY)) {
            Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_INVENTORY, robit));
        }
    }, getOnHover(MekanismLang.ROBIT_INVENTORY)));
    addButton(new MekanismImageButton(this, 179, 70, 18, getButtonLocation("smelting"), () -> {
        if (shouldOpenGui(RobitGuiType.SMELTING)) {
            Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_SMELTING, robit));
        }
    }, getOnHover(MekanismLang.ROBIT_SMELTING)));
    addButton(new MekanismImageButton(this, 179, 90, 18, getButtonLocation("repair"), () -> {
        if (shouldOpenGui(RobitGuiType.REPAIR)) {
            Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_REPAIR, robit));
        }
    }, getOnHover(MekanismLang.ROBIT_REPAIR)));
}
Also used : PacketGuiButtonPress(mekanism.common.network.to_server.PacketGuiButtonPress) GuiSecurityTab(mekanism.client.gui.element.tab.GuiSecurityTab) MekanismImageButton(mekanism.client.gui.element.button.MekanismImageButton)

Aggregations

PacketGuiButtonPress (mekanism.common.network.to_server.PacketGuiButtonPress)7 MekanismImageButton (mekanism.client.gui.element.button.MekanismImageButton)6 List (java.util.List)2 GuiDigitalSwitch (mekanism.client.gui.element.GuiDigitalSwitch)2 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)2 TranslationButton (mekanism.client.gui.element.button.TranslationButton)2 GuiSlot (mekanism.client.gui.element.slot.GuiSlot)2 GuiSecurityTab (mekanism.client.gui.element.tab.GuiSecurityTab)2 PacketGuiInteract (mekanism.common.network.to_server.PacketGuiInteract)2 MatrixStack (com.mojang.blaze3d.matrix.MatrixStack)1 ArrayList (java.util.ArrayList)1 Nonnull (javax.annotation.Nonnull)1 FloatingLong (mekanism.api.math.FloatingLong)1 ILangEntry (mekanism.api.text.ILangEntry)1 GuiFilterHolder (mekanism.client.gui.GuiFilterHolder)1 SwitchType (mekanism.client.gui.element.GuiDigitalSwitch.SwitchType)1 GuiHorizontalPowerBar (mekanism.client.gui.element.bar.GuiHorizontalPowerBar)1 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)1 FilterButton (mekanism.client.gui.element.button.FilterButton)1 SlotType (mekanism.client.gui.element.slot.SlotType)1