Search in sources :

Example 1 with GuiButtonToggle

use of net.minecraft.client.gui.GuiButtonToggle in project TechReborn by TechReborn.

the class GuiAutoCraftingRecipeSlector method initVisuals.

@Override
public void initVisuals(boolean p_193014_1_, InventoryCrafting p_193014_2_) {
    super.initVisuals(p_193014_1_, p_193014_2_);
    // Pulls the button off the screen as we dont need it
    toggleRecipesBtn = new GuiButtonToggle(0, -1000, -1000, 26, 16, false);
    toggleRecipesBtn.initTextureValues(152, 41, 28, 18, RECIPE_BOOK);
// recipeBook.setGuiOpen(true);
}
Also used : GuiButtonToggle(net.minecraft.client.gui.GuiButtonToggle)

Example 2 with GuiButtonToggle

use of net.minecraft.client.gui.GuiButtonToggle in project BuildCraft by BuildCraft.

the class GuiRecipeBookPhantom method initVisuals.

@Override
public void initVisuals(boolean someBoolean, InventoryCrafting invCrafting) {
    // Remove the craftable toggle button: we can always craft everything (as we can only create ghosts)
    super.initVisuals(someBoolean, invCrafting);
    try {
        GuiButtonToggle button = (GuiButtonToggle) FIELD_BUTTON_TOGGLE.get(this);
        button.x = -100000;
        button.y = -100000;
    } catch (IllegalAccessException e) {
        e.printStackTrace();
        throw new Error("Couldn't access the toggle button!");
    }
}
Also used : GuiButtonToggle(net.minecraft.client.gui.GuiButtonToggle)

Example 3 with GuiButtonToggle

use of net.minecraft.client.gui.GuiButtonToggle in project SpringFestival by TeamCovertDragon.

the class GuiContainerRedPacket method initGui.

@Override
public void initGui() {
    super.initGui();
    GuiButtonImage sendRedPacket = new GuiButtonImage(0, this.guiLeft + 17, this.guiTop + 13, 25, 15, 195, 0, 0, TEXTURE_BG);
    buttonList.add(sendRedPacket);
    GuiButtonToggle passcodeModeToggle = new GuiButtonToggle(1, this.guiLeft + 15, this.guiTop + 49, 14, 14, false) {

        @Override
        public void drawButton(Minecraft mc, int mouseX, int mouseY, float partialTicks) {
            if (passcodeMode) {
                super.drawButton(mc, mouseX, mouseY, partialTicks);
            }
        }
    };
    passcodeModeToggle.initTextureValues(195, 17, 0, 0, TEXTURE_BG);
    buttonList.add(passcodeModeToggle);
    this.receiver = new GuiTextField(2, this.fontRenderer, this.guiLeft + 46 + 4, this.guiTop + 13 + 3, 133, 15);
    this.receiver.setTextColor(-1);
    this.receiver.setDisabledTextColour(-1);
    this.receiver.setEnableBackgroundDrawing(false);
    this.receiver.setCanLoseFocus(true);
    this.receiver.setEnabled(true);
    this.message = new GuiTextField(3, this.fontRenderer, this.guiLeft + 17 + 4, this.guiTop + 31 + 3, 162, 15);
    this.message.setTextColor(-1);
    this.message.setEnableBackgroundDrawing(false);
    this.message.setCanLoseFocus(true);
    this.message.setEnabled(true);
    NBTTagCompound data = Minecraft.getMinecraft().player.getHeldItemMainhand().getTagCompound();
    if (data != null) {
        this.receiver.setText(data.getString("receiver_name"));
        this.message.setText(data.getString("message"));
    }
}
Also used : GuiButtonToggle(net.minecraft.client.gui.GuiButtonToggle) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) GuiTextField(net.minecraft.client.gui.GuiTextField) GuiButtonImage(net.minecraft.client.gui.GuiButtonImage) Minecraft(net.minecraft.client.Minecraft)

Aggregations

GuiButtonToggle (net.minecraft.client.gui.GuiButtonToggle)3 Minecraft (net.minecraft.client.Minecraft)1 GuiButtonImage (net.minecraft.client.gui.GuiButtonImage)1 GuiTextField (net.minecraft.client.gui.GuiTextField)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1