mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 04:09:40 +00:00
1.6.2 test - Finished liquids, added connected textures on glass
This commit is contained in:
1 parent
40c6f445a2
commit
a80fcbce86
704 files changed
+60909
No files matched your search
@@ -0,0 +1,77 @@
|
||||
package tconstruct.client.gui;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import tconstruct.client.TControls;
|
||||
import tconstruct.client.TProxyClient;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class InventoryTab extends GuiButton
|
||||
{
|
||||
int textureX;
|
||||
//String texture = "/gui/allitems.png";
|
||||
ItemStack renderStack;
|
||||
private static final ResourceLocation background = new ResourceLocation("gui/allitems.png");
|
||||
|
||||
public InventoryTab(int id, int posX, int posY, ItemStack stack, int texX)
|
||||
{
|
||||
super(id, posX, posY, 28, 32, "");
|
||||
textureX = texX;
|
||||
renderStack = stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws this button to the screen.
|
||||
*/
|
||||
public void drawButton (Minecraft mc, int mouseX, int mouseY)
|
||||
{
|
||||
if (this.drawButton)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.func_110434_K().func_110577_a(background);
|
||||
//mc.renderEngine.bindTexture(texture);
|
||||
|
||||
int yTexPos = this.enabled ? 0 : 32;
|
||||
int ySize = this.enabled ? 28 : 32;
|
||||
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, textureX * 28, yTexPos, 28, ySize);
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
this.zLevel = 100.0F;
|
||||
TProxyClient.itemRenderer.zLevel = 100.0F;
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
TProxyClient.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
|
||||
TProxyClient.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
TProxyClient.itemRenderer.zLevel = 0.0F;
|
||||
this.zLevel = 0.0F;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean mousePressed (Minecraft mc, int mouseX, int mouseY)
|
||||
{
|
||||
boolean inWindow = this.enabled && this.drawButton && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||
if (inWindow)
|
||||
{
|
||||
if (this.id == 2)
|
||||
TProxyClient.openInventoryGui();
|
||||
if (this.id == 3)
|
||||
TControls.openArmorGui();
|
||||
if (this.id == 4)
|
||||
TControls.openKnapsackGui();
|
||||
}
|
||||
return inWindow;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user