Jump to content

Recommended Posts

Posted

So i am making a client atm and i want to have a transparent rainbow in my GuiInventory but idk how to make it transparent heres the GuiInventory code i have at the moment help would be apprciated 

Spoiler

package net.minecraft.src;

import java.awt.Color;
import java.util.List;
import me.darkmagician6.morbid.gui.ColorUtil;
import me.darkmagician6.morbid.gui.Wrapper;
import me.darkmagician6.morbid.util.R2DUtils;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;

public class GuiInventory
  extends InventoryEffectRenderer
{
  private float xSize_lo;
  private float ySize_lo;
  int alpha = 127;
  
  public GuiInventory(EntityPlayer par1EntityPlayer)
  {
    super(par1EntityPlayer.inventoryContainer);
    this.allowUserInput = true;
    par1EntityPlayer.addStat(AchievementList.openInventory, 1);
  }
  
  public void updateScreen()
  {
    if (this.mc.playerController.isInCreativeMode()) {
      this.mc.displayGuiScreen(new GuiContainerCreative(Minecraft.thePlayer));
    }
  }
  
  public void initGui()
  {
    this.buttonList.clear();
    if (this.mc.playerController.isInCreativeMode()) {
      this.mc.displayGuiScreen(new GuiContainerCreative(Minecraft.thePlayer));
    } else {
      super.initGui();
    }
  }
  
  protected void drawGuiContainerForegroundLayer(int par1, int par2)
  {
    this.fontRenderer.drawString(StatCollector.translateToLocal("N1kZz"), 86, 64, ColorUtil.rainbow(2.0E8D, 1.0F).getRGB());
  }
  
  public void drawScreen(int par1, int par2, float par3)
  {
    super.drawScreen(par1, par2, par3);
    this.xSize_lo = par1;
    this.ySize_lo = par2;
  }
  
  protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
  {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.renderEngine.bindTexture("/gui/inventory.png");
    int var4 = this.guiLeft;
    int var5 = this.guiTop;
    drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);
    drawPlayerOnGui(this.mc, var4 + 51, var5 + 75, 30, var4 + 51 - this.xSize_lo, var5 + 75 - 50 - this.ySize_lo);
  }
  
  public static void drawPlayerOnGui(Minecraft par0Minecraft, int par1, int par2, int par3, float par4, float par5)
  {
      
    GL11.glEnable(2903);
    GL11.glPushMatrix();
    GL11.glTranslatef(par1, par2, 50.0F);
    GL11.glScalef(-par3, par3, par3);
    GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
    float var6 = Minecraft.thePlayer.renderYawOffset;
    float var7 = Minecraft.thePlayer.rotationYaw;
    float var8 = Minecraft.thePlayer.rotationPitch;
    GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-(float)Math.atan(par5 / 40.0F) * 20.0F, 1.0F, 0.0F, 0.0F);
    Minecraft.thePlayer.renderYawOffset = ((float)Math.atan(par4 / 40.0F) * 20.0F);
    Minecraft.thePlayer.rotationYaw = ((float)Math.atan(par4 / 40.0F) * 40.0F);
    Minecraft.thePlayer.rotationPitch = (-(float)Math.atan(par5 / 40.0F) * 20.0F);
    Minecraft.thePlayer.rotationYawHead = Minecraft.thePlayer.rotationYaw;
    GL11.glTranslatef(0.0F, Minecraft.thePlayer.yOffset, 0.0F);
    RenderManager.instance.playerViewY = 180.0F;
    RenderManager.instance.renderEntityWithPosYaw(Minecraft.thePlayer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
    Minecraft.thePlayer.renderYawOffset = var6;
    Minecraft.thePlayer.rotationYaw = var7;
    Minecraft.thePlayer.rotationPitch = var8;
    GL11.glPopMatrix();
    RenderHelper.disableStandardItemLighting();
    GL11.glDisable(32826);
    OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GL11.glDisable(3553);
    OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glDisable(GL11.GL_DEPTH_TEST);
      GL11.glDepthMask(false);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      R2DUtils.drawRect(var6 /4 - 1500, (float)(Wrapper.getScreenHeight() -5 ), var6 / 4 + 1500, Wrapper.getScreenHeight(), ColorUtil.rainbow(2.0E8D, 1.0F ).getRGB());

  }
  
  protected void actionPerformed(GuiButton par1GuiButton)
  {
    if (par1GuiButton.id == 0) {
      this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter));
    }
    if (par1GuiButton.id == 1) {
      this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter));
    }
  }
}

 

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.