Search in sources :

Example 66 with GuiButton

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

the class GuiProgWidgetItemFilter method initGui.

@Override
public void initGui() {
    super.initGui();
    //  metaInfoStat = new GuiAnimatedStat(this, "Metadata?", Textures.GUI_INFO_LOCATION, xStart + xSize, yStart + 5, 0xFF00AA00, null, false);
    buttonList.add(new GuiButton(0, guiLeft + 4, guiTop + 20, 70, 20, "Search item..."));
    buttonList.add(new GuiButton(1, guiLeft + 78, guiTop + 20, 100, 20, "Search inventory..."));
    decButton = new GuiButton(2, guiLeft + 140, guiTop + 85, 10, 20, "-");
    incButton = new GuiButton(3, guiLeft + 167, guiTop + 85, 10, 20, "+");
    buttonList.add(decButton);
    buttonList.add(incButton);
    checkBoxUseDamage = new GuiCheckBox(0, guiLeft + 4, guiTop + 72, 0xFF000000, "Use metadata / damage values");
    checkBoxUseDamage.setTooltip(Arrays.asList(new String[] { "Check to handle differently damaged tools", "or different colors of Wool as different." }));
    checkBoxUseDamage.checked = widg.useMetadata;
    addWidget(checkBoxUseDamage);
    checkBoxUseNBT = new GuiCheckBox(2, guiLeft + 4, guiTop + 108, 0xFF000000, "Use NBT");
    checkBoxUseNBT.setTooltip(Arrays.asList(new String[] { "Check to handle items like Enchanted Books", "or Firework as different." }));
    checkBoxUseNBT.checked = widg.useNBT;
    addWidget(checkBoxUseNBT);
    checkBoxUseOreDict = new GuiCheckBox(3, guiLeft + 4, guiTop + 120, 0xFF000000, "Use Ore Dictionary");
    checkBoxUseOreDict.setTooltip(Arrays.asList(new String[] { "Check to handle items registered in the", "Ore Dictionary (like Wood) as the same." }));
    checkBoxUseOreDict.checked = widg.useOreDict;
    addWidget(checkBoxUseOreDict);
    checkBoxUseModSimilarity = new GuiCheckBox(4, guiLeft + 4, guiTop + 132, 0xFF000000, "Use Mod similarity");
    checkBoxUseModSimilarity.setTooltip(Arrays.asList(new String[] { "Check to handle items from the", "same mod as the same." }));
    checkBoxUseModSimilarity.checked = widg.useModSimilarity;
    addWidget(checkBoxUseModSimilarity);
    variableField = new WidgetComboBox(fontRendererObj, guiLeft + 90, guiTop + 56, 80, fontRendererObj.FONT_HEIGHT + 1);
    variableField.setElements(guiProgrammer.te.getAllVariables());
    variableField.setText(widg.getVariable());
    if (Config.getProgrammerDifficulty() == 2) {
        addWidget(variableField);
    }
    checkBoxUseDamage.enabled = !checkBoxUseOreDict.checked && !checkBoxUseModSimilarity.checked;
    incButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
    decButton.enabled = checkBoxUseDamage.enabled && checkBoxUseDamage.checked;
    checkBoxUseNBT.enabled = !checkBoxUseOreDict.checked && !checkBoxUseModSimilarity.checked;
    checkBoxUseOreDict.enabled = !checkBoxUseModSimilarity.checked;
    checkBoxUseModSimilarity.enabled = !checkBoxUseOreDict.checked;
    if (searchGui != null)
        widg.setFilter(searchGui.getSearchStack());
    if (invSearchGui != null)
        widg.setFilter(invSearchGui.getSearchStack());
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox) WidgetComboBox(pneumaticCraft.client.gui.widget.WidgetComboBox)

Example 67 with GuiButton

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

the class GuiErrorBase method initGui.

@Override
public void initGui() {
    super.initGui();
    this.buttonList.clear();
    this.buttonList.add(new GuiButton(10, 50, this.height - 38, this.width / 2 - 55, 20, translateOrDefault("fml.button.open.mods.folder", "Open Mods Folder")));
    String openFileText = translateOrDefault("fml.button.open.file", "Open %s", clientLog.getName());
    this.buttonList.add(new GuiButton(11, this.width / 2 + 5, this.height - 38, this.width / 2 - 55, 20, openFileText));
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton)

Example 68 with GuiButton

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

the class GuiModList method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) throws IOException {
    if (button.enabled) {
        SortType type = SortType.getTypeForButton(button);
        if (type != null) {
            for (GuiButton b : buttonList) {
                if (SortType.getTypeForButton(b) != null) {
                    b.enabled = true;
                }
            }
            button.enabled = false;
            sorted = false;
            sortType = type;
            this.mods = modList.getMods();
        } else {
            switch(button.id) {
                case 6:
                    {
                        this.mc.displayGuiScreen(this.mainMenu);
                        return;
                    }
                case 20:
                    {
                        try {
                            IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod);
                            GuiScreen newScreen = guiFactory.mainConfigGuiClass().getConstructor(GuiScreen.class).newInstance(this);
                            this.mc.displayGuiScreen(newScreen);
                        } catch (Exception e) {
                            FMLLog.log(Level.ERROR, e, "There was a critical issue trying to build the config GUI for %s", selectedMod.getModId());
                        }
                        return;
                    }
            }
        }
    }
    super.actionPerformed(button);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiScreen(net.minecraft.client.gui.GuiScreen) IOException(java.io.IOException)

Example 69 with GuiButton

use of net.minecraft.client.gui.GuiButton in project MineFactoryReloaded by powercrystals.

the class GuiChronotyper method initGui.

@SuppressWarnings("unchecked")
@Override
public void initGui() {
    super.initGui();
    int xOffset = (this.width - this.xSize) / 2;
    int yOffset = (this.height - this.ySize) / 2;
    _ageToggle = new GuiButton(1, xOffset + 7, yOffset + 14, 110, 20, "Moving: ");
    buttonList.add(_ageToggle);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton)

Example 70 with GuiButton

use of net.minecraft.client.gui.GuiButton in project MineFactoryReloaded by powercrystals.

the class GuiDeepStorageUnit method initGui.

@SuppressWarnings("unchecked")
@Override
public void initGui() {
    super.initGui();
    int xOffset = (this.width - this.xSize) / 2;
    int yOffset = (this.height - this.ySize) / 2;
    _dirDown = new GuiButton(1, xOffset + 7, yOffset + 80, 30, 20, "OUT");
    _dirUp = new GuiButton(2, xOffset + 7, yOffset + 40, 30, 20, "OUT");
    _dirNorth = new GuiButton(3, xOffset + 37, yOffset + 40, 30, 20, "OUT");
    _dirSouth = new GuiButton(4, xOffset + 37, yOffset + 80, 30, 20, "OUT");
    _dirWest = new GuiButton(5, xOffset + 67, yOffset + 80, 30, 20, "OUT");
    _dirEast = new GuiButton(6, xOffset + 67, yOffset + 40, 30, 20, "OUT");
    buttonList.add(_dirDown);
    buttonList.add(_dirUp);
    buttonList.add(_dirNorth);
    buttonList.add(_dirSouth);
    buttonList.add(_dirWest);
    buttonList.add(_dirEast);
}
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