/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { DrawDefaultBackground(); int i = GuiLeft; int j = GuiTop; DrawGuiContainerBackgroundLayer(par3, par1, par2); RenderHelper.EnableGUIStandardItemLighting(); //GL.PushMatrix(); //GL.Translate(i, j, 0.0F); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); //GL.Enable(EnableCap.RescaleNormal); Slot slot = null; int k = 240; int i1 = 240; OpenGlHelper.SetLightmapTextureCoords(OpenGlHelper.LightmapTexUnit, (float)k / 1.0F, (float)i1 / 1.0F); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); for (int l = 0; l < InventorySlots.InventorySlots.Count; l++) { Slot slot1 = (Slot)InventorySlots.InventorySlots[l]; DrawSlotInventory(slot1); if (IsMouseOverSlot(slot1, par1, par2)) { slot = slot1; //GL.Disable(EnableCap.Lighting); //GL.Disable(EnableCap.DepthTest); int j1 = slot1.XDisplayPosition; int k1 = slot1.YDisplayPosition; DrawGradientRect(j1, k1, j1 + 16, k1 + 16, 0x80fffff, 0x80fffff); //GL.Enable(EnableCap.Lighting); //GL.Enable(EnableCap.DepthTest); } } DrawGuiContainerForegroundLayer(); InventoryPlayer inventoryplayer = Mc.ThePlayer.Inventory; if (inventoryplayer.GetItemStack() != null) { //GL.Translate(0.0F, 0.0F, 32F); ZLevel = 200F; ItemRenderer.ZLevel = 200F; ItemRenderer.RenderItemIntoGUI(FontRenderer, Mc.RenderEngineOld, inventoryplayer.GetItemStack(), par1 - i - 8, par2 - j - 8); ItemRenderer.RenderItemOverlayIntoGUI(FontRenderer, Mc.RenderEngineOld, inventoryplayer.GetItemStack(), par1 - i - 8, par2 - j - 8); ZLevel = 0.0F; ItemRenderer.ZLevel = 0.0F; } //GL.Disable(EnableCap.RescaleNormal); RenderHelper.DisableStandardItemLighting(); //GL.Disable(EnableCap.Lighting); //GL.Disable(EnableCap.DepthTest); if (inventoryplayer.GetItemStack() == null && slot != null && slot.GetHasStack()) { ItemStack itemstack = slot.GetStack(); List <string> list = itemstack.GetItemNameandInformation(); if (list.Count > 0) { int l1 = 0; for (int i2 = 0; i2 < list.Count; i2++) { int k2 = FontRenderer.GetStringWidth(list[i2]); if (k2 > l1) { l1 = k2; } } int j2 = (par1 - i) + 12; int l2 = par2 - j - 12; int i3 = l1; int j3 = 8; if (list.Count > 1) { j3 += 2 + (list.Count - 1) * 10; } ZLevel = 300F; ItemRenderer.ZLevel = 300F; int k3 = 0xf010001; DrawGradientRect(j2 - 3, l2 - 4, j2 + i3 + 3, l2 - 3, k3, k3); DrawGradientRect(j2 - 3, l2 + j3 + 3, j2 + i3 + 3, l2 + j3 + 4, k3, k3); DrawGradientRect(j2 - 3, l2 - 3, j2 + i3 + 3, l2 + j3 + 3, k3, k3); DrawGradientRect(j2 - 4, l2 - 3, j2 - 3, l2 + j3 + 3, k3, k3); DrawGradientRect(j2 + i3 + 3, l2 - 3, j2 + i3 + 4, l2 + j3 + 3, k3, k3); int l3 = 0x505000ff; int i4 = (l3 & 0xfefefe) >> 1 | l3 & 0xff00000; DrawGradientRect(j2 - 3, (l2 - 3) + 1, (j2 - 3) + 1, (l2 + j3 + 3) - 1, l3, i4); DrawGradientRect(j2 + i3 + 2, (l2 - 3) + 1, j2 + i3 + 3, (l2 + j3 + 3) - 1, l3, i4); DrawGradientRect(j2 - 3, l2 - 3, j2 + i3 + 3, (l2 - 3) + 1, l3, l3); DrawGradientRect(j2 - 3, l2 + j3 + 2, j2 + i3 + 3, l2 + j3 + 3, i4, i4); for (int j4 = 0; j4 < list.Count; j4++) { string s = list[j4]; if (j4 == 0) { //s = (new StringBuilder()).Append((char)0xa7).Append(int.ToHexString(itemstack.GetRarity().NameColor)).Append(s).ToString(); } else { s = (new StringBuilder()).Append((char)0xa7).Append(s).ToString(); } FontRenderer.DrawStringWithShadow(s, j2, l2, -1); if (j4 == 0) { l2 += 2; } l2 += 10; } ZLevel = 0.0F; ItemRenderer.ZLevel = 0.0F; } } //GL.PopMatrix(); base.DrawScreen(par1, par2, par3); //GL.Enable(EnableCap.Lighting); //GL.Enable(EnableCap.DepthTest); }