Search in sources :

Example 31 with GuiButton

use of net.minecraft.client.gui.GuiButton in project Guide-API by TeamAmeriFrance.

the class GuiHome method drawScreen.

@Override
public void drawScreen(int mouseX, int mouseY, float renderPartialTicks) {
    Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture);
    drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
    Minecraft.getMinecraft().getTextureManager().bindTexture(outlineTexture);
    drawTexturedModalRectWithColor(guiLeft, guiTop, 0, 0, xSize, ySize, book.getColor());
    drawCenteredString(fontRenderer, book.getLocalizedWelcomeMessage().replace("\\n", "\n").replace("&", "ยง"), guiLeft + xSize / 2 + 1, guiTop + 15, 0);
    categoryPage = MathHelper.clamp(categoryPage, 0, categoryWrapperMap.size() - 1);
    for (CategoryWrapper wrapper : this.categoryWrapperMap.get(categoryPage)) if (wrapper.canPlayerSee())
        wrapper.draw(mouseX, mouseY, this);
    for (CategoryWrapper wrapper : this.categoryWrapperMap.get(categoryPage)) if (wrapper.canPlayerSee())
        wrapper.drawExtras(mouseX, mouseY, this);
    drawCenteredString(fontRenderer, String.format("%d/%d", categoryPage + 1, categoryWrapperMap.asMap().size()), guiLeft + xSize / 2, guiTop + 5 * ySize / 6, 0);
    drawCenteredStringWithShadow(fontRenderer, book.getLocalizedBookTitle(), guiLeft + xSize / 2, guiTop - 10, Color.WHITE.getRGB());
    buttonPrev.visible = categoryPage != 0;
    buttonNext.visible = categoryPage != categoryWrapperMap.asMap().size() - 1 && !categoryWrapperMap.asMap().isEmpty();
    for (GuiButton button : this.buttonList) button.drawButton(this.mc, mouseX, mouseY);
}
Also used : CategoryWrapper(amerifrance.guideapi.wrapper.CategoryWrapper) GuiButton(net.minecraft.client.gui.GuiButton)

Example 32 with GuiButton

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

the class GuiDetectorTrain method initGui.

@Override
public void initGui() {
    buttonList.clear();
    int w = (width - xSize) / 2;
    int h = (height - ySize) / 2;
    buttonList.add(new GuiButton(0, w + 13, h + 50, 30, 20, "-10"));
    buttonList.add(new GuiButton(1, w + 53, h + 50, 30, 20, "-1"));
    buttonList.add(new GuiButton(2, w + 93, h + 50, 30, 20, "+1"));
    buttonList.add(new GuiButton(3, w + 133, h + 50, 30, 20, "+10"));
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton)

Example 33 with GuiButton

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

the class GuiTrackLauncher method initGui.

@Override
public void initGui() {
    buttonList.clear();
    int w = (width - xSize) / 2;
    int h = (height - ySize) / 2;
    buttonList.add(new GuiButton(0, w + 13, h + 50, 30, 20, "-10"));
    buttonList.add(new GuiButton(1, w + 53, h + 50, 30, 20, "-1"));
    buttonList.add(new GuiButton(2, w + 93, h + 50, 30, 20, "+1"));
    buttonList.add(new GuiButton(3, w + 133, h + 50, 30, 20, "+10"));
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton)

Example 34 with GuiButton

use of net.minecraft.client.gui.GuiButton in project ICBM-Classic by BuiltBrokenModding.

the class GuiEMPTower method initGui.

/** Adds the buttons (and other controls) to the screen in question. */
@Override
public void initGui() {
    super.initGui();
    this.buttonList.clear();
    this.buttonList.add(new GuiButton(0, this.width / 2 - 77, this.height / 2 - 10, 50, 20, LanguageUtility.getLocal("gui.empTower.missiles")));
    this.buttonList.add(new GuiButton(1, this.width / 2 - 25, this.height / 2 - 10, 65, 20, LanguageUtility.getLocal("gui.empTower.elec")));
    this.buttonList.add(new GuiButton(2, this.width / 2 + 43, this.height / 2 - 10, 35, 20, LanguageUtility.getLocal("gui.empTower.both")));
    this.textFieldBanJing = new GuiTextField(fontRendererObj, 72, 28, 30, 12);
    this.textFieldBanJing.setMaxStringLength(3);
    this.textFieldBanJing.setText(this.tileEntity.empRadius + "");
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 35 with GuiButton

use of net.minecraft.client.gui.GuiButton in project Pearcel-Mod by MiningMark48.

the class GuiCatBlocks method initGui.

@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    int offsetFromScreenLeft = (width - textureWidth) / 2;
    buttonList.add(buttonNextPage = new ComponentNextPageButton(1, offsetFromScreenLeft + 120, 158, true));
    buttonList.add(buttonPreviousPage = new ComponentNextPageButton(1, offsetFromScreenLeft + 38, 158, false));
    buttonHome = new GuiButton(2, (width / 2) - 20, textureHeight, 40, 20, Translate.toLocal("gui.manual.button.home"));
    buttonList.add(buttonHome);
    for (GuiButton e : buttonList) {
        e.visible = false;
    }
}
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