use of mekanism.client.gui.element.button.MekanismImageButton in project Mekanism by mekanism.
the class GuiQIOItemFrequencySelect 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(ClickedItemButton.BACK_BUTTON, menu.getHand()))));
}
use of mekanism.client.gui.element.button.MekanismImageButton in project Mekanism by mekanism.
the class GuiRobitMain 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 GuiInnerScreen(this, 27, 16, 122, 56));
addButton(new GuiHorizontalPowerBar(this, robit.getEnergyContainer(), 27, 74, 120));
addButton(new MekanismImageButton(this, 6, 16, 18, getButtonLocation("home"), () -> {
Mekanism.packetHandler.sendToServer(new PacketRobit(RobitPacketType.GO_HOME, robit));
getMinecraft().setScreen(null);
}, getOnHover(MekanismLang.ROBIT_TELEPORT)));
renameButton = addButton(new MekanismImageButton(this, 6, 35, 18, getButtonLocation("rename"), () -> openWindow(new GuiRobitRename(this, 27, 16, robit), () -> renameButton), getOnHover(MekanismLang.ROBIT_RENAME)));
skinButton = addButton(new MekanismImageButton(this, 6, 54, 18, getButtonLocation("skin"), () -> openWindow(new GuiRobitSkinSelect(this, 4, -12, robit), () -> skinButton), getOnHover(MekanismLang.ROBIT_SKIN_SELECT)));
addButton(new MekanismImageButton(this, 152, 35, 18, getButtonLocation("drop"), () -> Mekanism.packetHandler.sendToServer(new PacketRobit(RobitPacketType.DROP_PICKUP, robit)), getOnHover(MekanismLang.ROBIT_TOGGLE_PICKUP)));
addButton(new MekanismImageButton(this, 152, 54, 18, getButtonLocation("follow"), () -> Mekanism.packetHandler.sendToServer(new PacketRobit(RobitPacketType.FOLLOW, robit)), getOnHover(MekanismLang.ROBIT_TOGGLE_FOLLOW)));
addButton(new MekanismImageButton(this, 179, 10, 18, getButtonLocation("main"), () -> {
// Clicking main button doesn't do anything while already on the main GUI
}, getOnHover(MekanismLang.ROBIT)));
addButton(new MekanismImageButton(this, 179, 30, 18, getButtonLocation("crafting"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_CRAFTING, robit)), getOnHover(MekanismLang.ROBIT_CRAFTING)));
addButton(new MekanismImageButton(this, 179, 50, 18, getButtonLocation("inventory"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_INVENTORY, robit)), getOnHover(MekanismLang.ROBIT_INVENTORY)));
addButton(new MekanismImageButton(this, 179, 70, 18, getButtonLocation("smelting"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_SMELTING, robit)), getOnHover(MekanismLang.ROBIT_SMELTING)));
addButton(new MekanismImageButton(this, 179, 90, 18, getButtonLocation("repair"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_REPAIR, robit)), getOnHover(MekanismLang.ROBIT_REPAIR)));
}
use of mekanism.client.gui.element.button.MekanismImageButton in project Mekanism by mekanism.
the class GuiLogisticalSorter method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiSlot(SlotType.NORMAL, this, 12, 136).setRenderAboveSlots());
addButton(new TranslationButton(this, 56, 136, 96, 20, MekanismLang.BUTTON_NEW_FILTER, () -> addWindow(new GuiSorterFilerSelect(this, tile))));
addButton(new MekanismImageButton(this, 12, 58, 14, getButtonLocation("single"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.SINGLE_ITEM_BUTTON, tile)), getOnHover(MekanismLang.SORTER_SINGLE_ITEM_DESCRIPTION)));
addButton(new MekanismImageButton(this, 12, 84, 14, getButtonLocation("round_robin"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.ROUND_ROBIN_BUTTON, tile)), getOnHover(MekanismLang.SORTER_ROUND_ROBIN_DESCRIPTION)));
addButton(new MekanismImageButton(this, 12, 110, 14, getButtonLocation("auto_eject"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.AUTO_EJECT_BUTTON, tile)), getOnHover(MekanismLang.SORTER_AUTO_EJECT_DESCRIPTION)));
addButton(new ColorButton(this, 13, 137, 16, 16, () -> tile.color, () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.CHANGE_COLOR, tile, hasShiftDown() ? -1 : TransporterUtils.getColorIndex(TransporterUtils.increment(tile.color)))), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.CHANGE_COLOR, tile, TransporterUtils.getColorIndex(TransporterUtils.decrement(tile.color))))));
}
use of mekanism.client.gui.element.button.MekanismImageButton in project Mekanism by mekanism.
the class GuiFormulaicAssemblicator method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 159, 15));
// Overwrite the output slots with a "combined" slot
addButton(new GuiSlot(SlotType.OUTPUT_LARGE, this, 115, 16));
addButton(new GuiProgress(() -> tile.getOperatingTicks() / (double) tile.getTicksRequired(), ProgressType.TALL_RIGHT, this, 86, 43).jeiCrafting());
addButton(new GuiEnergyTab(this, tile.getEnergyContainer()));
encodeFormulaButton = addButton(new MekanismImageButton(this, 7, 45, 14, getButtonLocation("encode_formula"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.ENCODE_FORMULA, tile)), getOnHover(MekanismLang.ENCODE_FORMULA)));
stockControlButton = addButton(new MekanismImageButton(this, 26, 75, 16, getButtonLocation("stock_control"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.STOCK_CONTROL_BUTTON, tile)), getOnHover(() -> MekanismLang.STOCK_CONTROL.translate(OnOff.of(tile.getStockControl())))));
fillEmptyButton = addButton(new MekanismImageButton(this, 44, 75, 16, getButtonLocation("fill_empty"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.MOVE_ITEMS, tile)), getOnHover(MekanismLang.FILL_EMPTY)));
craftSingleButton = addButton(new MekanismImageButton(this, 71, 75, 16, getButtonLocation("craft_single"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.CRAFT_SINGLE, tile)), getOnHover(MekanismLang.CRAFT_SINGLE)));
craftAvailableButton = addButton(new MekanismImageButton(this, 89, 75, 16, getButtonLocation("craft_available"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.CRAFT_ALL, tile)), getOnHover(MekanismLang.CRAFT_AVAILABLE)));
autoModeButton = addButton(new MekanismImageButton(this, 107, 75, 16, getButtonLocation("auto_toggle"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.NEXT_MODE, tile)), getOnHover(() -> MekanismLang.AUTO_MODE.translate(OnOff.of(tile.getAutoMode())))));
updateEnabledButtons();
}
use of mekanism.client.gui.element.button.MekanismImageButton in project Mekanism by mekanism.
the class GuiQIOItemStackFilter method init.
@Override
protected void init() {
super.init();
addChild(new MekanismImageButton(gui(), relativeX + 148, relativeY + 18, 11, 14, getButtonLocation("fuzzy"), () -> filter.fuzzyMode = !filter.fuzzyMode, getOnHover(MekanismLang.FUZZY_MODE)));
}
Aggregations