Search in sources :

Example 36 with GuiTextField

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

the class GuiBoxAnalogController method initGui.

@Override
public void initGui() {
    if (tile == null)
        return;
    int w = (width - xSize) / 2;
    int h = (height - ySize) / 2;
    for (Map.Entry<SignalAspect, BitSet> entry : aspects.entrySet()) {
        GuiTextField textField = new GuiTextField(entry.getKey().ordinal(), fontRendererObj, w + 72, h + getYPosFromIndex(entry.getKey().ordinal()), 95, 10);
        textField.setMaxStringLength(37);
        textField.setText(rangeToString(entry.getValue()));
        textBox.put(entry.getKey(), textField);
    }
}
Also used : SignalAspect(mods.railcraft.api.signals.SignalAspect) BitSet(java.util.BitSet) GuiTextField(net.minecraft.client.gui.GuiTextField) EnumMap(java.util.EnumMap) Map(java.util.Map)

Example 37 with GuiTextField

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

the class HovercraftControllerGUI method keyTyped.

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
    boolean typed = false;
    for (GuiTextField text : textFields) {
        typed = typed || text.textboxKeyTyped(typedChar, keyCode);
    }
    if (!typed) {
        updateServer();
        super.keyTyped(typedChar, keyCode);
    }
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 38 with GuiTextField

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

the class HovercraftControllerGUI method initGui.

@Override
public void initGui() {
    super.initGui();
    this.mc.thePlayer.openContainer = this.inventorySlots;
    this.guiLeft = (this.width - this.xSize) / 2;
    this.guiTop = (this.height - this.ySize) / 2;
    textFields.clear();
    int fieldWidth = 40;
    int fieldHeight = 20;
    GuiTextField top = new GuiTextField(0, fontRendererObj, (width - fieldWidth) / 2 - 61, (height - fieldHeight) / 2 - 77, fieldWidth, fieldHeight);
    GuiTextField mid = new GuiTextField(0, fontRendererObj, (width - fieldWidth) / 2 - 57, (height - fieldHeight) / 2 - 49, fieldWidth, fieldHeight);
    GuiTextField bot = new GuiTextField(0, fontRendererObj, (width - fieldWidth) / 2 - 57, (height - fieldHeight) / 2 - 20, fieldWidth, fieldHeight);
    top.setEnableBackgroundDrawing(false);
    mid.setEnableBackgroundDrawing(false);
    bot.setEnableBackgroundDrawing(false);
    textFields.add(top);
    textFields.add(mid);
    textFields.add(bot);
    updateTextFields();
// buttonList.add(new GuiButton(1, width/2-100, height/2-24, "Bastard button"));
}
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