Search in sources :

Example 1 with GuiButtonImage

use of net.minecraft.client.gui.GuiButtonImage in project Random-Things by lumien231.

the class GuiBlockDestabilizer method initGui.

@Override
public void initGui() {
    super.initGui();
    GuiBoolButton lazyButton = new GuiBoolButton(0, this.guiLeft + 7, this.guiTop + 7, 20, 20, new ResourceLocation("randomthings", "textures/gui/blockDestabilizer/lazy.png"), TileEntityBlockDestabilizer.class, "lazy", te);
    this.buttonList.add(lazyButton);
    GuiBoolButton fuzzyButton = new GuiBoolButton(1, this.guiLeft + 33, this.guiTop + 7, 20, 20, new ResourceLocation("randomthings", "textures/gui/blockDestabilizer/fuzzy.png"), TileEntityBlockDestabilizer.class, "fuzzy", te);
    this.buttonList.add(fuzzyButton);
    GuiButton resetButton = new GuiButtonImage(2, this.guiLeft + 58, this.guiTop + 7, 20, 20, 85, 0, 20, background);
    this.buttonList.add(resetButton);
}
Also used : GuiButton(net.minecraft.client.gui.GuiButton) ResourceLocation(net.minecraft.util.ResourceLocation) GuiBoolButton(lumien.randomthings.client.gui.elements.GuiBoolButton) GuiButtonImage(net.minecraft.client.gui.GuiButtonImage)

Example 2 with GuiButtonImage

use of net.minecraft.client.gui.GuiButtonImage 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)

Example 3 with GuiButtonImage

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

the class GuiAutoCraftItems method initGui.

@Override
public void initGui() {
    super.initGui();
    widthTooNarrow = this.width < SIZE_X + 176;
    if (recipeBook != null) {
        InventoryCrafting invCraft = container.tile.getWorkbenchCrafting();
        recipeBook.func_194303_a(width, height, mc, widthTooNarrow, invCraft);
        guiLeft = recipeBook.updateScreenPosition(widthTooNarrow, width, xSize);
        recipeButton = new GuiButtonImage(10, guiLeft + 5, height / 2 - 66, 20, 18, 0, 168, 19, VANILLA_CRAFTING_TABLE);
        buttonList.add(this.recipeButton);
    }
}
Also used : InventoryCrafting(net.minecraft.inventory.InventoryCrafting) GuiButtonImage(net.minecraft.client.gui.GuiButtonImage)

Example 4 with GuiButtonImage

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

the class GuiAdvancedCraftingTable method initGui.

@Override
public void initGui() {
    super.initGui();
    widthTooNarrow = this.width < SIZE_X + 176;
    if (recipeBook != null) {
        InventoryCrafting invCraft = container.tile.getWorkbenchCrafting();
        recipeBook.func_194303_a(width, height, mc, widthTooNarrow, invCraft);
        guiLeft = recipeBook.updateScreenPosition(widthTooNarrow, width, xSize);
        recipeButton = new GuiButtonImage(10, guiLeft + 5, height / 2 - 90, 20, 18, 0, 168, 19, VANILLA_CRAFTING_TABLE);
        buttonList.add(this.recipeButton);
    }
}
Also used : InventoryCrafting(net.minecraft.inventory.InventoryCrafting) GuiButtonImage(net.minecraft.client.gui.GuiButtonImage)

Example 5 with GuiButtonImage

use of net.minecraft.client.gui.GuiButtonImage in project Nutrition by WesCook.

the class EventNutritionButton method guiOpen.

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void guiOpen(GuiScreenEvent.InitGuiEvent.Post event) {
    // If any inventory except player inventory is opened, get out
    GuiScreen gui = event.getGui();
    if (!(gui instanceof GuiInventory))
        return;
    // Get button position
    int[] pos = calculateButtonPosition(gui);
    int x = pos[0];
    int y = pos[1];
    // Create button
    buttonNutrition = new GuiButtonImage(NUTRITION_ID, x, y, 20, 18, 14, 0, 19, NUTRITION_ICON);
    event.getButtonList().add(buttonNutrition);
}
Also used : GuiScreen(net.minecraft.client.gui.GuiScreen) GuiInventory(net.minecraft.client.gui.inventory.GuiInventory) GuiButtonImage(net.minecraft.client.gui.GuiButtonImage) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

GuiButtonImage (net.minecraft.client.gui.GuiButtonImage)5 InventoryCrafting (net.minecraft.inventory.InventoryCrafting)2 GuiBoolButton (lumien.randomthings.client.gui.elements.GuiBoolButton)1 Minecraft (net.minecraft.client.Minecraft)1 GuiButton (net.minecraft.client.gui.GuiButton)1 GuiButtonToggle (net.minecraft.client.gui.GuiButtonToggle)1 GuiScreen (net.minecraft.client.gui.GuiScreen)1 GuiTextField (net.minecraft.client.gui.GuiTextField)1 GuiInventory (net.minecraft.client.gui.inventory.GuiInventory)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1