Search in sources :

Example 26 with GuiTextField

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

the class GuiSearcher method initGui.

/**
     * Adds the buttons (and other controls) to the screen in question.
     */
@Override
public void initGui() {
    super.initGui();
    buttonList.clear();
    Keyboard.enableRepeatEvents(true);
    searchField = new GuiTextField(fontRendererObj, guiLeft + 20, guiTop + 36, 89, fontRendererObj.FONT_HEIGHT);
    searchField.setMaxStringLength(15);
    searchField.setEnableBackgroundDrawing(true);
    searchField.setVisible(true);
    searchField.setFocused(true);
    searchField.setTextColor(16777215);
    updateCreativeSearch();
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 27 with GuiTextField

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

the class GuiFrequency method initGui.

/** Adds the buttons (and other controls) to the screen in question. */
@Override
public void initGui() {
    super.initGui();
    this.textFieldFrequency = new GuiTextField(fontRendererObj, 80, 50, 40, 12);
    this.textFieldFrequency.setMaxStringLength(4);
    if (itemStack != null) {
        this.textFieldFrequency.setText(((IItemFrequency) this.itemStack.getItem()).getBroadCastHz(this.itemStack) + "");
    }
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField) IItemFrequency(com.builtbroken.mc.api.items.hz.IItemFrequency)

Example 28 with GuiTextField

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

the class GuiCruiseLauncher method initGui.

@Override
public void initGui() {
    super.initGui();
    this.textFieldX = new GuiTextField(fontRendererObj, 20, 21, 35, 12);
    this.textFieldY = new GuiTextField(fontRendererObj, 20, 37, 35, 12);
    this.textFieldZ = new GuiTextField(fontRendererObj, 20, 52, 35, 12);
    this.textFieldFreq = new GuiTextField(fontRendererObj, 70, 33, 35, 12);
    this.textFieldFreq.setMaxStringLength(4);
    this.textFieldX.setMaxStringLength(6);
    this.textFieldZ.setMaxStringLength(6);
    this.textFieldY.setMaxStringLength(6);
    this.textFieldFreq.setText(this.tileEntity.getFrequency() + "");
    if (this.tileEntity.getTarget() == null) {
        this.textFieldX.setText(Math.round(this.tileEntity.xCoord) + "");
        this.textFieldZ.setText(Math.round(this.tileEntity.zCoord) + "");
        this.textFieldY.setText(Math.round(this.tileEntity.yCoord) + "");
    } else {
        this.textFieldX.setText(Math.round(this.tileEntity.getTarget().x()) + "");
        this.textFieldZ.setText(Math.round(this.tileEntity.getTarget().z()) + "");
        this.textFieldY.setText(Math.round(this.tileEntity.getTarget().y()) + "");
    }
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 29 with GuiTextField

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

the class GuiSpellCustomization method initGui.

@Override
public void initGui() {
    super.initGui();
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    if (AMCore.config.suggestSpellNames())
        spellName = new GuiTextField(fontRendererObj, l + 8, i1 + 8, xSize - 36, 16);
    else
        spellName = new GuiTextField(fontRendererObj, l + 8, i1 + 8, xSize - 16, 16);
    String suggestion = ((ContainerSpellCustomization) this.inventorySlots).getInitialSuggestedName();
    spellName.setText(suggestion);
    if (!suggestion.equals("")) {
        curName = suggestion;
        ((ContainerSpellCustomization) this.inventorySlots).setNameAndIndex(curName, curIndex);
    }
    btnPrev = new GuiButtonVariableDims(0, l + 8, i1 + 26, StatCollector.translateToLocal("am2.gui.prev")).setDimensions(48, 20);
    btnNext = new GuiButtonVariableDims(1, l + xSize - 56, i1 + 26, StatCollector.translateToLocal("am2.gui.next")).setDimensions(48, 20);
    btnRandomName = new GuiButtonVariableDims(2, l + xSize - 24, i1 + 5, "???");
    btnRandomName.setDimensions(20, 20);
    this.buttonList.add(btnPrev);
    this.buttonList.add(btnNext);
    if (AMCore.config.suggestSpellNames())
        this.buttonList.add(btnRandomName);
    int IIcon_start_x = l + 12;
    int IIcon_start_y = i1 + 50;
    int btnX = IIcon_start_x;
    int btnY = IIcon_start_y;
    int id = 3;
    int IIconCount = 0;
    int curPage = 0;
    for (IIcon icon : SpellTextureHelper.instance.getAllIcons()) {
        GuiSpellImageButton spellButton = new GuiSpellImageButton(id++, btnX, btnY, icon, IIconCount++, curPage);
        if (curPage != 0) {
            spellButton.visible = false;
        }
        this.buttonList.add(spellButton);
        btnX += 14;
        if (btnX > (l + xSize) - 15) {
            btnX = IIcon_start_x;
            btnY += 14;
            if (btnY > (i1 + ySize - 10)) {
                btnY = IIcon_start_y;
                curPage++;
            }
        }
    }
    this.numPages = curPage;
}
Also used : IIcon(net.minecraft.util.IIcon) GuiSpellImageButton(am2.guis.controls.GuiSpellImageButton) GuiTextField(net.minecraft.client.gui.GuiTextField) ContainerSpellCustomization(am2.containers.ContainerSpellCustomization) GuiButtonVariableDims(am2.guis.controls.GuiButtonVariableDims)

Example 30 with GuiTextField

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

the class GuiKeypad method initGui.

public void initGui() {
    super.initGui();
    Keyboard.enableRepeatEvents(true);
    int j = (this.height - this.height) / 2;
    this.buttonList.add(new GuiButton(0, this.width / 2 - 38, this.height / 2 + 30 + 10, 80, 20, "0"));
    this.buttonList.add(new GuiButton(1, this.width / 2 - 38, this.height / 2 - 60 + 10, 20, 20, "1"));
    this.buttonList.add(new GuiButton(2, this.width / 2 - 8, this.height / 2 - 60 + 10, 20, 20, "2"));
    this.buttonList.add(new GuiButton(3, this.width / 2 + 22, this.height / 2 - 60 + 10, 20, 20, "3"));
    this.buttonList.add(new GuiButton(4, this.width / 2 - 38, this.height / 2 - 30 + 10, 20, 20, "4"));
    this.buttonList.add(new GuiButton(5, this.width / 2 - 8, this.height / 2 - 30 + 10, 20, 20, "5"));
    this.buttonList.add(new GuiButton(6, this.width / 2 + 22, this.height / 2 - 30 + 10, 20, 20, "6"));
    this.buttonList.add(new GuiButton(7, this.width / 2 - 38, this.height / 2 + 10, 20, 20, "7"));
    this.buttonList.add(new GuiButton(8, this.width / 2 - 8, this.height / 2 + 10, 20, 20, "8"));
    this.buttonList.add(new GuiButton(9, this.width / 2 + 22, this.height / 2 + 10, 20, 20, "9"));
    this.buttonList.add(new GuiButton(10, this.width / 2 + 48, this.height / 2 + 30 + 10, 25, 20, "<-"));
    this.textboxKeycode = new GuiTextField(this.fontRendererObj, this.width / 2 - 37, this.height / 2 - 67, 77, 12);
    this.textboxKeycode.setTextColor(-1);
    this.textboxKeycode.setDisabledTextColour(-1);
    this.textboxKeycode.setEnableBackgroundDrawing(true);
    this.textboxKeycode.setMaxStringLength(11);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Aggregations

GuiTextField (net.minecraft.client.gui.GuiTextField)38 GuiButton (net.minecraft.client.gui.GuiButton)16 GuiButtonVariableDims (am2.guis.controls.GuiButtonVariableDims)2 Point (java.awt.Point)2 List (java.util.List)2 ItemStack (net.minecraft.item.ItemStack)2 WidgetMode (uk.co.qmunity.lib.client.gui.widget.WidgetMode)2 AMVector2 (am2.api.math.AMVector2)1 ContainerSpellCustomization (am2.containers.ContainerSpellCustomization)1 GuiSlideControl (am2.guis.controls.GuiSlideControl)1 GuiSpellImageButton (am2.guis.controls.GuiSpellImageButton)1 GuiStatedImageButton (am2.guis.controls.GuiStatedImageButton)1 GuiButtonCheckbox (blusunrize.immersiveengineering.client.gui.elements.GuiButtonCheckbox)1 GuiButtonIE (blusunrize.immersiveengineering.client.gui.elements.GuiButtonIE)1 GuiButtonState (blusunrize.immersiveengineering.client.gui.elements.GuiButtonState)1 GuiReactiveList (blusunrize.immersiveengineering.client.gui.elements.GuiReactiveList)1 TileEntityTurretChem (blusunrize.immersiveengineering.common.blocks.metal.TileEntityTurretChem)1 TileEntityTurretGun (blusunrize.immersiveengineering.common.blocks.metal.TileEntityTurretGun)1 IItemFrequency (com.builtbroken.mc.api.items.hz.IItemFrequency)1 GuiValidityStateIndicator (ivorius.reccomplex.gui.GuiValidityStateIndicator)1