Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- import net.minecraft.client.Minecraft;
- import org.lwjgl.opengl.GL11;
- public class AC_GuiTradingButtons extends GuiButton {
- public static Minecraft mc = ModLoader.getMinecraftInstance();
- protected static RenderItem itemRenderer = new RenderItem();
- /**
- * Holds the ItemStack that will be used to draw the achievement into the GUI.
- */
- public final ItemStack theItemStack;
- public int amount, cost;
- public AC_GuiTradingButtons(int par1, int par2, int par3, int par4, int par5, String par6Str, ItemStack par7ItemStack, int amount, int cost)
- {
- super(par1, par2, par3, par4, par5, par6Str);
- this.theItemStack = par7ItemStack;
- this.amount = amount;
- this.cost = cost;
- }
- /**
- * Draws this button to the screen.
- */
- public void drawButton(Minecraft par1Minecraft, int par2, int par3)
- {
- if (this.drawButton)
- {
- FontRenderer var4 = par1Minecraft.fontRenderer;
- boolean var5 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
- int var6 = this.getHoverState(var5);
- int var7 = 14737632;
- if (!this.enabled)
- {
- var7 = -6250336;
- }
- else if (var5)
- {
- var7 = 16777120;
- this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 55) / 2, var7);
- }
- this.drawCenteredString(var4, "$" + String.valueOf(this.cost), this.xPosition + this.width / 2, this.yPosition + (this.height + 30) / 2, var7);
- this.drawCenteredString(var4, "x" + String.valueOf(this.amount), this.xPosition + this.width / 2, this.yPosition + (this.height - 30) / 2, var7);
- this.itemRenderer.renderItemIntoGUI(mc.fontRenderer, this.mc.renderEngine, theItemStack, this.xPosition + 7, this.yPosition + 4);
- }
- }
- }
Add Comment
Please, Sign In to add comment