Search in sources :

Example 61 with GuiTextField

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

the class GuiInscriptionTable method initGui.

@Override
public void initGui() {
    super.initGui();
    searchFieldPosition = new AMVector2(39, 59);
    searchFieldDimensions = new AMVector2(141, 12);
    searchBar = new GuiTextField(Minecraft.getMinecraft().fontRenderer, searchFieldPosition.iX, searchFieldPosition.iY, searchFieldDimensions.iX, searchFieldDimensions.iY);
    nameFieldPosition = new AMVector2(39, 93);
    nameFieldDimensions = new AMVector2(141, 12);
    nameBar = new GuiTextField(Minecraft.getMinecraft().fontRenderer, nameFieldPosition.iX, nameFieldPosition.iY, nameFieldDimensions.iX, nameFieldDimensions.iY);
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    createSpellButton = new GuiButtonVariableDims(0, l - 65, i1, StatCollector.translateToLocal("am2.gui.makeSpell"));
    createSpellButton.setDimensions(60, 20);
    resetSpellButton = new GuiButtonVariableDims(1, l + 120, i1 + 72, StatCollector.translateToLocal("am2.gui.resetSpell"));
    resetSpellButton.setDimensions(60, 20);
    resetSpellButton.visible = false;
    if (usingPlayer.capabilities.isCreativeMode) {
        this.buttonList.add(createSpellButton);
    }
    this.buttonList.add(resetSpellButton);
    nameBar.setText(((ContainerInscriptionTable) this.inventorySlots).getSpellName());
    if (nameBar.getText().equals("")) {
        nameBar.setText(defaultNameLabel);
    }
    searchBar.setText(defaultSearchLabel);
    result = ((ContainerInscriptionTable) this.inventorySlots).validateCurrentDefinition();
}
Also used : AMVector2(am2.api.math.AMVector2) GuiTextField(net.minecraft.client.gui.GuiTextField) GuiButtonVariableDims(am2.guis.controls.GuiButtonVariableDims)

Example 62 with GuiTextField

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

the class GuiKeystone method initGui.

@Override
public void initGui() {
    super.initGui();
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    combinationName = new GuiTextField(fontRendererObj, 44, 86, 88, 16);
    int sliderMax = Math.max(0, ItemsCommonProxy.keystone.numCombinations(((ContainerKeystone) this.inventorySlots).getKeystoneStack()) - 9);
    scrollBar = new GuiSlideControl(4, l + xSize + 58, i1 + 14, 159, "", 0, 0, Math.max(sliderMax, 1));
    scrollBar.setVertical();
    scrollBar.setButtonOnly();
    scrollBar.setOverrideTexture(background);
    scrollBar.setButtonProperties(184, 193, 190, 193, 6, 15);
    scrollBar.setScale(1.0f);
    scrollBar.setNoDynamicDisplay(true);
    if (sliderMax == 0)
        scrollBar.enabled = false;
    prevCombination = new GuiStatedImageButton(3, l + 8, i1 + 86, background, 208, 192);
    nextCombination = new GuiStatedImageButton(2, l + 152, i1 + 86, background, 208, 208);
    addCombination = new GuiStatedImageButton(0, l + 26, i1 + 86, background, 208, 224);
    forgetCombination = new GuiStatedImageButton(1, l + 134, i1 + 86, background, 208, 240);
    prevCombination.addStateCoords(GuiStatedImageButton.States.MOUSEOVER, 224, 192);
    nextCombination.addStateCoords(GuiStatedImageButton.States.MOUSEOVER, 224, 208);
    addCombination.addStateCoords(GuiStatedImageButton.States.MOUSEOVER, 224, 224);
    forgetCombination.addStateCoords(GuiStatedImageButton.States.MOUSEOVER, 224, 240);
    prevCombination.addStateCoords(GuiStatedImageButton.States.CLICK, 240, 192);
    nextCombination.addStateCoords(GuiStatedImageButton.States.CLICK, 240, 208);
    addCombination.addStateCoords(GuiStatedImageButton.States.CLICK, 240, 224);
    forgetCombination.addStateCoords(GuiStatedImageButton.States.CLICK, 240, 240);
    prevCombination.setDimensions(16, 16);
    nextCombination.setDimensions(16, 16);
    addCombination.setDimensions(16, 16);
    forgetCombination.setDimensions(16, 16);
    this.buttonList.add(addCombination);
    this.buttonList.add(forgetCombination);
    this.buttonList.add(nextCombination);
    this.buttonList.add(prevCombination);
    this.buttonList.add(scrollBar);
}
Also used : GuiStatedImageButton(am2.guis.controls.GuiStatedImageButton) GuiTextField(net.minecraft.client.gui.GuiTextField) GuiSlideControl(am2.guis.controls.GuiSlideControl)

Example 63 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project ImmersiveEngineering by BluSunrize.

the class GuiTurret method initGui.

@Override
public void initGui() {
    super.initGui();
    Keyboard.enableRepeatEvents(true);
    this.nameField = new GuiTextField(0, this.fontRenderer, guiLeft + 11, guiTop + 88, 58, 12);
    this.nameField.setTextColor(-1);
    this.nameField.setDisabledTextColour(-1);
    this.nameField.setEnableBackgroundDrawing(false);
    this.nameField.setMaxStringLength(30);
    this.buttonList.clear();
    this.buttonList.add(new GuiReactiveList(this, 0, guiLeft + 10, guiTop + 10, 60, 72, tile.targetList.toArray(new String[tile.targetList.size()])).setPadding(0, 0, 2, 2).setFormatting(1, false));
    this.buttonList.add(new GuiButtonIE(1, guiLeft + 74, guiTop + 84, 24, 16, I18n.format(Lib.GUI_CONFIG + "turret.add"), "immersiveengineering:textures/gui/turret.png", 176, 65));
    this.buttonList.add(new GuiButtonCheckbox(2, guiLeft + 74, guiTop + 10, I18n.format(Lib.GUI_CONFIG + "turret.blacklist"), !tile.whitelist));
    this.buttonList.add(new GuiButtonCheckbox(3, guiLeft + 74, guiTop + 26, I18n.format(Lib.GUI_CONFIG + "turret.animals"), tile.attackAnimals));
    this.buttonList.add(new GuiButtonCheckbox(4, guiLeft + 74, guiTop + 42, I18n.format(Lib.GUI_CONFIG + "turret.players"), tile.attackPlayers));
    this.buttonList.add(new GuiButtonCheckbox(5, guiLeft + 74, guiTop + 58, I18n.format(Lib.GUI_CONFIG + "turret.neutrals"), tile.attackNeutrals));
    if (tile instanceof TileEntityTurretChem)
        this.buttonList.add(new GuiButtonState(6, guiLeft + 135, guiTop + 68, 14, 14, null, ((TileEntityTurretChem) tile).ignite, "immersiveengineering:textures/gui/turret.png", 176, 51, 0));
    else if (tile instanceof TileEntityTurretGun)
        this.buttonList.add(new GuiButtonState(6, guiLeft + 134, guiTop + 31, 16, 16, null, ((TileEntityTurretGun) tile).expelCasings, "immersiveengineering:textures/gui/turret.png", 176, 81, 0));
}
Also used : GuiReactiveList(blusunrize.immersiveengineering.client.gui.elements.GuiReactiveList) GuiButtonIE(blusunrize.immersiveengineering.client.gui.elements.GuiButtonIE) TileEntityTurretGun(blusunrize.immersiveengineering.common.blocks.metal.TileEntityTurretGun) GuiButtonState(blusunrize.immersiveengineering.client.gui.elements.GuiButtonState) GuiButtonCheckbox(blusunrize.immersiveengineering.client.gui.elements.GuiButtonCheckbox) GuiTextField(net.minecraft.client.gui.GuiTextField) TileEntityTurretChem(blusunrize.immersiveengineering.common.blocks.metal.TileEntityTurretChem)

Example 64 with GuiTextField

use of net.minecraft.client.gui.GuiTextField in project Engine by VoltzEngine-Project.

the class GuiContainerBase method drawScreen.

@Override
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
    super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
    if (fields != null && fields.size() > 0) {
        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glDisable(GL11.GL_BLEND);
        for (GuiTextField field : fields) {
            field.drawTextBox();
        }
    }
}
Also used : GuiTextField(net.minecraft.client.gui.GuiTextField)

Example 65 with GuiTextField

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

the class GuiContainerBase method drawScreen.

@Override
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
    super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
    renderHoveredToolTip(p_73863_1_, p_73863_2_);
    if (fields != null && fields.size() > 0) {
        GlStateManager.disableLighting();
        GlStateManager.disableBlend();
        for (GuiTextField field : fields) {
            field.drawTextBox();
        }
    }
}
Also used : 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