Search in sources :

Example 96 with GuiButton

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

the class GuiInventoryScanner method initGui.

@Override
public void initGui() {
    super.initGui();
    Keyboard.enableRepeatEvents(true);
    if (tileEntity.getOwner().isOwner(playerObj)) {
        this.buttonList.add(new GuiButton(0, this.width / 2 - 83 - (hasStorageModule ? 28 : 0), this.height / 2 - 63, 166, 20, this.tileEntity.getType().contains("check") ? I18n.translateToLocal("gui.invScan.checkInv") : I18n.translateToLocal("gui.invScan.emitRedstone")));
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton)

Example 97 with GuiButton

use of net.minecraft.client.gui.GuiButton in project OpenModularTurrets by OpenModularTurretsTeam.

the class TurretBaseAbstractGui method initGui.

@Override
@SuppressWarnings("unchecked")
public void initGui() {
    super.initGui();
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;
    TrustedPlayer trustedPlayer = PlayerUtil.getTrustedPlayer(player, base);
    this.buttonList.add(new GuiButton(1, x + 120, y + 15, 20, 20, "+"));
    this.buttonList.add(new GuiButton(2, x + 120, y + 50, 20, 20, "-"));
    if (PlayerUtil.isPlayerOwner(player, base)) {
        this.buttonList.add(new GuiButton(3, x + 180, y, 80, 20, "Drop Turrets"));
        this.buttonList.add(new GuiButton(4, x + 180, y + 25, 80, 20, "Drop Base"));
        this.buttonList.add(new GuiButton(5, x + 180, y + 50, 80, 20, "Configure"));
        this.buttonList.add(new GuiButton(6, x + 180, y + 75, 80, 20, base.isMultiTargeting() ? safeLocalize(OMTNames.Localizations.GUI.TARGET) + ": " + safeLocalize(OMTNames.Localizations.GUI.MULTI) : safeLocalize(OMTNames.Localizations.GUI.TARGET) + ": " + safeLocalize(OMTNames.Localizations.GUI.SINGLE)));
    } else if (trustedPlayer != null) {
        if (trustedPlayer.admin) {
            this.buttonList.add(new GuiButton(3, x + 180, y, 80, 20, "Drop Turrets"));
            this.buttonList.add(new GuiButton(4, x + 180, y + 25, 80, 20, "Drop Base"));
        }
        if (trustedPlayer.canChangeTargeting || trustedPlayer.admin) {
            this.buttonList.add(new GuiButton(5, x + 180, y + 50, 80, 20, "Configure"));
            this.buttonList.add(new GuiButton(6, x + 180, y + 75, 80, 20, base.isMultiTargeting() ? safeLocalize(OMTNames.Localizations.GUI.TARGET) + ": " + safeLocalize(OMTNames.Localizations.GUI.MULTI) : safeLocalize(OMTNames.Localizations.GUI.TARGET) + ": " + safeLocalize(OMTNames.Localizations.GUI.SINGLE)));
        }
    }
}
Also used : TrustedPlayer(omtteam.omlib.util.TrustedPlayer) GuiButton(net.minecraft.client.gui.GuiButton)

Example 98 with GuiButton

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

the class GuiCatArmor 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)

Example 99 with GuiButton

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

the class GuiManual method initGui.

@Override
public void initGui() {
    super.initGui();
    //Debug
    LogHelper.info("Gui Initialized!");
    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);
    //Glossary
    buttonTools = new GuiButton(3, width / 2 - 145, 2 + 30, 65, 20, Translate.toLocal("gui.manual.button.glossary.tools"));
    buttonArmor = new GuiButton(3, width / 2 - 145, 2 + 55, 65, 20, Translate.toLocal("gui.manual.button.glossary.armor"));
    buttonItems = new GuiButton(3, width / 2 - 145, 2 + 80, 65, 20, Translate.toLocal("gui.manual.button.glossary.items"));
    buttonBlocks = new GuiButton(3, width / 2 - 145, 2 + 105, 65, 20, Translate.toLocal("gui.manual.button.glossary.blocks"));
    buttonSummoning = new GuiButton(3, width / 2 - 145, 2 + 130, 65, 20, Translate.toLocal("gui.manual.button.glossary.summoning"));
    buttonMobs = new GuiButton(3, width / 2 + 75, 2 + 30, 65, 20, Translate.toLocal("gui.manual.button.glossary.mobs"));
    buttonCredits = new GuiButton(3, width / 2 + 75, 2 + 55, 65, 20, Translate.toLocal("gui.manual.button.glossary.credits"));
    buttonList.add(buttonTools);
    buttonList.add(buttonArmor);
    buttonList.add(buttonItems);
    buttonList.add(buttonBlocks);
    buttonList.add(buttonSummoning);
    buttonList.add(buttonMobs);
    buttonList.add(buttonCredits);
    for (GuiButton e : buttonList) {
        e.visible = false;
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton)

Example 100 with GuiButton

use of net.minecraft.client.gui.GuiButton in project ArsMagica2 by Mithion.

the class GuiParticleEmitter method initGui.

@Override
public void initGui() {
    btnParticleType = new GuiButtonVariableDims(10, 50, 40, AMParticle.particleTypes[tile.getParticleType()]);
    btnParticleBehaviour = new GuiButtonVariableDims(11, 50, 60, ParticleController.AuraControllerOptions[tile.getParticleBehaviour()]);
    btnParticleColorMode = new GuiButtonVariableDims(12, 50, 80, tile.getColorDefault() ? StatCollector.translateToLocal("am2.gui.default") : tile.getColorRandom() ? StatCollector.translateToLocal("am2.gui.random") : StatCollector.translateToLocal("am2.gui.custom"));
    hideBlock = new GuiButtonVariableDims(19, 50, 100, tile.getShow() ? StatCollector.translateToLocal("am2.gui.visible") : StatCollector.translateToLocal("am2.gui.hidden"));
    btnParticleType.setDimensions(80, 20);
    btnParticleBehaviour.setDimensions(80, 20);
    btnParticleColorMode.setDimensions(80, 20);
    hideBlock.setDimensions(80, 20);
    sliParticleScale = new GuiSlideControl(14, width - 110, 40, 100, StatCollector.translateToLocal("am2.gui.scale"), tile.getScale() * 100, 1f, 200f);
    sliParticleAlpha = new GuiSlideControl(15, width - 110, 60, 100, StatCollector.translateToLocal("am2.gui.alpha"), tile.getAlpha() * 100, 1f, 100f);
    sliParticleRed = new GuiSlideControl(16, width - 110, 80, 100, StatCollector.translateToLocal("am2.gui.red"), (tile.getColor() >> 16) & 0xFF, 0f, 255f);
    sliParticleRed.setInteger(true);
    sliParticleGreen = new GuiSlideControl(17, width - 110, 100, 100, StatCollector.translateToLocal("am2.gui.green"), (tile.getColor() >> 8) & 0xFF, 0f, 255f);
    sliParticleGreen.setInteger(true);
    sliParticleBlue = new GuiSlideControl(18, width - 110, 120, 100, StatCollector.translateToLocal("am2.gui.blue"), tile.getColor() & 0xFF, 0f, 255f);
    sliParticleBlue.setInteger(true);
    sliParticleQuantity = new GuiSlideControl(20, width - 110, 140, 100, StatCollector.translateToLocal("am2.gui.qty"), tile.getQuantity(), 1, 5);
    sliParticleQuantity.setInteger(true);
    sliParticleDelay = new GuiSlideControl(21, width - 110, 160, 100, StatCollector.translateToLocal("am2.gui.delay"), tile.getDelay(), 1, 100);
    sliParticleDelay.setInteger(true);
    sliParticleSpeed = new GuiSlideControl(22, width - 110, 180, 100, StatCollector.translateToLocal("am2.gui.speed"), 1.0f, 0.25f, 10.0f);
    if (tile.getColorDefault() || tile.getColorRandom()) {
        sliParticleRed.enabled = false;
        sliParticleBlue.enabled = false;
        sliParticleGreen.enabled = false;
    } else {
        sliParticleRed.enabled = true;
        sliParticleBlue.enabled = true;
        sliParticleGreen.enabled = true;
    }
    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height - 28, StatCollector.translateToLocal("am2.gui.done")));
    this.buttonList.add(btnParticleType);
    this.buttonList.add(btnParticleBehaviour);
    this.buttonList.add(btnParticleColorMode);
    this.buttonList.add(sliParticleScale);
    this.buttonList.add(sliParticleAlpha);
    this.buttonList.add(sliParticleRed);
    this.buttonList.add(sliParticleGreen);
    this.buttonList.add(sliParticleBlue);
    this.buttonList.add(hideBlock);
    this.buttonList.add(sliParticleDelay);
    this.buttonList.add(sliParticleQuantity);
    this.buttonList.add(sliParticleSpeed);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiSlideControl(am2.guis.controls.GuiSlideControl) GuiButtonVariableDims(am2.guis.controls.GuiButtonVariableDims)

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