Search in sources :

Example 11 with GuiButton

use of net.minecraft.client.gui.GuiButton in project PneumaticCraft by MineMaarten.

the class GuiSecurityStationInventory method initGui.

@Override
public void initGui() {
    super.initGui();
    int xStart = (width - xSize) / 2;
    int yStart = (height - ySize) / 2;
    statusStat = addAnimatedStat("Security Status", new ItemStack(Blockss.securityStation), 0xFFFFAA00, false);
    accessStat = addAnimatedStat("Shared Users", new ItemStack(Items.skull, 1, 3), 0xFF005500, false);
    Rectangle accessButtonRectangle = accessStat.getButtonScaledRectangle(145, 10, 20, 20);
    addButton = getButtonFromRectangle(1, accessButtonRectangle, "+");
    rebootButton = new GuiButton(2, xStart + 110, yStart + 20, 60, 20, "Reboot");
    sharedUserTextField = getTextFieldFromRectangle(accessStat.getButtonScaledRectangle(20, 15, 120, 10));
    accessStat.addWidget(sharedUserTextField);
    accessStat.addWidget(addButton);
    buttonList.add(new GuiButton(3, guiLeft + 108, guiTop + 103, 64, 20, I18n.format("gui.securityStation.test")));
    buttonList.add(rebootButton);
    buttonList.add(new GuiButton(-1, guiLeft + 108, guiTop + 125, 64, 20, I18n.format("gui.universalSensor.button.showRange")));
    updateUserRemoveButtons();
    nodeHandler = new NetworkConnectionBackground(this, te, xStart + 25, yStart + 30, 18, 0xFF2222FF);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) Rectangle(java.awt.Rectangle) ItemStack(net.minecraft.item.ItemStack) Point(java.awt.Point)

Example 12 with GuiButton

use of net.minecraft.client.gui.GuiButton in project PneumaticCraft by MineMaarten.

the class GuiSecurityStationInventory method updateScreen.

@Override
public void updateScreen() {
    super.updateScreen();
    statusStat.setText(getStatusText());
    accessStat.setTextWithoutCuttingString(getAccessText());
    String rebootButtonString;
    if (te.getRebootTime() > 0) {
        rebootButtonString = te.getRebootTime() % 100 < 50 ? "Rebooting.." : PneumaticCraftUtils.convertTicksToMinutesAndSeconds(te.getRebootTime(), false);
    } else {
        rebootButtonString = "Reboot";
    }
    rebootButton.displayString = rebootButtonString;
    addButton.visible = accessStat.isDoneExpanding();
    for (GuiButton button : removeUserButtons) {
        button.enabled = accessStat.isDoneExpanding();
    }
    if (removeUserButtons.size() != te.sharedUsers.size()) {
        updateUserRemoveButtons();
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton)

Example 13 with GuiButton

use of net.minecraft.client.gui.GuiButton in project PneumaticCraft by MineMaarten.

the class GuiEntityTrackOptions method initGui.

@Override
public void initGui(IGuiScreen gui) {
    gui.getButtonList().add(new GuiButton(10, 30, 128, 150, 20, "Move Stat Screen..."));
    textField = new GuiTextField(gui.getFontRenderer(), 35, 60, 140, 10);
    textField.setFocused(true);
    if (PneumaticCraft.proxy.getPlayer() != null)
        textField.setText(ItemPneumaticArmor.getEntityFilter(PneumaticCraft.proxy.getPlayer().getCurrentArmor(3)));
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 14 with GuiButton

use of net.minecraft.client.gui.GuiButton in project PneumaticCraft by MineMaarten.

the class GuiSearchUpgradeOptions method initGui.

@Override
public void initGui(IGuiScreen gui) {
    gui.getButtonList().add(new GuiButton(10, 30, 40, 150, 20, "Search for item..."));
    gui.getButtonList().add(new GuiButton(11, 30, 128, 150, 20, "Move Stat Screen..."));
    if (searchGui != null && player.getCurrentArmor(3) != null) {
        ItemStack searchStack = searchGui.getSearchStack();
        ItemStack helmetStack = ItemPneumaticArmor.getSearchedStack(player.getCurrentArmor(3));
        if (searchStack == null && helmetStack != null || searchStack != null && helmetStack == null || searchStack != null && helmetStack != null && !searchStack.isItemEqual(helmetStack)) {
            NetworkHandler.sendToServer(new PacketUpdateSearchStack(searchStack));
            NBTTagCompound tag = NBTUtil.getCompoundTag(player.getCurrentArmor(3), "SearchStack");
            tag.setInteger("itemID", searchStack != null ? Item.getIdFromItem(searchStack.getItem()) : -1);
            tag.setInteger("itemDamage", searchStack != null ? searchStack.getItemDamage() : -1);
        }
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack) PacketUpdateSearchStack(pneumaticCraft.common.network.PacketUpdateSearchStack)

Example 15 with GuiButton

use of net.minecraft.client.gui.GuiButton in project MinecraftForge by MinecraftForge.

the class GuiJava8Error method initGui.

@Override
public void initGui() {
    super.initGui();
    this.buttonList.remove(1);
    if (java8VersionException.getMods().isEmpty()) {
        this.buttonList.remove(0);
        this.buttonList.add(new GuiButton(1, 50, this.height - 38, this.width / 2 - 55, 20, I18n.format("fml.button.continue")));
    }
    this.buttonList.add(new GuiButton(2, this.width / 2 + 5, this.height - 38, this.width / 2 - 55, 20, I18n.format("fml.button.visitjavadownloads")));
}
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