Пример #1
0
    private static void DrawMoney()
    {
        if (!Award.showmoney)
        {
            return;
        }
        if (Time.time > Award.moneytime)
        {
            Award.showmoney = false;
            HUD.SetMoneyInc(Award.money);
            return;
        }
        float num      = 2f - (Award.moneytime - Time.time);
        float num2     = 0f;
        int   fontsize = 16;

        if (num < 0.1f)
        {
            fontsize = 21 - (int)(num / 0.02f);
        }
        else if (num > 1.9f)
        {
            num2 = GUI2.YRES((num - 1.9f) * 8f * 10f);
        }
        GUI2.DrawTextColorRes(new Rect(Award.rMoney.x, Award.rMoney.y + num2, Award.rMoney.width, Award.rMoney.height), Award.sMoney, TextAnchor.MiddleCenter, _Color.Green, 0, fontsize, true);
    }
Пример #2
0
    private static void DrawChat()
    {
        if (Message.chat.Count == 0)
        {
            return;
        }
        if (Time.time > Message.lastcheck)
        {
            Message.lastcheck = Time.time + 0.5f;
            for (int i = 0; i < Message.chat.Count; i++)
            {
                if (Time.time > Message.chat[i].time + 5f)
                {
                    Message.chat.RemoveAt(0);
                }
            }
        }
        float x   = GUI2.YRES(8f);
        float num = (float)Screen.height - GUI2.YRES(90f);

        for (int j = Message.chat.Count - 1; j >= 0; j--)
        {
            Rect r = new Rect(x, num, GUI2.YRES(460f), GUI2.YRES(20f));
            num -= GUI2.YRES(14f);
            if (Message.chat[j].flag == 0)
            {
                GUI2.DrawTextColorRes(r, string.Concat(new string[]
                {
                    "<color=",
                    Message.sColor[Message.chat[j].ateam],
                    ">",
                    Message.chat[j].aname,
                    "</color> : ",
                    Message.chat[j].msg
                }), TextAnchor.MiddleLeft, _Color.White, 0, 12, true);
            }
            else if (Message.chat[j].flag == 1)
            {
                GUI2.DrawTextColorRes(r, string.Concat(new string[]
                {
                    "<color=",
                    Message.sColor[Message.chat[j].ateam],
                    ">",
                    Message.chat[j].aname,
                    "</color> (команде) : ",
                    Message.chat[j].msg
                }), TextAnchor.MiddleLeft, _Color.White, 0, 12, true);
            }
            else if (Message.chat[j].flag == 2)
            {
                GUI2.DrawTextColorRes(r, "<color=" + Message.sColor[3] + ">SERVER</color> : " + Message.chat[j].msg, TextAnchor.MiddleLeft, _Color.White, 0, 12, true);
            }
        }
    }
Пример #3
0
 private static void DrawDeath()
 {
     if (Message.death.Count == 0)
     {
         Message.lastdeath = Time.time + 3f;
         return;
     }
     if (Time.time > Message.lastdeath)
     {
         Message.lastdeath = Time.time + 5f;
         Message.death.RemoveAt(0);
     }
     for (int i = Message.death.Count - 1; i >= 0; i--)
     {
         if (Message.death[i].status == 1)
         {
             GUI.color = Message.ab;
         }
         else if (Message.death[i].status == 2)
         {
             GUI.color = Message.ar;
         }
         if (Message.death[i].status == 1 || Message.death[i].status == 2)
         {
             GUI.DrawTexture(Message.death[i].rBack, Message.tGradient);
         }
         GUI2.DrawTextColorRes(Message.death[i].r, Message.death[i].text1, TextAnchor.MiddleLeft, _Color.White, 0, 12, true);
         GUI.color = Color.black;
         GUI.DrawTexture(Message.death[i].rIconBlack, WeaponData.GetData(Message.death[i].wid).icon2);
         GUI.color = Color.white;
         GUI.DrawTexture(Message.death[i].rIcon, WeaponData.GetData(Message.death[i].wid).icon2);
         if (Message.death[i].wid != 0)
         {
             if (Message.death[i].hitzone == 1)
             {
                 GUI.color = Color.black;
                 GUI.DrawTexture(Message.death[i].rHSBlack, Message.tHeadshot);
                 GUI.color = Color.white;
                 GUI.DrawTexture(Message.death[i].rHS, Message.tHeadshot);
             }
             GUI2.DrawTextColorRes(Message.death[i].r2, Message.death[i].text2, TextAnchor.MiddleLeft, _Color.White, 0, 12, true);
         }
     }
 }
Пример #4
0
    private static void DrawPoints()
    {
        if (!Award.showpoints)
        {
            return;
        }
        if (Time.time > Award.pointstime)
        {
            Award.showpoints = false;
            return;
        }
        float num      = 2f - (Award.pointstime - Time.time);
        int   fontsize = 12;

        if (num < 0.1f)
        {
            fontsize = 112 - (int)(num / 0.001f);
        }
        GUI2.DrawTextColorRes(Award.rPoints, Award.sPoints, TextAnchor.MiddleCenter, _Color.Yellow, 0, fontsize, true);
    }
Пример #5
0
    private static void DrawCustomPoints()
    {
        if (!Award.showcustompoints)
        {
            return;
        }
        if (Time.time > Award.custompointstime)
        {
            Award.showcustompoints = false;
            return;
        }
        float num      = 1.5f - (Award.custompointstime - Time.time);
        int   fontsize = 12;

        if (num < 0.075f)
        {
            fontsize = 87 - (int)(num / 0.001f);
        }
        GUI2.DrawTextColorRes(Award.rCustomPoints, Award.sCustomPoints, TextAnchor.MiddleCenter, _Color.Green, 0, fontsize, true);
    }
Пример #6
0
 private void DrawFPS()
 {
     GUI2.DrawTextColorRes(new Rect((float)Screen.width - GUI2.YRES(50f), 0f, GUI2.YRES(50f), GUI2.YRES(14f)), this.fps_text, TextAnchor.MiddleLeft, this.fps_color, 0, 12, true);
 }
Пример #7
0
 private void OnGUI()
 {
     if (HUD.forcehide)
     {
         return;
     }
     this.DrawRespawnBar();
     if (!HUD.show)
     {
         return;
     }
     if (SpecCam.show)
     {
         Rect rect = new Rect(0f, (float)Screen.height - GUI2.YRES(32f), (float)Screen.width, GUI2.YRES(32f));
         GUI.color = this.cb;
         GUI.DrawTexture(rect, this.tBlack);
         GUI.color = Color.white;
         if (SpecCam.FID >= 0 && SpecCam.mode == 1 && PlayerControll.Player[SpecCam.FID] != null)
         {
             if (PlayerControll.Player[SpecCam.FID].Team == 0)
             {
                 GUI2.DrawTextColorRes(rect, PlayerControll.Player[SpecCam.FID].Name, TextAnchor.MiddleCenter, _Color.Red, 1, 12, true);
             }
             else if (PlayerControll.Player[SpecCam.FID].Team == 1)
             {
                 GUI2.DrawTextColorRes(rect, PlayerControll.Player[SpecCam.FID].Name, TextAnchor.MiddleCenter, _Color.Blue, 1, 12, true);
             }
             if (SpecCam.FID == C4.diffuserId)
             {
                 this.DrawDiffuseBar();
             }
         }
         else
         {
             GUI2.DrawTextColorRes(rect, Lang.Get("_FREECAM"), TextAnchor.MiddleCenter, _Color.White, 1, 12, true);
         }
         this.DrawTVBars();
         return;
     }
     GUI.DrawTexture(this.rHealthBack, this.tGradientLeft);
     GUI.DrawTexture(this.rAmmoBack, this.tGradientRight);
     if (HUD.bombState != 0)
     {
         GUI.DrawTexture(this.rBombBack, this.tGradientRight);
     }
     GUI.DrawTexture(this.rHealthIcon, this.tHealthIcon);
     GUI2.DrawTextRes(this.rHealthNumber, HUD.sHealth, TextAnchor.MiddleLeft, _Color.White, 0, 28, true);
     GUI.DrawTexture(this.rArmorIcon, this.tArmorIcon);
     GUI2.DrawTextRes(this.rArmorNumber, HUD.sArmor, TextAnchor.MiddleLeft, _Color.White, 0, 28, true);
     GUI.DrawTexture(this.rGrenBack, this.tGradientRight);
     if (BasePlayer.fg > 0)
     {
         if (BasePlayer.selectedGrenade == 0)
         {
             GUI.DrawTexture(this.rFGIcon, this.tFGIconWhite);
         }
         else
         {
             GUI.DrawTexture(this.rFGIcon, this.tFGIconOrange);
         }
     }
     else
     {
         GUI.DrawTexture(this.rFGIcon, this.tFGIconGray);
     }
     if (BasePlayer.fb > 0)
     {
         if (BasePlayer.selectedGrenade == 1)
         {
             GUI.DrawTexture(this.rFBIcon, this.tFBIconWhite);
         }
         else
         {
             GUI.DrawTexture(this.rFBIcon, this.tFBIconOrange);
         }
     }
     else
     {
         GUI.DrawTexture(this.rFBIcon, this.tFBIconGray);
     }
     if (BasePlayer.sg > 0)
     {
         if (BasePlayer.selectedGrenade == 2)
         {
             GUI.DrawTexture(this.rSGIcon, this.tSGIconWhite);
         }
         else
         {
             GUI.DrawTexture(this.rSGIcon, this.tSGIconOrange);
         }
     }
     else
     {
         GUI.DrawTexture(this.rSGIcon, this.tSGIconGray);
     }
     if (HUD.bombState == 1)
     {
         GUI.DrawTexture(this.rBombIcon, this.tBombIconNormal);
         HUD.tBombIndic = 0f;
     }
     if (HUD.bombState == 2)
     {
         if (HUD.tBombIndic < HUD.tBombInterv)
         {
             GUI.DrawTexture(this.rBombIcon, this.tBombIconActive);
         }
         if (HUD.tBombIndic >= HUD.tBombInterv)
         {
             GUI.DrawTexture(this.rBombIcon, this.tBombIconNormal);
         }
         HUD.tBombIndic += Time.deltaTime;
         if (HUD.tBombIndic > HUD.tBombInterv * 2f)
         {
             HUD.tBombIndic = 0f;
         }
     }
     if (HUD.diffuseState == 1)
     {
         GUI.DrawTexture(this.rDefuseKitBack, this.tGradientRight);
         GUI.DrawTexture(this.rDiffuseIcon, this.tDiffuseIconNormal);
     }
     this.DrawDiffuseBar();
     GUI.DrawTexture(this.rMoneyBack, this.tGradientLeft);
     GUI.DrawTexture(this.rMoneyIcon, this.tMoneyIcon);
     GUI2.DrawTextRes(this.rMoneyNumber, HUD.sMoney, TextAnchor.MiddleLeft, _Color.White, 0, 16, true);
     GUI.DrawTexture(this.rAmmoIcon, this.tAmmoIcon);
     if (BasePlayer.currweapon != null && WeaponData.GetData(BasePlayer.currweapon.data.wid).maxBackpack > 0)
     {
         GUI2.DrawTextRes(this.rAmmoNumber, BasePlayer.currweapon.sClip, TextAnchor.MiddleRight, _Color.White, 0, 28, true);
         GUI2.DrawTextRes(this.rAmmoNumber2, BasePlayer.sAmmo[BasePlayer.currweapon.data.ammoType], TextAnchor.MiddleCenter, _Color.White, 0, 16, true);
     }
 }