Search in sources :

Example 56 with GuiButton

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

the class GuiBriefcase method initGui.

@Override
public void initGui() {
    super.initGui();
    for (int i = 0; i < keycodeTopButtons.length; i++) {
        keycodeTopButtons[i] = new GuiButton(i, width / 2 - 40 + (i * 20), height / 2 - 52, 20, 20, UP_ARROW);
        buttonList.add(keycodeTopButtons[i]);
    }
    for (int i = 0; i < keycodeBottomButtons.length; i++) {
        keycodeBottomButtons[i] = new GuiButton(4 + i, width / 2 - 40 + (i * 20), height / 2, 20, 20, DOWN_ARROW);
        buttonList.add(keycodeBottomButtons[i]);
    }
    continueButton = new GuiButton(8, (width / 2 + 42), height / 2 - 26, 20, 20, ">");
    buttonList.add(continueButton);
    for (int i = 0; i < keycodeTextboxes.length; i++) {
        keycodeTextboxes[i] = new GuiTextField(9 + i, fontRendererObj, (width / 2 - 37) + (i * 20), height / 2 - 22, 14, 12);
        keycodeTextboxes[i].setTextColor(-1);
        keycodeTextboxes[i].setDisabledTextColour(-1);
        keycodeTextboxes[i].setEnableBackgroundDrawing(true);
        keycodeTextboxes[i].setMaxStringLength(1);
        keycodeTextboxes[i].setText("0");
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 57 with GuiButton

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

the class GuiBriefcaseSetup method initGui.

@Override
public void initGui() {
    super.initGui();
    Keyboard.enableRepeatEvents(true);
    buttonList.add(saveAndContinueButton = new GuiButton(0, width / 2 - 48, height / 2 + 30 + 10, 100, 20, !flag ? StatCollector.translateToLocal("gui.keycardSetup.save") : StatCollector.translateToLocal("gui.password.invalidCode")));
    keycodeTextbox = new GuiTextField(1, fontRendererObj, width / 2 - 37, height / 2 - 47, 77, 12);
    keycodeTextbox.setTextColor(-1);
    keycodeTextbox.setDisabledTextColour(-1);
    keycodeTextbox.setEnableBackgroundDrawing(true);
    keycodeTextbox.setMaxStringLength(4);
    updateButtonText();
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 58 with GuiButton

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

the class GuiCustomizeBlock method initGui.

@Override
public void initGui() {
    super.initGui();
    for (int i = 0; i < tileEntity.getNumberOfCustomizableOptions(); i++) {
        descriptionButtons[i] = new GuiItemButton(i, guiLeft + 130, (guiTop + 10) + (i * 25), 20, 20, "", itemRender, new ItemStack(tileEntity.acceptedModules()[i].getItem()));
        buttonList.add(descriptionButtons[i]);
        hoverCheckers[i] = new HoverChecker(descriptionButtons[i], 20);
    }
    if (tileEntity.customOptions() != null)
        for (int i = 0; i < tileEntity.customOptions().length; i++) {
            Option option = tileEntity.customOptions()[i];
            if (option instanceof OptionDouble && ((OptionDouble) option).isSlider()) {
                optionButtons[i] = new GuiSlider((StatCollector.translateToLocal("option." + blockName + "." + option.getName()) + " ").replace("#", option.toString()), blockName, i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, "", "", (Double) option.getMin(), (Double) option.getMax(), (Double) option.getValue(), true, true, (OptionDouble) option);
                optionButtons[i].packedFGColour = 14737632;
            } else {
                optionButtons[i] = new GuiButton(i, guiLeft + 178, (guiTop + 10) + (i * 25), 120, 20, getOptionButtonTitle(option));
                optionButtons[i].packedFGColour = option.toString().matches(option.getDefaultValue().toString()) ? 16777120 : 14737632;
            }
            buttonList.add(optionButtons[i]);
            hoverCheckers[i + tileEntity.getNumberOfCustomizableOptions()] = new HoverChecker(optionButtons[i], 20);
        }
}
Also used : OptionDouble(net.geforcemods.securitycraft.api.Option.OptionDouble) GuiButton(net.minecraft.client.gui.GuiButton) Option(net.geforcemods.securitycraft.api.Option) PacketSToggleOption(net.geforcemods.securitycraft.network.packets.PacketSToggleOption) GuiSlider(net.geforcemods.securitycraft.gui.components.GuiSlider) ItemStack(net.minecraft.item.ItemStack) GuiItemButton(net.geforcemods.securitycraft.gui.components.GuiItemButton) HoverChecker(net.minecraftforge.fml.client.config.HoverChecker)

Example 59 with GuiButton

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

the class GuiKeyChanger method initGui.

@Override
public void initGui() {
    super.initGui();
    Keyboard.enableRepeatEvents(true);
    buttonList.add(confirmButton = new GuiButton(0, width / 2 - 52, height / 2 + 52, 100, 20, StatCollector.translateToLocal("gui.universalKeyChanger.confirm")));
    confirmButton.enabled = false;
    textboxNewPasscode = new GuiTextField(0, fontRendererObj, width / 2 - 57, height / 2 - 47, 110, 12);
    textboxNewPasscode.setTextColor(-1);
    textboxNewPasscode.setDisabledTextColour(-1);
    textboxNewPasscode.setEnableBackgroundDrawing(true);
    textboxNewPasscode.setMaxStringLength(20);
    textboxConfirmPasscode = new GuiTextField(1, fontRendererObj, width / 2 - 57, height / 2 - 7, 110, 12);
    textboxConfirmPasscode.setTextColor(-1);
    textboxConfirmPasscode.setDisabledTextColour(-1);
    textboxConfirmPasscode.setEnableBackgroundDrawing(true);
    textboxConfirmPasscode.setMaxStringLength(20);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 60 with GuiButton

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

the class GuiMRATDeactivate method initGui.

@Override
public void initGui() {
    super.initGui();
    for (int i = 1; i < 7; i++) {
        buttons[i - 1] = new GuiButton(i - 1, width / 2 - 49 - 25, height / 2 - 7 - 60 + ((i - 1) * 25), 149, 20, StatCollector.translateToLocal("gui.mrat.notBound"));
        buttons[i - 1].enabled = false;
        if (item.getItem() != null && item.getItem() == SCContent.remoteAccessMine && item.getTagCompound() != null && item.getTagCompound().getIntArray("mine" + i) != null && item.getTagCompound().getIntArray("mine" + i).length > 0) {
            int[] coords = item.getTagCompound().getIntArray("mine" + i);
            if (coords[0] == 0 && coords[1] == 0 && coords[2] == 0) {
                buttonList.add(buttons[i - 1]);
                continue;
            }
            buttons[i - 1].displayString = StatCollector.translateToLocal("gui.mrat.mineLocations").replace("#location", Utils.getFormattedCoordinates(new BlockPos(coords[0], coords[1], coords[2])));
            buttons[i - 1].enabled = (BlockUtils.getBlock(mc.theWorld, coords[0], coords[1], coords[2]) instanceof IExplosive && ((IExplosive) BlockUtils.getBlock(mc.theWorld, coords[0], coords[1], coords[2])).isDefusable() && ((IExplosive) BlockUtils.getBlock(mc.theWorld, coords[0], coords[1], coords[2])).isActive(mc.theWorld, BlockUtils.toPos(coords[0], coords[1], coords[2]))) ? true : false;
            buttons[i - 1].id = i - 1;
        }
        buttonList.add(buttons[i - 1]);
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) BlockPos(net.minecraft.util.BlockPos) IExplosive(net.geforcemods.securitycraft.api.IExplosive)

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