Search in sources :

Example 56 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project BiomesOPlenty by Glitchfiend.

the class GuiBOPPageTable method createTextField.

private GuiTextField createTextField(int xPosition, int yPosition, GuiBOPPageList.EditBoxEntry field) {
    GuiTextField guitextfield = new GuiTextField(field.getFieldId(), this.mc.fontRenderer, xPosition, yPosition, 150, 20);
    guitextfield.setText(field.getLabelText());
    guitextfield.setGuiResponder(this.responder);
    guitextfield.setVisible(field.isVisible());
    guitextfield.setValidator(field.getValidator());
    return guitextfield;
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 57 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project BiomesOPlenty by Glitchfiend.

the class GuiBOPPageTable method setup.

@Override
public void setup() {
    // go through the fields in twos (so they go in 2 columns)
    for (int k = 0; k < fields.length; k += 2) {
        GuiBOPPageList.GuiFieldEntry fieldLeft = fields[k];
        GuiBOPPageList.GuiFieldEntry fieldRight = k < fields.length - 1 ? fields[k + 1] : null;
        Gui guiLeft = this.createGui(fieldLeft, 0, fieldRight == null);
        Gui guiRight = this.createGui(fieldRight, 160, fieldLeft == null);
        GuiBOPPageList.GuiRowEntry row = new GuiBOPPageList.GuiRowEntry(guiLeft, guiRight);
        this.allRows.add(row);
        if (fieldLeft != null && guiLeft != null) {
            this.fieldIdToGuiMap.put(fieldLeft.getFieldId(), guiLeft);
            if (guiLeft instanceof GuiTextField) {
                this.allTextFieldGuis.add((GuiTextField) guiLeft);
            }
        }
        if (fieldRight != null && guiRight != null) {
            this.fieldIdToGuiMap.put(fieldRight.getFieldId(), guiRight);
            if (guiRight instanceof GuiTextField) {
                this.allTextFieldGuis.add((GuiTextField) guiRight);
            }
        }
    }
    this.resetRows();
}
Also used : Gui(net.minecraft.client.gui.Gui) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 58 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project ct.js by ChatTriggers.

the class ConfigString method init.

@Override
public void init() {
    super.init();
    updateValidDirectory(this.value);
    this.textField = new GuiTextField(0, Renderer.getFontRenderer(), Renderer.screen.getWidth() / 2 - 100 + this.x, this.y + 15, 200, 20);
    this.textField.setMaxStringLength(100);
    this.textField.setText(getIsValidColor() + this.value);
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 59 with GuiTextField

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

the class GuiPressureChamberInterface method initGui.

@Override
public void initGui() {
    super.initGui();
    int xStart = (width - xSize) / 2;
    int yStart = (height - ySize) / 2;
    statusStat = addAnimatedStat("Interface Status", new ItemStack(Blockss.pressureChamberInterface), 0xFFFFAA00, false);
    filterStat = addAnimatedStat("Filter", new ItemStack(net.minecraft.init.Blocks.hopper), 0xFF005500, false);
    filterStat.setTextWithoutCuttingString(getFilterText());
    Rectangle buttonRect = filterStat.getButtonScaledRectangle(5, 30, 170, 20);
    filterButton = new GuiButtonSpecial(1, buttonRect.x, buttonRect.y, buttonRect.width, buttonRect.height, "-");
    filterStat.addWidget(filterButton);
    creativeTabButton = new GuiButton(2, xStart + 91, yStart + 58, 78, 20, "-");
    nameFilterField = new GuiTextField(fontRendererObj, xStart + 91, yStart + 58, 78, 10);
    nameFilterField.setText(te.itemNameFilter);
    buttonList.add(creativeTabButton);
    if (te.filterMode != TileEntityPressureChamberInterface.EnumFilterMode.ITEM) {
        if (((Slot) inventorySlots.inventorySlots.get(5)).xDisplayPosition < 1000) {
            for (int i = 5; i < 14; i++) {
                ((Slot) inventorySlots.inventorySlots.get(i)).xDisplayPosition += 1000;
            }
        }
    } else {
        if (((Slot) inventorySlots.inventorySlots.get(5)).xDisplayPosition > 1000) {
            for (int i = 5; i < 14; i++) {
                ((Slot) inventorySlots.inventorySlots.get(i)).xDisplayPosition -= 1000;
            }
        }
    }
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) Rectangle(java.awt.Rectangle) ItemStack(net.minecraft.item.ItemStack) GuiTextField(net.minecraft.client.gui.GuiTextField) Point(java.awt.Point)

Example 60 with GuiTextField

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

the class GuiEntityTrackOptions method initGui.

@Override
public void initGui(IGuiScreen gui) {
    gui.getButtonList().add(new GuiButton(10, 30, 128, 150, 20, "Move Stat Screen..."));
    textField = new GuiTextField(gui.getFontRenderer(), 35, 60, 140, 10);
    textField.setFocused(true);
    if (PneumaticCraft.proxy.getPlayer() != null)
        textField.setText(ItemPneumaticArmor.getEntityFilter(PneumaticCraft.proxy.getPlayer().getCurrentArmor(3)));
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Aggregations

GuiTextField (net.minecraft.client.gui.GuiTextField)130 GuiButton (net.minecraft.client.gui.GuiButton)49 GuiButtonExt (net.minecraftforge.fml.client.config.GuiButtonExt)12 GuiCheckBox (net.minecraftforge.fml.client.config.GuiCheckBox)12 HoverChecker (net.minecraftforge.fml.client.config.HoverChecker)11 ItemStack (net.minecraft.item.ItemStack)9 List (java.util.List)8 GuiButtonThemed (betterquesting.api.client.gui.controls.GuiButtonThemed)5 Collectors (java.util.stream.Collectors)4 CaveConfigGui (cavern.client.config.CaveConfigGui)3 Config (cavern.config.Config)3 ArrayListExtended (cavern.util.ArrayListExtended)3 BlockMeta (cavern.util.BlockMeta)3 CaveFilters (cavern.util.CaveFilters)3 GuiButtonExt (cpw.mods.fml.client.config.GuiButtonExt)3 Map (java.util.Map)3 GuiDropDownList (riskyken.armourersWorkshop.client.gui.controls.GuiDropDownList)3 GuiButtonVariableDims (am2.guis.controls.GuiButtonVariableDims)2 GuiBigTextField (betterquesting.api.client.gui.controls.GuiBigTextField)2 CaveBiome (cavern.config.manager.CaveBiome)2