summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/client/AbstractTab.java')
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/AbstractTab.java26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java
index 6728181..5ff4d2f 100644
--- a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java
+++ b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java
@@ -9,6 +9,7 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.*;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.util.Variables;
/**
* @author TinkersCOnstruct
@@ -16,13 +17,13 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public abstract class AbstractTab extends GuiButton
{
- ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png");
+ ResourceLocation texture = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png");
ItemStack renderStack;
RenderItem itemRenderer = new RenderItem();
public AbstractTab(int id, int posX, int posY, ItemStack renderStack)
{
- super(id, posX, posY, 28, 32, "");
+ super(id, posX, posY, 18, 18, "");
this.renderStack = renderStack;
}
@@ -32,26 +33,24 @@ public abstract class AbstractTab extends GuiButton
if (this.visible)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-
- int yTexPos = this.enabled ? 3 : 32;
- int ySize = this.enabled ? 25 : 32;
- int xOffset = this.id == 2 ? 0 : 1;
- int yPos = this.yPosition + (this.enabled ? 3 : 0);
+ int xOffset = this.enabled ? 0 : 8;
mc.renderEngine.bindTexture(this.texture);
- this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize);
+ this.drawTexturedModalRect(this.xPosition, yPosition, 144 + xOffset, 32, 18, 18);
+ GL11.glPushMatrix();
RenderHelper.enableGUIStandardItemLighting();
this.zLevel = 100.0F;
this.itemRenderer.zLevel = 100.0F;
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
- this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
+ this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1, yPosition + 1);
+ this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1, yPosition + 1);
GL11.glDisable(GL11.GL_LIGHTING);
this.itemRenderer.zLevel = 0.0F;
this.zLevel = 0.0F;
RenderHelper.disableStandardItemLighting();
+ GL11.glPopMatrix();
}
}
@@ -59,12 +58,7 @@ public abstract class AbstractTab extends GuiButton
public boolean mousePressed (Minecraft mc, int mouseX, int mouseY)
{
boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
-
- if (inWindow)
- {
- this.onTabClicked();
- }
-
+ if (inWindow) this.onTabClicked();
return inWindow;
}