示例#1
0
 public static void HideAll()
 {
     MenuPlayer.SetActive(false);
     MenuGold.SetActive(false);
     MenuServers.SetActive(false);
     MenuShop.SetActive(false);
     MenuOptions.SetActive(false);
     MenuInventory.SetActive(false);
     MenuPreview.SetActive(false);
 }
示例#2
0
    public static void Draw()
    {
        if (!MenuShop.show)
        {
            return;
        }
        float num = Time.time - MenuShop.showtime + 0.001f;

        if (num > 0.05f)
        {
            num = 0.05f;
        }
        num *= 20f;
        Matrix4x4 matrix = GUI.matrix;
        Vector3   s      = new Vector3(num, num, 1f);
        Vector3   pos    = new Vector3(MenuShop.rBack.center.x - MenuShop.rBack.center.x * num, MenuShop.rBack.center.y - MenuShop.rBack.center.y * num, 1f);

        GUI.matrix = Matrix4x4.TRS(pos, Quaternion.identity, s);
        GUIM.DrawBox(MenuShop.rBackHeader, MenuShop.tBlack);
        GUIM.DrawBox(MenuShop.rBackBody, MenuShop.tBlack);
        if (MenuShop.currData != null)
        {
            if (MenuShop.currData.section == 1)
            {
                GUI.DrawTexture(new Rect(MenuShop.rBackHeader.x + GUIM.YRES(8f), MenuShop.rBackHeader.y + GUIM.YRES(8f) + GUIM.YRES(40f), GUIM.YRES(256f), GUIM.YRES(64f)), MenuShop.currData.icon);
            }
            if (MenuShop.currData.section == 2)
            {
                GUI.DrawTexture(new Rect(MenuShop.rBackHeader.x + GUIM.YRES(84f), MenuShop.rBackHeader.y + GUIM.YRES(20f), GUIM.YRES(120f), GUIM.YRES(120f)), MenuShop.currData.icon);
            }
            if (MenuShop.currData.section == 3 || MenuShop.currData.section == 4)
            {
                GUI.DrawTexture(new Rect(MenuShop.rBackHeader.x + GUIM.YRES(64f), MenuShop.rBackHeader.y + GUIM.YRES(8f), GUIM.YRES(160f), GUIM.YRES(160f)), MenuShop.currData.icon);
            }
            if (MenuShop.currData.section == 5)
            {
                GUI.DrawTexture(new Rect(MenuShop.rBackHeader.x + GUIM.YRES(16f), MenuShop.rBackHeader.y - GUIM.YRES(48f), GUIM.YRES(256f), GUIM.YRES(256f)), MenuShop.currData.icon);
                if (GUIM.Button(MenuShop.rView, BaseColor.Blue, string.Empty, TextAnchor.MiddleCenter, BaseColor.White, 0, 0, false))
                {
                    Main.HideAll();
                    MenuPreview.SetActive(true);
                    MenuPreview.Preview(MenuShop.currData);
                }
                GUI.DrawTexture(MenuShop.rView, MenuShop.view);
            }
            if (BaseData.item[MenuShop.currData.wid] == 0)
            {
                BaseColor c = BaseColor.Green;
                if (MenuShop.inbuy)
                {
                    c = BaseColor.Gray;
                }
                if (BaseData.iLevel < MenuShop.currData.level)
                {
                    c = BaseColor.Red;
                }
                if (GUIM.Button(MenuShop.rBuy, c, Lang.Get("_BUY"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true) && BaseData.iLevel >= MenuShop.currData.level)
                {
                    if (GameData.gSteam)
                    {
                        WebHandler.get_buy("&itemid=" + MenuShop.currData.wid.ToString());
                    }
                    else if (GameData.gSocial)
                    {
                        WebHandler.set_buy("&itemid=" + MenuShop.currData.wid.ToString());
                    }
                    MenuShop.inbuy = true;
                }
            }
            else
            {
                GUI.DrawTexture(MenuShop.rBuy, MenuShop.tGray);
                GUIM.DrawText(MenuShop.rBuy, Lang.Get("_ALREADY_HAVE"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false);
            }
            GUIM.DrawText(new Rect(MenuShop.rBuy.x, MenuShop.rBuy.y - GUIM.YRES(24f), MenuShop.rBuy.width, MenuShop.rBuy.height), Lang.Get("_COST") + ":", TextAnchor.MiddleLeft, BaseColor.White, 1, 12, false);
            string text = string.Format("{0:C}", (float)MenuShop.currData.cost / 100f);
            if (GameData.gSteam)
            {
                GUIM.DrawText(new Rect(MenuShop.rBuy.x, MenuShop.rBuy.y - GUIM.YRES(24f), MenuShop.rBuy.width, MenuShop.rBuy.height), text, TextAnchor.MiddleRight, BaseColor.White, 1, 12, false);
            }
            else if (GameData.gSocial)
            {
                text = MenuShop.CentToGold(MenuShop.currData.cost).ToString();
                GUIM.DrawText(new Rect(MenuShop.rBuy.x, MenuShop.rBuy.y - GUIM.YRES(24f), MenuShop.rBuy.width - GUIM.YRES(14f), MenuShop.rBuy.height), text, TextAnchor.MiddleRight, BaseColor.White, 1, 12, false);
                GUI.DrawTexture(new Rect(MenuShop.rBuy.x + GUIM.YRES(108f), MenuShop.rBuy.y - GUIM.YRES(17f), GUIM.YRES(12f), GUIM.YRES(12f)), MenuShop.tGold);
            }
            GUIM.DrawText(new Rect(MenuShop.rBuy.x, MenuShop.rBackHeader.y + GUIM.YRES(8f), MenuShop.rBuy.width, MenuShop.rBuy.height), MenuShop.currData.name, TextAnchor.MiddleRight, BaseColor.White, 1, 12, false);
        }
        MenuShop.DrawButtonCategory(0, new Rect(MenuShop.rBackBody.x + GUIM.YRES(4f), MenuShop.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_BADGES"), false);
        MenuShop.DrawButtonCategory(1, new Rect(MenuShop.rBackBody.x + GUIM.YRES(4f) + GUIM.YRES(84f), MenuShop.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_MASKS"), false);
        MenuShop.DrawButtonCategory(2, new Rect(MenuShop.rBackBody.x + GUIM.YRES(4f) + GUIM.YRES(84f) * 2f, MenuShop.rBackBody.y + GUIM.YRES(4f), GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_WEAPONS"), false);
        MenuShop.scroll = GUIM.BeginScrollView(new Rect(MenuShop.rBackBody.x + GUIM.YRES(4f), MenuShop.rBackBody.y + GUIM.YRES(32f), MenuShop.rBackBody.width - GUIM.YRES(8f), MenuShop.rBackBody.height - GUIM.YRES(40f)), MenuShop.scroll, new Rect(0f, 0f, 0f, (float)MenuShop.hcount * GUIM.YRES(100f) - GUIM.YRES(4f)));
        int num2 = 0;
        int num3 = 0;

        for (int i = 0; i < 1024; i++)
        {
            if (MenuShop.shopdata[i] != null)
            {
                if (MenuShop.currCat != 0 || MenuShop.shopdata[i].section == 1 || MenuShop.shopdata[i].section == 2)
                {
                    if (MenuShop.currCat != 1 || MenuShop.shopdata[i].section == 3 || MenuShop.shopdata[i].section == 4)
                    {
                        if (MenuShop.currCat != 2 || MenuShop.shopdata[i].section == 5)
                        {
                            MenuShop.DrawItem(new Rect((GUIM.YRES(96f) + GUIM.YRES(4f)) * (float)num2, (GUIM.YRES(96f) + GUIM.YRES(4f)) * (float)num3, GUIM.YRES(96f), GUIM.YRES(96f)), MenuShop.shopdata[i]);
                            num2++;
                            if (num2 >= 4)
                            {
                                num2 = 0;
                                num3++;
                            }
                        }
                    }
                }
            }
        }
        MenuShop.hcount = num3;
        if (num2 != 0)
        {
            MenuShop.hcount++;
        }
        GUIM.EndScrollView();
        GUI.matrix = matrix;
    }