Example #1
0
    public static void ResizeDeath()
    {
        if (Message.death.Count == 0)
        {
            return;
        }
        float x   = GUI2.YRES(8f);
        float num = GUI2.YRES(4f) + GUI2.YRES(14f) * 4f;

        for (int i = Message.death.Count - 1; i >= 0; i--)
        {
            Message.death[i].r = new Rect(x, num, GUI2.YRES(300f), GUI2.YRES(20f));
            float width = GUI2.CalcSizeRes(Message.death[i].aname + Message.death[i].vname, 0, 12) + GUI2.YRES(70f);
            Message.death[i].rBack = new Rect(0f, Message.death[i].r.y + 6f, width, GUI2.YRES(12f));
            num -= GUI2.YRES(14f);
            Message.death[i].text1 = string.Concat(new string[]
            {
                "<color=",
                Message.sColor[Message.death[i].ateam],
                ">",
                Message.death[i].aname,
                "</color>"
            });
            Message.death[i].text2 = string.Concat(new string[]
            {
                "<color=",
                Message.sColor[Message.death[i].vteam],
                ">",
                Message.death[i].vname,
                "</color>"
            });
            float num2 = GUI2.CalcSizeRes(Message.death[i].text1, 0, 12);
            if ((Message.death[i].wid >= 0 && Message.death[i].wid <= 5) || Message.death[i].wid == 27)
            {
                Message.death[i].rIcon = new Rect(Message.death[i].r.x + num2, Message.death[i].r.y + GUI2.YRES(4f), GUI2.YRES(24f), GUI2.YRES(12f));
            }
            else
            {
                Message.death[i].rIcon = new Rect(Message.death[i].r.x + num2 + GUI2.YRES(2f), Message.death[i].r.y, GUI2.YRES(44f), GUI2.YRES(22f));
            }
            float num3 = GUI2.CalcSizeRes(Message.death[i].text2, 0, 12);
            Message.death[i].rIconBlack = new Rect(Message.death[i].rIcon.x + 1f, Message.death[i].rIcon.y + 1f, Message.death[i].rIcon.width, Message.death[i].rIcon.height);
            float num4 = 0f;
            if (Message.death[i].hitzone == 1)
            {
                Message.death[i].rHSBlack = new Rect(Message.death[i].rIcon.x + Message.death[i].rIcon.width + GUI2.YRES(4f) + 1f, Message.death[i].r.y + GUI2.YRES(2f) + 1f, GUI2.YRES(16f), GUI2.YRES(16f));
                Message.death[i].rHS      = new Rect(Message.death[i].rIcon.x + Message.death[i].rIcon.width + GUI2.YRES(4f), Message.death[i].r.y + GUI2.YRES(2f), GUI2.YRES(16f), GUI2.YRES(16f));
                num4 = GUI2.YRES(20f);
            }
            Message.death[i].r2 = new Rect(Message.death[i].rIcon.x + Message.death[i].rIcon.width + GUI2.YRES(4f) + num4, Message.death[i].r.y, Message.death[i].r.width, Message.death[i].r.height);
        }
    }
Example #2
0
    private void DrawPlayerName(Vector3 p, string name, bool drawname)
    {
        p.y += 2.5f;
        Vector3 vector = Camera.main.WorldToScreenPoint(p);

        vector.y = (float)Screen.height - vector.y;
        float num = GUI2.CalcSizeRes(name, 0, 8);

        if (drawname)
        {
            GUI.color = this.a;
            GUI2.DrawTextRes(new Rect(vector.x - num / 2f, vector.y, num, GUI2.YRES(8f)), name, TextAnchor.MiddleLeft, _Color.White, 0, 8, true);
            GUI.color = Color.white;
        }
        else if (this.tTeam != null)
        {
            GUI.DrawTexture(new Rect(vector.x - GUI2.YRES(4f), vector.y + GUI2.YRES(9f), GUI2.YRES(8f), GUI2.YRES(8f)), this.tTeam);
        }
    }