Exemplo n.º 1
0
    private void DrawBuy()
    {
        BuyMenu.menuLevel = 1;
        GUI.DrawTexture(this.rBuyBack, this.tGray0);
        GUI2.DrawTextRes(this.rBuyBack, this.sCategoryName[BuyMenu.catid], TextAnchor.MiddleCenter, _Color.White, 0, 14, true);
        GUI.DrawTexture(this.rArmorySlotsNull[0], this.tGray2);
        GUI.DrawTexture(this.rArmorySlotsNull[1], this.tGray2);
        bool flag = false;
        int  num  = 0;

        for (int i = 1; i < 128; i++)
        {
            if (WeaponData.CheckWeapon(i))
            {
                if (WeaponData.GetData(i).buyMenuSlot == BuyMenu.catid)
                {
                    if (WeaponData.GetData(i).wid == 49)
                    {
                        flag = true;
                    }
                    else
                    {
                        BuyMenu.buySlotWeapon[num] = i;
                        this.DrawItem(this.rArmorySlots[num], i, num);
                        num++;
                    }
                }
            }
        }
        if (flag && ScoreTop.GameMode == 2 && BasePlayer.team == 1)
        {
            BuyMenu.buySlotWeapon[num] = 49;
            this.DrawItem(this.rArmorySlots[num], 49, num);
            num++;
        }
        for (int j = num; j < 10; j++)
        {
            BuyMenu.buySlotWeapon[j] = 0;
            this.DrawItem(this.rArmorySlots[j], 0, 0);
        }
        GUI.DrawTexture(this.rBuyBack2, this.tGray0);
        BuyMenu.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
        GUI2.DrawTextRes(new Rect(this.rBuyBack2.x + GUI2.YRES(6f), this.rBuyBack2.y, this.rBuyBack2.width, this.rBuyBack2.height), "0", TextAnchor.MiddleLeft, _Color.Yellow, 0, 12, true);
        if (this.rBuyBack2.Contains(BuyMenu.mpos))
        {
            GUI2.DrawTextRes(new Rect(this.rBuyBack2.x + GUI2.YRES(12f), this.rBuyBack2.y, this.rBuyBack2.width, this.rBuyBack2.height), " - " + Lang.Get("_BACK"), TextAnchor.MiddleLeft, _Color.Red, 0, 10, true);
        }
        else
        {
            GUI2.DrawTextRes(new Rect(this.rBuyBack2.x + GUI2.YRES(12f), this.rBuyBack2.y, this.rBuyBack2.width, this.rBuyBack2.height), " - " + Lang.Get("_BACK"), TextAnchor.MiddleLeft, _Color.White, 0, 10, true);
        }
        if (GUI2.HideButton(this.rBuyBack2))
        {
            BuyMenu.catid = -1;
        }
    }
Exemplo n.º 2
0
 private bool DrawButton(Rect r, string text, string text2, _Color color2 = _Color.Gray)
 {
     this.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
     if (r.Contains(this.mpos))
     {
         GUI2.DrawTextRes(r, text, TextAnchor.MiddleRight, _Color.Red, 1, 14, true);
         GUI2.DrawTextRes(new Rect(r.x + r.width + GUI2.YRES(20f), r.y, GUI2.YRES(256f), r.height), text2, TextAnchor.MiddleLeft, color2, 1, 10, false);
     }
     else
     {
         GUI2.DrawTextRes(r, text, TextAnchor.MiddleRight, _Color.White, 1, 14, true);
     }
     return(GUI2.HideButton(r));
 }
Exemplo n.º 3
0
 public static void Draw()
 {
     if (!ChooseTeam.show)
     {
         return;
     }
     ChooseTeam.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
     if (ChooseTeam.rLineTeam0.Contains(ChooseTeam.mpos))
     {
         GUI.color = new Color(1f, 0.2f, 0f, 1f);
     }
     else
     {
         GUI.color = new Color(1f, 0.2f, 0f, 0.5f);
     }
     GUI.DrawTexture(ChooseTeam.rLineTeam0, ChooseTeam.tWhite);
     GUI.DrawTexture(ChooseTeam.rAnlgeTeam0, ChooseTeam.tAngle0);
     if (ChooseTeam.rLineTeam1.Contains(ChooseTeam.mpos))
     {
         GUI.color = new Color(0f, 0.5f, 1f, 1f);
     }
     else
     {
         Color color = new Color(0f, 0.5f, 1f, 0.5f);
         GUI.color = color;
         GUI.color = color;
     }
     GUI.DrawTexture(ChooseTeam.rLineTeam1, ChooseTeam.tWhite);
     GUI.DrawTexture(ChooseTeam.rAnlgeTeam1, ChooseTeam.tAngle1);
     GUI.color = new Color(1f, 1f, 1f, 0.5f);
     GUI.DrawTexture(ChooseTeam.rBox0, ChooseTeam.tBlack);
     GUI.DrawTexture(ChooseTeam.rBox1, ChooseTeam.tBlack);
     GUI.DrawTexture(ChooseTeam.rMsgTeam, ChooseTeam.tBlack);
     GUI.color = Color.white;
     GUI2.DrawTextRes(ChooseTeam.rTextTeam0, "MERCS", TextAnchor.MiddleLeft, _Color.White, 0, 24, true);
     GUI2.DrawTextRes(ChooseTeam.rBox0, "1", TextAnchor.MiddleCenter, _Color.White, 0, 24, true);
     GUI2.DrawTextRes(ChooseTeam.rTextTeam1, "WARCORPS", TextAnchor.MiddleLeft, _Color.White, 0, 24, true);
     GUI2.DrawTextRes(ChooseTeam.rBox1, "2", TextAnchor.MiddleCenter, _Color.White, 0, 24, true);
     GUI2.DrawTextRes(ChooseTeam.rMsgTeam, Lang.Get("_CHOOSE_TEAM"), TextAnchor.MiddleCenter, _Color.White, 0, 18, true);
     if (GUI2.HideButton(ChooseTeam.rLineTeam0))
     {
         ChooseTeam.Choose(0);
     }
     if (GUI2.HideButton(ChooseTeam.rLineTeam1))
     {
         ChooseTeam.Choose(1);
     }
 }
Exemplo n.º 4
0
 private void DrawMenuSlot(int id, Rect r, string text)
 {
     BuyMenu.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
     GUI2.DrawTextRes(new Rect(r.x + GUI2.YRES(8f), r.y + GUI2.YRES(3f), GUI2.YRES(20f), GUI2.YRES(20f)), id.ToString(), TextAnchor.MiddleCenter, _Color.Yellow, 1, 14, true);
     if (r.Contains(BuyMenu.mpos))
     {
         GUI2.DrawTextRes(new Rect(r.x + GUI2.YRES(36f), r.y, r.width, r.height), text, TextAnchor.MiddleLeft, _Color.Red, 1, 14, true);
     }
     else
     {
         GUI2.DrawTextRes(new Rect(r.x + GUI2.YRES(36f), r.y, r.width, r.height), text, TextAnchor.MiddleLeft, _Color.White, 1, 14, true);
     }
     if (GUI2.HideButton(r))
     {
         BuyMenu.catid = id;
     }
 }
Exemplo n.º 5
0
 private void DrawItem(Rect r, int wid = 0, int slot = 0)
 {
     BuyMenu.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
     if (r.Contains(BuyMenu.mpos))
     {
         GUI.color = this.teamcolor[BuyMenu.team];
     }
     else
     {
         GUI.color = new Color(0.35f, 0.35f, 0.35f, 0.75f);
     }
     if (wid == 0)
     {
         GUI.color = new Color(0.15f, 0.15f, 0.15f, 0.75f);
     }
     GUI.DrawTexture(r, this.tWhite);
     GUI.color = Color.white;
     if (wid > 0)
     {
         Rect rect = new Rect(r.x + GUI2.YRES(2f), r.y + GUI2.YRES(2f), GUI2.YRES(14f), GUI2.YRES(14f));
         GUI.DrawTexture(rect, this.tBlack);
         if (rect.Contains(BuyMenu.mpos))
         {
             GUI2.DrawTextRes(rect, ">>", TextAnchor.MiddleCenter, _Color.Yellow, 0, 12, false);
         }
         else if (BuyMenu.menuLevel == 0)
         {
             GUI2.DrawTextRes(rect, ">", TextAnchor.MiddleCenter, _Color.Yellow, 0, 12, false);
         }
         else if (BuyMenu.menuLevel == 1)
         {
             GUI2.DrawTextRes(rect, (slot + 1).ToString(), TextAnchor.MiddleCenter, _Color.Yellow, 0, 11, false);
         }
         GUI.color = new Color(1f, 1f, 1f, 0.25f);
         GUI.DrawTexture(new Rect(r.x + GUI2.YRES(17f), r.y + GUI2.YRES(2f), r.width - GUI2.YRES(19f), GUI2.YRES(14f)), this.tBlack);
         GUI.color = Color.white;
         GUI2.DrawTextRes(new Rect(r.x + GUI2.YRES(20f), r.y + GUI2.YRES(2f), r.width - GUI2.YRES(22f), GUI2.YRES(14f)), WeaponData.GetData(wid).wName, TextAnchor.MiddleLeft, _Color.White, 0, 12, true);
         int num = wid;
         if (WeaponData.CheckCustomSkin(wid) && BaseData.profileWeapon[wid] > 0)
         {
             num = BaseData.profileWeapon[wid];
         }
         Texture2D icon;
         if (num >= 128)
         {
             icon = MenuShop.shopdata[num].icon;
         }
         else
         {
             icon = WeaponData.GetData(wid).icon;
         }
         if (icon)
         {
             float num2   = r.x;
             float width  = r.width;
             float height = r.width / 2f;
             float num3   = r.y + GUI2.YRES(13f);
             if (num >= 128)
             {
                 height = r.width;
                 num3   = r.y + GUI2.YRES(6f) - r.height / 4f;
                 if (WeaponData.GetData(wid).buyMenuSlot == 1)
                 {
                     height = r.width * 0.75f;
                     width  = r.width * 0.75f;
                     num3  += r.width * 0.1f;
                     num2  += r.width * 0.125f;
                 }
             }
             if (WeaponData.GetData(wid).buyMenuSlot == 1 && num < 128)
             {
                 GUI.color = Color.black;
                 GUI.DrawTexture(new Rect(r.x + 1f + GUI2.YRES(15f), r.y + GUI2.YRES(20f) + 1f, r.height, r.height / 2f), WeaponData.GetData(wid).icon);
                 GUI.color = Color.white;
                 GUI.DrawTexture(new Rect(r.x + GUI2.YRES(15f), r.y + GUI2.YRES(20f), r.height, r.height / 2f), WeaponData.GetData(wid).icon);
             }
             else
             {
                 GUI.color = Color.black;
                 GUI.DrawTexture(new Rect(num2 + 1f, num3 + 1f, width, height), icon);
                 GUI.color = Color.white;
                 GUI.DrawTexture(new Rect(num2, num3, width, height), icon);
             }
         }
         GUI.DrawTexture(new Rect(r.x, r.y + GUI2.YRES(66f), r.width, GUI2.YRES(14f)), this.tGray2);
         GUI.DrawTexture(new Rect(r.x + r.width - GUI2.YRES(17f), r.y + GUI2.YRES(66f), GUI2.YRES(14f), GUI2.YRES(14f)), this.tMoney);
         GUI2.DrawTextRes(new Rect(r.x, r.y + GUI2.YRES(66f), r.width - GUI2.YRES(20f), GUI2.YRES(14f)), WeaponData.GetData(wid).sCost, TextAnchor.MiddleRight, _Color.White, 0, 12, false);
         if (GUI2.HideButton(r))
         {
             this.SendBuy(slot);
         }
     }
 }
Exemplo n.º 6
0
    private void OnGUI()
    {
        if (Vote.voteprocess)
        {
            if (Time.time > Vote.voteendtime)
            {
                Vote.voteprocess = false;
            }
            GUI2.DrawText(new Rect((float)Screen.width / 2f - GUI2.YRES(200f) / 2f, GUI2.YRES(40f), GUI2.YRES(200f), GUI2.YRES(40f)), Vote.votetext, TextAnchor.MiddleCenter, _Color.Green, 0, 20, true);
        }
        if (!Vote.show)
        {
            return;
        }
        GUI.DrawTexture(Vote.rBack, this.tBlack);
        float num  = (float)((int)GUI2.YRES(2f));
        float num2 = (float)((int)GUI2.YRES(20f));

        GUI2.DrawTextRes(new Rect(Vote.rBack.x, Vote.rBack.y - num2, Vote.rBack.width, num2), Lang.Get("_VOTE_KICK"), TextAnchor.MiddleCenter, _Color.White, 0, 12, true);
        for (int i = 0; i < 16; i++)
        {
            if (i == Client.ID)
            {
                GUI.DrawTexture(new Rect(Vote.rBack.x + num, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), this.tGray0);
                GUI2.DrawTextRes(new Rect(Vote.rBack.x + num, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), (i + 1).ToString(), TextAnchor.MiddleLeft, _Color.Black, 0, 12, false);
                GUI2.DrawTextRes(new Rect(Vote.rBack.x + num2, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), BaseData.Name, TextAnchor.MiddleLeft, _Color.White, 0, 12, false);
            }
            else if (PlayerControll.Player[i] == null)
            {
                GUI.DrawTexture(new Rect(Vote.rBack.x + num, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), this.tGray2);
                GUI2.DrawTextRes(new Rect(Vote.rBack.x + num, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), (i + 1).ToString(), TextAnchor.MiddleLeft, _Color.Black, 0, 12, false);
                GUI2.DrawTextRes(new Rect(Vote.rBack.x + num2, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), "-/-", TextAnchor.MiddleLeft, _Color.Black, 0, 12, false);
            }
            else
            {
                if (Vote.sid == i)
                {
                    GUI.DrawTexture(new Rect(Vote.rBack.x + num, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), this.tRed);
                }
                else
                {
                    GUI.DrawTexture(new Rect(Vote.rBack.x + num, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), this.tWhite);
                }
                GUI2.DrawTextRes(new Rect(Vote.rBack.x + num, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), (i + 1).ToString(), TextAnchor.MiddleLeft, _Color.Black, 0, 12, false);
                GUI2.DrawTextRes(new Rect(Vote.rBack.x + num2, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2), PlayerControll.Player[i].Name, TextAnchor.MiddleLeft, _Color.Black, 0, 12, false);
                if (GUI2.HideButton(new Rect(Vote.rBack.x + num2, Vote.rBack.y + num + (num2 + num) * (float)i, Vote.rBack.width - num * 2f, num2)))
                {
                    Vote.sid = i;
                }
            }
        }
        GUI.DrawTexture(new Rect(Vote.rBack.x + Vote.rBack.width + GUI2.YRES(8f), Vote.rBack.y + Vote.rBack.height - num2 - num * 2f, GUI2.YRES(100f), num2 + num * 2f), this.tBlack);
        Rect rect = new Rect(Vote.rBack.x + Vote.rBack.width + GUI2.YRES(8f) + num, Vote.rBack.y + Vote.rBack.height - num2 - num, GUI2.YRES(100f) - num * 2f, num2);

        GUI.DrawTexture(rect, this.tBlue);
        GUI2.DrawTextRes(rect, Lang.Get("_SELECT"), TextAnchor.MiddleCenter, _Color.White, 0, 12, false);
        if (GUI2.HideButton(rect))
        {
            Vote_Dialog.cs.SendVoteStart((byte)Vote.sid);
            Vote.SetActive(false);
        }
        GUI.DrawTexture(new Rect(Vote.rBack.x - GUI2.YRES(8f) - num * 2f - GUI2.YRES(100f), Vote.rBack.y + Vote.rBack.height - num2 - num * 2f, GUI2.YRES(100f), num2 + num * 2f), this.tBlack);
        Rect rect2 = new Rect(Vote.rBack.x - GUI2.YRES(8f) - num - GUI2.YRES(100f), Vote.rBack.y + Vote.rBack.height - num2 - num, GUI2.YRES(100f) - num * 2f, num2);

        GUI.DrawTexture(rect2, this.tGray0);
        GUI2.DrawTextRes(rect2, Lang.Get("_CANCEL"), TextAnchor.MiddleCenter, _Color.White, 0, 12, false);
        if (GUI2.HideButton(rect2))
        {
            Vote.SetActive(false);
        }
    }