Search in sources :

Example 11 with GuiTextField

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

the class GuiAnvil method initGui.

/**
     * Adds the buttons (and other controls) to the screen in question.
     */
@Override
public void initGui() {
    super.initGui();
    Keyboard.enableRepeatEvents(true);
    int i = (width - xSize) / 2;
    int j = (height - ySize) / 2;
    this.itemNameField = new GuiTextField(0, fontRendererObj, i + 62, j + 24, 103, 12);
    itemNameField.setTextColor(-1);
    itemNameField.setDisabledTextColour(-1);
    itemNameField.setEnableBackgroundDrawing(false);
    itemNameField.setMaxStringLength(40);
    inventorySlots.removeListener(this);
    inventorySlots.addListener(this);
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 12 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class HovercraftControllerGUI method mouseClicked.

@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
    // super.mouseClicked(mouseX,mouseY,mouseButton);
    boolean prevFocused = false;
    boolean postFocused = false;
    for (GuiTextField text : textFields) {
        prevFocused = text.isFocused() || prevFocused;
        text.mouseClicked(mouseX, mouseY, mouseButton);
        postFocused = text.isFocused() || postFocused;
    }
    if (prevFocused && !postFocused) {
        updateServer();
    }
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 13 with GuiTextField

use of net.minecraft.client.gui.GuiTextField 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 14 with GuiTextField

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

the class GuiRadarStation method initGui.

@Override
public void initGui() {
    super.initGui();
    this.textFieldSafetyZone = new GuiTextField(fontRendererObj, 210, 67, 30, 12);
    this.textFieldSafetyZone.setMaxStringLength(3);
    this.textFieldSafetyZone.setText(this.tileEntity.safetyRange + "");
    this.textFieldAlarmRange = new GuiTextField(fontRendererObj, 210, 82, 30, 12);
    this.textFieldAlarmRange.setMaxStringLength(3);
    this.textFieldAlarmRange.setText(this.tileEntity.alarmRange + "");
    this.textFieldFrequency = new GuiTextField(fontRendererObj, 155, 112, 50, 12);
    this.textFieldFrequency.setMaxStringLength(6);
    this.textFieldFrequency.setText(this.tileEntity.getFrequency() + "");
//Engine.instance.packetHandler.sendToServer(new PacketTile(this.tileEntity, -1, true));
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 15 with GuiTextField

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

the class GuiLauncherScreen method initGui.

/** Adds the buttons (and other controls) to the screen in question. */
@Override
public void initGui() {
    super.initGui();
    this.target_xCoord_field = new GuiTextField(fontRendererObj, 110, 37, 45, 12);
    this.target_zCoord_field = new GuiTextField(fontRendererObj, 110, 52, 45, 12);
    this.target_yCoord_field = new GuiTextField(fontRendererObj, 110, 67, 45, 12);
    this.target_height_field = new GuiTextField(fontRendererObj, 110, 82, 45, 12);
    this.target_freq_field = new GuiTextField(fontRendererObj, 110, 97, 45, 12);
    this.target_freq_field.setMaxStringLength(4);
    this.target_xCoord_field.setMaxStringLength(6);
    this.target_zCoord_field.setMaxStringLength(6);
    this.target_yCoord_field.setMaxStringLength(3);
    this.target_height_field.setMaxStringLength(3);
    this.target_freq_field.setText(this.tileEntity.getFrequency() + "");
    this.target_height_field.setText(this.tileEntity.targetHeight + "");
    if (this.tileEntity.getTarget() == null) {
        this.target_xCoord_field.setText(Math.round(this.tileEntity.xCoord) + "");
        this.target_zCoord_field.setText(Math.round(this.tileEntity.zCoord) + "");
        this.target_yCoord_field.setText("0");
    } else {
        this.target_xCoord_field.setText(Math.round(this.tileEntity.getTarget().x()) + "");
        this.target_zCoord_field.setText(Math.round(this.tileEntity.getTarget().z()) + "");
        this.target_yCoord_field.setText(Math.round(this.tileEntity.getTarget().y()) + "");
    }
}
Also used : 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