Search in sources :

Example 41 with GuiButton

use of net.minecraft.client.gui.GuiButton in project RecurrentComplex by Ivorforce.

the class TableCellPresetAction method initGui.

@Override
public void initGui(GuiTable screen) {
    super.initGui(screen);
    Bounds bounds = bounds();
    int buttonY = bounds.getMinY() + (bounds.getHeight() - 20) / 2;
    int presetButtonWidth = bounds.getWidth() - DIRECTION_BUTTON_WIDTH * 2;
    boolean canChange = actions.size() > 1 || (actions.size() == 1 && !Objects.equals(getPropertyValue(), actions.get(0).actionID));
    leftButton = new GuiButton(-1, bounds.getMinX(), buttonY, DIRECTION_BUTTON_WIDTH - 1, 20, "<");
    leftButton.visible = !isHidden();
    leftButton.enabled = canChange;
    screen.addButton(this, 0, leftButton);
    rightButton = new GuiButton(-1, bounds.getMinX() + DIRECTION_BUTTON_WIDTH + presetButtonWidth + 1, buttonY, DIRECTION_BUTTON_WIDTH - 1, 20, ">");
    rightButton.visible = !isHidden();
    rightButton.enabled = canChange;
    screen.addButton(this, 1, rightButton);
    for (TableCellButton action : actions) action.initGui(screen);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) Bounds(ivorius.reccomplex.gui.table.Bounds)

Example 42 with GuiButton

use of net.minecraft.client.gui.GuiButton in project RecurrentComplex by Ivorforce.

the class TableCellEnum method initGui.

@Override
public void initGui(GuiTable screen) {
    super.initGui(screen);
    Bounds bounds = bounds();
    int buttonY = bounds.getMinY() + (bounds.getHeight() - 20) / 2;
    int presetButtonWidth = bounds.getWidth() - TableCellPresetAction.DIRECTION_BUTTON_WIDTH * 2;
    boolean canChange = options.size() > 1 || (options.size() == 1 && !Objects.equals(getPropertyValue(), options.get(0).value));
    leftButton = new GuiButton(-1, bounds.getMinX(), buttonY, TableCellPresetAction.DIRECTION_BUTTON_WIDTH - 1, 20, "<");
    leftButton.visible = !isHidden();
    leftButton.enabled = canChange;
    screen.addButton(this, 0, leftButton);
    rightButton = new GuiButton(-1, bounds.getMinX() + TableCellPresetAction.DIRECTION_BUTTON_WIDTH + presetButtonWidth + 1, buttonY, TableCellPresetAction.DIRECTION_BUTTON_WIDTH - 1, 20, ">");
    rightButton.visible = !isHidden();
    rightButton.enabled = canChange;
    screen.addButton(this, 1, rightButton);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) Bounds(ivorius.reccomplex.gui.table.Bounds)

Example 43 with GuiButton

use of net.minecraft.client.gui.GuiButton in project RecurrentComplex by Ivorforce.

the class GuiEditInventoryGenItems method mouseReleased.

@Override
protected void mouseReleased(int mouseX, int mouseY, int state) {
    super.mouseReleased(mouseX, mouseY, state);
    if (state == 0) {
        for (Object object : buttonList) {
            GuiButton button = (GuiButton) object;
            button.mouseReleased(mouseX, mouseY);
        }
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton)

Example 44 with GuiButton

use of net.minecraft.client.gui.GuiButton in project SecurityCraft by Geforce132.

the class GuiKeypadChestSetup method initGui.

public void initGui() {
    super.initGui();
    Keyboard.enableRepeatEvents(true);
    int j = (this.height - this.height) / 2;
    this.buttonList.add(this.saveAndContinueButton = new GuiButton(0, this.width / 2 - 48, this.height / 2 + 30 + 10, 100, 20, !this.flag ? "Save & continue." : "Invalid code!"));
    this.textboxKeycode = new GuiTextField(this.fontRendererObj, this.width / 2 - 37, this.height / 2 - 47, 77, 12);
    this.textboxKeycode.setTextColor(-1);
    this.textboxKeycode.setDisabledTextColour(-1);
    this.textboxKeycode.setEnableBackgroundDrawing(true);
    this.textboxKeycode.setMaxStringLength(11);
    this.updateButtonText();
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 45 with GuiButton

use of net.minecraft.client.gui.GuiButton in project SecurityCraft by Geforce132.

the class GuiRetinalScanner method initGui.

public void initGui() {
    super.initGui();
    Keyboard.enableRepeatEvents(true);
    int j = (this.height - this.height) / 2;
    this.buttonList.add(new GuiButton(0, this.width / 2 - 48, this.height / 2 + 30 + 20, 100, 20, "Continue."));
    this.buttonList.add(new GuiButton(1, this.width / 4, this.height / 2, 20, 20, "X."));
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton)

Aggregations

GuiButton (net.minecraft.client.gui.GuiButton)132 GuiTextField (net.minecraft.client.gui.GuiTextField)17 SmallGuiButton (logisticspipes.utils.gui.SmallGuiButton)12 ArrayList (java.util.ArrayList)10 ItemStack (net.minecraft.item.ItemStack)9 Point (java.awt.Point)7 GuiElementInfoRegionMP (stevekung.mods.moreplanets.util.client.gui.GuiElementInfoRegionMP)7 ItemDisplay (logisticspipes.utils.gui.ItemDisplay)6 GuiCheckBox (logisticspipes.utils.gui.GuiCheckBox)5 Bounds (ivorius.reccomplex.gui.table.Bounds)4 Rectangle (java.awt.Rectangle)4 SearchBar (logisticspipes.utils.gui.SearchBar)4 ItemIdentifierStack (logisticspipes.utils.item.ItemIdentifierStack)3 GuiButtonVariableDims (am2.guis.controls.GuiButtonVariableDims)2 GuiSlideControl (am2.guis.controls.GuiSlideControl)2 IOException (java.io.IOException)2 BitSet (java.util.BitSet)2 GuiDiskPopup (logisticspipes.gui.popup.GuiDiskPopup)2 RequestMonitorPopup (logisticspipes.gui.popup.RequestMonitorPopup)2 ClearCraftingGridPacket (logisticspipes.network.packets.block.ClearCraftingGridPacket)2