/// <summary>
        /// Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
        /// </summary>
        protected override void ActionPerformed(GuiButton par1GuiButton)
        {
            if (!par1GuiButton.Enabled)
            {
                return;
            }

            int i = GuiGameSettings.GuiScale;

            if (par1GuiButton.Id < 100 && (par1GuiButton is GuiSmallButton))
            {
                GuiGameSettings.SetOptionValue(((GuiSmallButton)par1GuiButton).ReturnOptions(), 1);
                par1GuiButton.DisplayString = GuiGameSettings.GetKeyBinding(Options.GetOptions(par1GuiButton.Id));
            }

            if (par1GuiButton.Id == 200)
            {
                Mc.GameSettings.SaveOptions();
                Mc.DisplayGuiScreen(ParentGuiScreen);
            }

            if (GuiGameSettings.GuiScale != i)
            {
                ScaledResolution scaledresolution = new ScaledResolution(Mc.GameSettings, Mc.DisplayWidth, Mc.DisplayHeight);
                int j = scaledresolution.GetScaledWidth();
                int k = scaledresolution.GetScaledHeight();
                SetWorldAndResolution(Mc, j, k);
            }
        }
Example #2
0
        ///<summary>
        /// Renders dragon's (boss) health on the HUD
        ///</summary>
        private void RenderBossHealth()
        {
            if (RenderDragon.EntityDragon == null)
            {
                return;
            }

            EntityDragon entitydragon = RenderDragon.EntityDragon;

            RenderDragon.EntityDragon = null;
            FontRendererOld  fontrenderer     = mc.FontRendererOld;
            ScaledResolution scaledresolution = new ScaledResolution(mc.GameSettings, mc.DisplayWidth, mc.DisplayHeight);
            int  i     = scaledresolution.GetScaledWidth();
            int  c     = 266;
            int  j     = i / 2 - c / 2;
            int  k     = (int)(((float)entitydragon.Func_41010_ax() / (float)entitydragon.GetMaxHealth()) * (float)(c + 1));
            byte byte0 = 12;

            DrawTexturedModalRect(j, byte0, 0, 74, c, 5);
            DrawTexturedModalRect(j, byte0, 0, 74, c, 5);

            if (k > 0)
            {
                DrawTexturedModalRect(j, byte0, 0, 79, k, 5);
            }

            string s = "Boss health";

            fontrenderer.DrawStringWithShadow(s, i / 2 - fontrenderer.GetStringWidth(s) / 2, byte0 - 10, 0xff00ff);
            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
            //GL.BindTexture(TextureTarget.Texture2D, mc.RenderEngineOld.GetTexture("/gui/icons.png"));
        }
        /// <summary>
        /// Update the display of the achievement window to match the game window.
        /// </summary>
        private void UpdateAchievementWindowScale()
        {
            //GL.Viewport(0, 0, TheGame.DisplayWidth, TheGame.DisplayHeight);
            //GL.MatrixMode(MatrixMode.Projection);
            //GL.LoadIdentity();
            //GL.MatrixMode(MatrixMode.Modelview);
            //GL.LoadIdentity();
            AchievementWindowWidth  = TheGame.DisplayWidth;
            AchievementWindowHeight = TheGame.DisplayHeight;
            ScaledResolution scaledresolution = new ScaledResolution(TheGame.GameSettings, TheGame.DisplayWidth, TheGame.DisplayHeight);

            AchievementWindowWidth  = scaledresolution.GetScaledWidth();
            AchievementWindowHeight = scaledresolution.GetScaledHeight();
            //GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            //GL.MatrixMode(MatrixMode.Projection);
            //GL.LoadIdentity();
            //GL.Ortho(0.0F, AchievementWindowWidth, AchievementWindowHeight, 0.0F, 1000D, 3000D);
            //GL.MatrixMode(MatrixMode.Modelview);
            //GL.LoadIdentity();
            //GL.Translate(0.0F, 0.0F, -2000F);
        }
Example #4
0
        /// <summary>
        /// Updates the progress bar on the loading screen to the specified amount. Args: loadProgress
        /// </summary>
        public virtual void SetLoadingProgress(int par1)
        {
            if (!Mc.Running)
            {
                if (Field_1005_e)
                {
                    return;
                }
                else
                {
                    throw new MinecraftError();
                }
            }

            long l = JavaHelper.CurrentTimeMillis();

            if (l - Field_1006_d < 100L)
            {
                return;
            }

            Field_1006_d = l;
            ScaledResolution scaledresolution = new ScaledResolution(Mc.GameSettings, Mc.DisplayWidth, Mc.DisplayHeight);
            int i = scaledresolution.GetScaledWidth();
            int j = scaledresolution.GetScaledHeight();            /*
                                                                    * GL.Clear(ClearBufferMask.ColorBufferBit);
                                                                    * GL.MatrixMode(MatrixMode.Projection);
                                                                    * GL.LoadIdentity();
                                                                    * GL.Ortho(0.0F, scaledresolution.ScaledWidthD, scaledresolution.ScaledHeightD, 0.0F, 100D, 300D);
                                                                    * GL.MatrixMode(MatrixMode.Modelview);
                                                                    * GL.LoadIdentity();
                                                                    * GL.Translate(0.0F, 0.0F, -200F);
                                                                    * GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
                                                                    * Tessellator tessellator = Tessellator.Instance;
                                                                    * int k = Mc.RenderEngineOld.GetTexture("/gui/background.png");*/
            //GL.BindTexture(TextureTarget.Texture2D, k);
            //Mc.RenderEngine.BindTexture("gui.background.png");
            float f = 32F;            /*
                                       * tessellator.StartDrawingQuads();
                                       * tessellator.SetColorOpaque_I(0x404040);
                                       * tessellator.AddVertexWithUV(0.0F, j, 0.0F, 0.0F, (float)j / f);
                                       * tessellator.AddVertexWithUV(i, j, 0.0F, (float)i / f, (float)j / f);
                                       * tessellator.AddVertexWithUV(i, 0.0F, 0.0F, (float)i / f, 0.0F);
                                       * tessellator.AddVertexWithUV(0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
                                       * tessellator.Draw();
                                       */

            //Mc.RenderEngine.RenderSprite(new Rectangle(0, 0, i, j), new Rectangle(0, 0, i, j));

            if (par1 >= 0)
            {
                sbyte byte0 = 100;
                sbyte byte1 = 2;
                int   i1    = i / 2 - byte0 / 2;
                int   j1    = j / 2 + 16;           /*
                                                     * //GL.Disable(EnableCap.Texture2D);
                                                     * tessellator.StartDrawingQuads();
                                                     * tessellator.SetColorOpaque_I(0x808080);
                                                     * tessellator.AddVertex(i1, j1, 0.0F);
                                                     * tessellator.AddVertex(i1, j1 + byte1, 0.0F);
                                                     * tessellator.AddVertex(i1 + byte0, j1 + byte1, 0.0F);
                                                     * tessellator.AddVertex(i1 + byte0, j1, 0.0F);
                                                     * tessellator.SetColorOpaque_I(0x80ff80);
                                                     * tessellator.AddVertex(i1, j1, 0.0F);
                                                     * tessellator.AddVertex(i1, j1 + byte1, 0.0F);
                                                     * tessellator.AddVertex(i1 + par1, j1 + byte1, 0.0F);
                                                     * tessellator.AddVertex(i1 + par1, j1, 0.0F);
                                                     * tessellator.Draw();*/
                //GL.Enable(EnableCap.Texture2D);
            }

            /*
             *          Mc.FontRenderer.DrawStringWithShadow(CurrentlyDisplayedText, (i - Mc.FontRenderer.GetStringWidth(CurrentlyDisplayedText)) / 2, j / 2 - 4 - 16, 0xffffff);
             *          Mc.FontRenderer.DrawStringWithShadow(Field_1004_a, (i - Mc.FontRenderer.GetStringWidth(Field_1004_a)) / 2, (j / 2 - 4) + 8, 0xffffff);*/
            //Display.update();

            try
            {
                Thread.Yield();
            }
            catch (Exception exception)
            {
                Utilities.LogException(exception);
            }
        }
Example #5
0
        /// <summary>
        /// Render the ingame overlay with quick icon bar, ...
        /// </summary>
        public virtual void RenderGameOverlay(float par1, bool par2, int par3, int par4)
        {
            ScaledResolution scaledresolution = new ScaledResolution(mc.GameSettings, mc.DisplayWidth, mc.DisplayHeight);
            int          i            = scaledresolution.GetScaledWidth();
            int          j            = scaledresolution.GetScaledHeight();
            FontRenderer fontrenderer = mc.FontRenderer;

            mc.EntityRenderer.SetupOverlayRendering();
            //GL.Enable(EnableCap.Blend);

            if (Minecraft.IsFancyGraphicsEnabled())
            {
                RenderVignette(mc.ThePlayer.GetBrightness(par1), i, j);
            }
            else
            {
                //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            }

            ItemStack itemstack = mc.ThePlayer.Inventory.ArmorItemInSlot(3);

            if (mc.GameSettings.ThirdPersonView == 0 && itemstack != null && itemstack.ItemID == Block.Pumpkin.BlockID)
            {
                RenderPumpkinBlur(i, j);
            }

            if (!mc.ThePlayer.IsPotionActive(Potion.Confusion))
            {
                float f = mc.ThePlayer.PrevTimeInPortal + (mc.ThePlayer.TimeInPortal - mc.ThePlayer.PrevTimeInPortal) * par1;

                if (f > 0.0F)
                {
                    RenderPortalOverlay(f, i, j);
                }
            }

            if (!mc.PlayerController.Func_35643_e())
            {
                //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
                //GL.BindTexture(TextureTarget.Texture2D, mc.RenderEngineOld.GetTexture("/gui/gui.png"));
                InventoryPlayer inventoryplayer = mc.ThePlayer.Inventory;
                ZLevel = -90F;
                DrawTexturedModalRect(i / 2 - 91, j - 22, 0, 0, 182, 22);
                DrawTexturedModalRect((i / 2 - 91 - 1) + inventoryplayer.CurrentItem * 20, j - 22 - 1, 0, 22, 24, 22);
                //GL.BindTexture(TextureTarget.Texture2D, mc.RenderEngineOld.GetTexture("/gui/icons.png"));
                //GL.Enable(EnableCap.Blend);
                //GL.BlendFunc(BlendingFactorSrc.OneMinusDstColor, BlendingFactorDest.OneMinusSrcColor);
                DrawTexturedModalRect(i / 2 - 7, j / 2 - 7, 0, 0, 16, 16);
                //GL.Disable(EnableCap.Blend);
                bool flag = (mc.ThePlayer.HeartsLife / 3) % 2 == 1;

                if (mc.ThePlayer.HeartsLife < 10)
                {
                    flag = false;
                }

                int i1 = mc.ThePlayer.GetHealth();
                int i2 = mc.ThePlayer.PrevHealth;
                rand.SetSeed(updateCounter * 0x4c627);
                bool      flag2     = false;
                FoodStats foodstats = mc.ThePlayer.GetFoodStats();
                int       j4        = foodstats.GetFoodLevel();
                int       l4        = foodstats.GetPrevFoodLevel();
                RenderBossHealth();

                if (mc.PlayerController.ShouldDrawHUD())
                {
                    int j5 = i / 2 - 91;
                    int i6 = i / 2 + 91;
                    int l6 = mc.ThePlayer.XpBarCap();

                    if (l6 > 0)
                    {
                        int c  = 0xb6;
                        int j8 = (int)(mc.ThePlayer.Experience * (float)(c + 1));
                        int i9 = (j - 32) + 3;
                        DrawTexturedModalRect(j5, i9, 0, 64, c, 5);

                        if (j8 > 0)
                        {
                            DrawTexturedModalRect(j5, i9, 0, 69, j8, 5);
                        }
                    }

                    int k7  = j - 39;
                    int k8  = k7 - 10;
                    int j9  = mc.ThePlayer.GetTotalArmorValue();
                    int i10 = -1;

                    if (mc.ThePlayer.IsPotionActive(Potion.Regeneration))
                    {
                        i10 = updateCounter % 25;
                    }

                    for (int j10 = 0; j10 < 10; j10++)
                    {
                        if (j9 > 0)
                        {
                            int i11 = j5 + j10 * 8;

                            if (j10 * 2 + 1 < j9)
                            {
                                DrawTexturedModalRect(i11, k8, 34, 9, 9, 9);
                            }

                            if (j10 * 2 + 1 == j9)
                            {
                                DrawTexturedModalRect(i11, k8, 25, 9, 9, 9);
                            }

                            if (j10 * 2 + 1 > j9)
                            {
                                DrawTexturedModalRect(i11, k8, 16, 9, 9, 9);
                            }
                        }

                        int j11 = 16;

                        if (mc.ThePlayer.IsPotionActive(Potion.Poison))
                        {
                            j11 += 36;
                        }

                        int i12 = 0;

                        if (flag)
                        {
                            i12 = 1;
                        }

                        int l12 = j5 + j10 * 8;
                        int j13 = k7;

                        if (i1 <= 4)
                        {
                            j13 += rand.Next(2);
                        }

                        if (j10 == i10)
                        {
                            j13 -= 2;
                        }

                        byte byte3 = 0;

                        if (mc.TheWorld.GetWorldInfo().IsHardcoreModeEnabled())
                        {
                            byte3 = 5;
                        }

                        DrawTexturedModalRect(l12, j13, 16 + i12 * 9, 9 * byte3, 9, 9);

                        if (flag)
                        {
                            if (j10 * 2 + 1 < i2)
                            {
                                DrawTexturedModalRect(l12, j13, j11 + 54, 9 * byte3, 9, 9);
                            }

                            if (j10 * 2 + 1 == i2)
                            {
                                DrawTexturedModalRect(l12, j13, j11 + 63, 9 * byte3, 9, 9);
                            }
                        }

                        if (j10 * 2 + 1 < i1)
                        {
                            DrawTexturedModalRect(l12, j13, j11 + 36, 9 * byte3, 9, 9);
                        }

                        if (j10 * 2 + 1 == i1)
                        {
                            DrawTexturedModalRect(l12, j13, j11 + 45, 9 * byte3, 9, 9);
                        }
                    }

                    for (int k10 = 0; k10 < 10; k10++)
                    {
                        int  k11   = k7;
                        int  j12   = 16;
                        byte byte2 = 0;

                        if (mc.ThePlayer.IsPotionActive(Potion.Hunger))
                        {
                            j12  += 36;
                            byte2 = 13;
                        }

                        if (mc.ThePlayer.GetFoodStats().GetSaturationLevel() <= 0.0F && updateCounter % (j4 * 3 + 1) == 0)
                        {
                            k11 += rand.Next(3) - 1;
                        }

                        if (flag2)
                        {
                            byte2 = 1;
                        }

                        int k13 = i6 - k10 * 8 - 9;
                        DrawTexturedModalRect(k13, k11, 16 + byte2 * 9, 27, 9, 9);

                        if (flag2)
                        {
                            if (k10 * 2 + 1 < l4)
                            {
                                DrawTexturedModalRect(k13, k11, j12 + 54, 27, 9, 9);
                            }

                            if (k10 * 2 + 1 == l4)
                            {
                                DrawTexturedModalRect(k13, k11, j12 + 63, 27, 9, 9);
                            }
                        }

                        if (k10 * 2 + 1 < j4)
                        {
                            DrawTexturedModalRect(k13, k11, j12 + 36, 27, 9, 9);
                        }

                        if (k10 * 2 + 1 == j4)
                        {
                            DrawTexturedModalRect(k13, k11, j12 + 45, 27, 9, 9);
                        }
                    }

                    if (mc.ThePlayer.IsInsideOfMaterial(Material.Water))
                    {
                        int l10 = mc.ThePlayer.GetAir();
                        int l11 = (int)Math.Ceiling(((double)(l10 - 2) * 10D) / 300D);
                        int k12 = (int)Math.Ceiling(((double)l10 * 10D) / 300D) - l11;

                        for (int i13 = 0; i13 < l11 + k12; i13++)
                        {
                            if (i13 < l11)
                            {
                                DrawTexturedModalRect(i6 - i13 * 8 - 9, k8, 16, 18, 9, 9);
                            }
                            else
                            {
                                DrawTexturedModalRect(i6 - i13 * 8 - 9, k8, 25, 18, 9, 9);
                            }
                        }
                    }
                }

                //GL.Disable(EnableCap.Blend);
                //GL.Enable(EnableCap.RescaleNormal);
                RenderHelper.EnableGUIStandardItemLighting();

                for (int k5 = 0; k5 < 9; k5++)
                {
                    int j6 = (i / 2 - 90) + k5 * 20 + 2;
                    int i7 = j - 16 - 3;
                    RenderInventorySlot(k5, j6, i7, par1);
                }

                RenderHelper.DisableStandardItemLighting();
                //GL.Disable(EnableCap.RescaleNormal);
            }

            if (mc.ThePlayer.GetSleepTimer() > 0)
            {
                //GL.Disable(EnableCap.DepthTest);
                //GL.Disable(EnableCap.AlphaTest);
                int   k  = mc.ThePlayer.GetSleepTimer();
                float f1 = (float)k / 100F;

                if (f1 > 1.0F)
                {
                    f1 = 1.0F - (float)(k - 100) / 10F;
                }

                int j1 = (int)(220F * f1) << 24 | 0x101020;
                DrawRect(0, 0, i, j, j1);
                //GL.Enable(EnableCap.AlphaTest);
                //GL.Enable(EnableCap.DepthTest);
            }

            if (mc.PlayerController.Func_35642_f() && mc.ThePlayer.ExperienceLevel > 0)
            {
                bool   flag1 = false;
                int    k1    = flag1 ? 0xffffff : 0x80ff20;
                String s     = (new StringBuilder()).Append("").Append(mc.ThePlayer.ExperienceLevel).ToString();
                int    i3    = (i - fontrenderer.GetStringWidth(s)) / 2;
                int    k3    = j - 31 - 4;
                fontrenderer.DrawString(s, i3 + 1, k3, 0);
                fontrenderer.DrawString(s, i3 - 1, k3, 0);
                fontrenderer.DrawString(s, i3, k3 + 1, 0);
                fontrenderer.DrawString(s, i3, k3 - 1, 0);
                fontrenderer.DrawString(s, i3, k3, k1);
            }

            if (mc.GameSettings.ShowDebugInfo)
            {
                //GL.PushMatrix();

                if (Minecraft.HasPaidCheckTime > 0L)
                {
                    //GL.Translate(0.0F, 32F, 0.0F);
                }

                fontrenderer.DrawStringWithShadow((new StringBuilder()).Append("Minecraft 1.2.5 (").Append(mc.Debug).Append(")").ToString(), 2, 2, 0xffffff);
                fontrenderer.DrawStringWithShadow(mc.DebugInfoRenders(), 2, 12, 0xffffff);
                fontrenderer.DrawStringWithShadow(mc.GetEntityDebug(), 2, 22, 0xffffff);
                fontrenderer.DrawStringWithShadow(mc.DebugInfoEntities(), 2, 32, 0xffffff);
                fontrenderer.DrawStringWithShadow(mc.GetWorldProviderName(), 2, 42, 0xffffff);
                //long l = Runtime.getRuntime().maxMemory();
                long l2 = GC.GetTotalMemory(false);
                //long l3 = Runtime.getRuntime().freeMemory();
                //long l5 = l2 - l3;
                //string s1 = (new StringBuilder()).Append("Used memory: ").Append((l5 * 100L) / l).Append("% (").Append(l5 / 1024L / 1024L).Append("MB) of ").Append(l / 1024L / 1024L).Append("MB").ToString();
                //DrawString(fontrenderer, s1, i - fontrenderer.GetStringWidth(s1) - 2, 2, 0xe0e0e0);
                //s1 = (new StringBuilder()).Append("Allocated memory: ").Append((l2 * 100L) / l).Append("% (").Append(l2 / 1024L / 1024L).Append("MB)").ToString();
                //DrawString(fontrenderer, s1, i - fontrenderer.GetStringWidth(s1) - 2, 12, 0xe0e0e0);
                DrawString(fontrenderer, (new StringBuilder()).Append("x: ").Append(mc.ThePlayer.PosX).ToString(), 2, 64, 0xe0e0e0);
                DrawString(fontrenderer, (new StringBuilder()).Append("y: ").Append(mc.ThePlayer.PosY).ToString(), 2, 72, 0xe0e0e0);
                DrawString(fontrenderer, (new StringBuilder()).Append("z: ").Append(mc.ThePlayer.PosZ).ToString(), 2, 80, 0xe0e0e0);
                DrawString(fontrenderer, (new StringBuilder()).Append("f: ").Append((int)Math.Floor((double)((mc.ThePlayer.RotationYaw * 4F) / 360F) + 0.5D) & 3).ToString(), 2, 88, 0xe0e0e0);
                int l7 = (int)Math.Floor(mc.ThePlayer.PosX);
                int l8 = (int)Math.Floor(mc.ThePlayer.PosY);
                int k9 = (int)Math.Floor(mc.ThePlayer.PosZ);

                if (mc.TheWorld != null && mc.TheWorld.BlockExists(l7, l8, k9))
                {
                    Chunk chunk = mc.TheWorld.GetChunkFromBlockCoords(l7, k9);
                    DrawString(fontrenderer, (new StringBuilder()).Append("lc: ").Append(chunk.GetTopFilledSegment() + 15).Append(" b: ").Append(chunk.Func_48490_a(l7 & 0xf, k9 & 0xf, mc.TheWorld.GetWorldChunkManager()).BiomeName).Append(" bl: ").Append(chunk.GetSavedLightValue(SkyBlock.Block, l7 & 0xf, l8, k9 & 0xf)).Append(" sl: ").Append(chunk.GetSavedLightValue(SkyBlock.Sky, l7 & 0xf, l8, k9 & 0xf)).Append(" rl: ").Append(chunk.GetBlockLightValue(l7 & 0xf, l8, k9 & 0xf, 0)).ToString(), 2, 96, 0xe0e0e0);
                }

                if (!mc.TheWorld.IsRemote)
                {
                    DrawString(fontrenderer, (new StringBuilder()).Append("Seed: ").Append(mc.TheWorld.GetSeed()).ToString(), 2, 112, 0xe0e0e0);
                }

                //GL.PopMatrix();
            }

            if (recordPlayingUpFor > 0)
            {
                float f2 = (float)recordPlayingUpFor - par1;
                int   l1 = (int)((f2 * 256F) / 20F);

                if (l1 > 255)
                {
                    l1 = 255;
                }

                if (l1 > 0)
                {
                    //GL.PushMatrix();
                    //GL.Translate(i / 2, j - 48, 0.0F);
                    //GL.Enable(EnableCap.Blend);
                    //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
                    int j2 = 0xffffff;

                    /*
                     * if (recordIsPlaying)
                     * {
                     *  j2 = Color.HSBtoRGB(f2 / 50F, 0.7F, 0.6F) & 0xffffff;
                     * }
                     */
                    fontrenderer.DrawString(recordPlaying, -(int)fontrenderer.GetStringWidth(recordPlaying) / 2, -4, j2 + (l1 << 24));
                    //GL.Disable(EnableCap.Blend);
                    //GL.PopMatrix();
                }
            }

            //GL.Enable(EnableCap.Blend);
            //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            //GL.Disable(EnableCap.AlphaTest);
            //GL.PushMatrix();
            //GL.Translate(0.0F, j - 48, 0.0F);
            Func_50010_a(fontrenderer);
            //GL.PopMatrix();

            if ((mc.ThePlayer is EntityClientPlayerMP) && mc.GameSettings.KeyBindPlayerList.Pressed)
            {
                NetClientHandler     netclienthandler = ((EntityClientPlayerMP)mc.ThePlayer).SendQueue;
                List <GuiPlayerInfo> list             = netclienthandler.PlayerNames;
                int k2 = netclienthandler.CurrentServerMaxPlayers;
                int j3 = k2;
                int i4 = 1;

                for (; j3 > 20; j3 = ((k2 + i4) - 1) / i4)
                {
                    i4++;
                }

                int k4 = 300 / i4;

                if (k4 > 150)
                {
                    k4 = 150;
                }

                int  i5    = (i - i4 * k4) / 2;
                byte byte0 = 10;
                DrawRect(i5 - 1, byte0 - 1, i5 + k4 * i4, byte0 + 9 * j3, 0x8000000);

                for (int k6 = 0; k6 < k2; k6++)
                {
                    int j7 = i5 + (k6 % i4) * k4;
                    int i8 = byte0 + (k6 / i4) * 9;
                    DrawRect(j7, i8, (j7 + k4) - 1, i8 + 8, 0x20ffffff);
                    //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
                    //GL.Enable(EnableCap.AlphaTest);

                    if (k6 >= list.Count)
                    {
                        continue;
                    }

                    GuiPlayerInfo guiplayerinfo = (GuiPlayerInfo)list[k6];
                    fontrenderer.DrawStringWithShadow(guiplayerinfo.Name, j7, i8, 0xffffff);
                    mc.RenderEngineOld.BindTexture(mc.RenderEngineOld.GetTexture("/gui/icons.png"));
                    int  l9    = 0;
                    byte byte1 = 0;

                    if (guiplayerinfo.ResponseTime < 0)
                    {
                        byte1 = 5;
                    }
                    else if (guiplayerinfo.ResponseTime < 150)
                    {
                        byte1 = 0;
                    }
                    else if (guiplayerinfo.ResponseTime < 300)
                    {
                        byte1 = 1;
                    }
                    else if (guiplayerinfo.ResponseTime < 600)
                    {
                        byte1 = 2;
                    }
                    else if (guiplayerinfo.ResponseTime < 1000)
                    {
                        byte1 = 3;
                    }
                    else
                    {
                        byte1 = 4;
                    }

                    ZLevel += 100F;
                    DrawTexturedModalRect((j7 + k4) - 12, i8, 0 + l9 * 10, 176 + byte1 * 8, 10, 8);
                    ZLevel -= 100F;
                }
            }

            //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F);
            //GL.Disable(EnableCap.Lighting);
            //GL.Enable(EnableCap.AlphaTest);
        }