    001package net.minecraft.client.gui;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.client.Minecraft;
    006import org.lwjgl.opengl.GL11;
    007
    008@SideOnly(Side.CLIENT)
    009public class GuiButtonMerchant extends GuiButton
    010{
    011    /**
    012     * If true, then next page button will face to right, if false then next page button will face to left.
    013     */
    014    private final boolean mirrored;
    015
    016    public GuiButtonMerchant(int par1, int par2, int par3, boolean par4)
    017    {
    018        super(par1, par2, par3, 12, 19, "");
    019        this.mirrored = par4;
    020    }
    021
    022    /**
    023     * Draws this button to the screen.
    024     */
    025    public void drawButton(Minecraft par1Minecraft, int par2, int par3)
    026    {
    027        if (this.drawButton)
    028        {
    029            par1Minecraft.renderEngine.func_98187_b("/gui/trading.png");
    030            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    031            boolean flag = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
    032            int k = 0;
    033            int l = 176;
    034
    035            if (!this.enabled)
    036            {
    037                l += this.width * 2;
    038            }
    039            else if (flag)
    040            {
    041                l += this.width;
    042            }
    043
    044            if (!this.mirrored)
    045            {
    046                k += this.height;
    047            }
    048
    049            this.drawTexturedModalRect(this.xPosition, this.yPosition, l, k, this.width, this.height);
    050        }
    051    }
    052}