Search in sources :

Example 66 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(0, fontRenderer, 20, 21, 35, 12);
    this.textFieldY = new GuiTextField(1, fontRenderer, 20, 37, 35, 12);
    this.textFieldZ = new GuiTextField(2, fontRenderer, 20, 52, 35, 12);
    this.textFieldFreq = new GuiTextField(3, fontRenderer, 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() + "");
    launch_button = addButton(new GuiButton(0, guiLeft + 69, guiTop + 60, 70, 20, LanguageUtility.getLocal("gui.launcherscreen.launch")));
    if (this.tileEntity.getTarget() == null) {
        this.textFieldX.setText(Math.round(this.tileEntity.getPos().getX()) + "");
        this.textFieldZ.setText(Math.round(this.tileEntity.getPos().getZ()) + "");
        this.textFieldY.setText(Math.round(this.tileEntity.getPos().getY()) + "");
    } 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 : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 67 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project pnc-repressurized by TeamPneumatic.

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(-1, fontRenderer, guiLeft + 20, guiTop + 36, 89, fontRenderer.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 68 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project RecurrentComplex by Ivorforce.

the class TableDataSourceTweakStructuresList method suggest.

public static void suggest(GuiChat chat, String command) {
    GuiTextField inputField = ReflectionHelper.getPrivateValue(GuiChat.class, chat, "inputField", "field_146415_a");
    inputField.setText(command);
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 69 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project MorePlanets by SteveKunG.

the class GuiCelestialSelection method initGui.

@Override
public void initGui() {
    this.listCelestial.clear();
    this.listCelestial.addAll(GalaxyRegistry.getRegisteredPlanets().values().stream().filter(planet -> planet.getDimensionID() != 0 && planet.getDimensionID() != ConfigManagerMP.moreplanets_dimension.idDimensionSpaceNether && planet.getReachable() && planet.getTierRequirement() > 0).collect(Collectors.toList()));
    this.listCelestial.addAll(GalaxyRegistry.getRegisteredMoons().values().stream().filter(moon -> moon.getReachable() && moon.getTierRequirement() > 0).collect(Collectors.toList()));
    this.selectionList = new GuiListCelestialSelection(this, this.listCelestial, this.width, this.height, 48, this.height - 32, 36);
    this.doneButton = this.addButton(new GuiButton(0, this.width / 2 - 28, this.height - 26, 100, 20, LangUtils.translate("gui.done")));
    this.addButton(new GuiButton(1, this.width / 2 + 80, this.height - 26, 100, 20, LangUtils.translate("gui.cancel")));
    this.doneButton.enabled = false;
    this.addButton(this.azButton = new GuiButton(SortType.A_TO_Z.id, this.width / 2 - 183, 26, 45, 20, "A-Z"));
    this.azButton.enabled = false;
    this.addButton(new GuiButton(SortType.Z_TO_A.id, this.width / 2 - 136, 26, 45, 20, "Z-A"));
    this.addButton(new GuiButton(SortType.TIER.id, this.width / 2 - 89, 26, 45, 20, "Tier"));
    this.searchField = new GuiTextField(0, this.fontRenderer, this.width / 2 - 150, this.height - 23, 100, 14);
    this.searchField.setFocused(true);
    this.searchField.setCanLoseFocus(true);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 70 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project Galacticraft by micdoodle8.

the class GuiSlimeling method initGui.

@Override
public void initGui() {
    super.initGui();
    this.buttonList.clear();
    Keyboard.enableRepeatEvents(true);
    int i = (this.width - this.xSize) / 2;
    int j = (this.height - this.ySize) / 2;
    this.stayButton = new GuiButton(0, i + 120, j + 122, 50, 20, "");
    this.stayButton.enabled = this.slimeling.isOwner(this.mc.player);
    this.stayButton.displayString = this.slimeling.isSitting() ? GCCoreUtil.translate("gui.slimeling.button.follow") : GCCoreUtil.translate("gui.slimeling.button.sit");
    this.buttonList.add(this.stayButton);
    this.nameField = new GuiTextField(0, this.fontRenderer, i + 44, j + 59, 103, 12);
    this.nameField.setText(this.slimeling.getName());
    this.nameField.setEnableBackgroundDrawing(false);
    this.nameField.setMaxStringLength(30);
    this.nameField.setFocused(this.slimeling.isOwner(this.mc.player));
    this.nameField.setCanLoseFocus(false);
    this.invX = i + 151;
    this.invY = j + 76;
}
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