Beispiel #1
0
 public static void SetActive(bool val)
 {
     MenuShop.show = val;
     if (MenuShop.show)
     {
         MenuPlayer.ChangePlayer(1, 8, 22);
         MenuPlayer.SetPosition(0.9f, 0.03f, -1f);
         MenuShop.currData = null;
         MenuShop.showtime = Time.time;
         MenuShop.GenerateCustomIcons();
     }
 }
Beispiel #2
0
 public void LoadEnd()
 {
     MenuShop.currData = null;
     MenuShop.tBlack   = TEX.GetTextureByName("black");
     MenuShop.tOrange  = TEX.GetTextureByName("orange");
     MenuShop.tGray    = TEX.GetTextureByName("gray");
     MenuShop.tWhite   = TEX.GetTextureByName("white");
     MenuShop.tGreen   = TEX.GetTextureByName("green");
     MenuShop.apply    = TEX.GetTextureByName("apply");
     MenuShop.view     = TEX.GetTextureByName("search");
     MenuShop.tGold    = TEX.GetTextureByName("gold_64");
     MenuShop.Init();
 }
Beispiel #3
0
 public static void Draw()
 {
     if (!MenuPreview.show)
     {
         return;
     }
     GUIM.DrawBox(MenuPreview.rBackSave, MenuPreview.tBlack);
     if (GUIM.Button(MenuPreview.rButtonSave, BaseColor.Blue, Lang.Get("_BACK"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true))
     {
         MenuShop.CShopData cShopData = MenuPreview.currData;
         Main.HideAll();
         MenuShop.SetActive(true);
         MenuShop.currData = cShopData;
     }
 }
Beispiel #4
0
 public static void SetActive(bool val)
 {
     MenuPreview.show     = val;
     MenuPreview.currData = null;
     if (!MenuPreview.show && MenuPreview.go != null)
     {
         MenuPreview.go.name = string.Concat(new object[]
         {
             "item_",
             Time.time,
             " ",
             UnityEngine.Random.Range(0, 1000)
         });
         UnityEngine.Object.Destroy(MenuPreview.go);
     }
 }
Beispiel #5
0
    public static void SetMaskTexture(int index, MenuShop.CShopData data)
    {
        GameObject gameObject;

        if (index == 0)
        {
            gameObject = GameObject.Find(MenuPlayer.goPlayer.name + "/player_merc");
        }
        else
        {
            gameObject = GameObject.Find(MenuPlayer.goPlayer.name + "/player_warcorp");
        }
        Texture2D textureByName = TEX.GetTextureByName("_" + data.iconname);

        gameObject.GetComponent <SkinnedMeshRenderer>().materials[0].SetTexture(0, textureByName);
    }
Beispiel #6
0
 public static void PreviewMask(MenuShop.CShopData data)
 {
     if (data == null)
     {
         return;
     }
     if (data.section == 3)
     {
         MenuPlayer.ChangePlayer(0, 8, 22);
         MenuPlayer.SetMaskTexture(0, data);
     }
     else if (data.section == 4)
     {
         MenuPlayer.ChangePlayer(1, 8, 22);
         MenuPlayer.SetMaskTexture(1, data);
     }
 }
Beispiel #7
0
    public static void Preview(MenuShop.CShopData item)
    {
        if (MenuPreview.go != null)
        {
            MenuPreview.go.name = string.Concat(new object[]
            {
                "item_",
                Time.time,
                " ",
                UnityEngine.Random.Range(0, 1000)
            });
            UnityEngine.Object.Destroy(MenuPreview.go);
        }
        MenuPreview.currData = item;
        if (MenuPreview.currData == null)
        {
            return;
        }
        string[] array = MenuPreview.currData.iconname.Split(new char[]
        {
            '_'
        });
        if (array.Length != 3)
        {
            return;
        }
        MenuPreview.go = ItemPreview.Create("w_" + array[0]);
        if (MenuPreview.go == null)
        {
            MonoBehaviour.print("error create preview w_" + array[0]);
            return;
        }
        ItemPreview.SetSkin(MenuPreview.go, MenuPreview.currData.iconname);
        Transform[] componentsInChildren = MenuPreview.go.GetComponentsInChildren <Transform>();
        Transform[] array2 = componentsInChildren;
        for (int i = 0; i < array2.Length; i++)
        {
            Transform transform = array2[i];
            transform.gameObject.layer = 0;
        }
        RotateModel rotateModel = MenuPreview.go.AddComponent <RotateModel>();

        rotateModel.fullrotate = true;
    }
Beispiel #8
0
    private static void DrawButtonCategory(int cat, Rect r, string name, bool block = false)
    {
        bool flag;

        if (block)
        {
            flag = GUIM.Button(r, BaseColor.Orange, name, TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false);
            return;
        }
        if (MenuShop.currCat == cat)
        {
            flag = GUIM.Button(r, BaseColor.White, name, TextAnchor.MiddleCenter, BaseColor.Blue, 1, 12, false);
        }
        else
        {
            flag = GUIM.Button(r, BaseColor.Gray, name, TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false);
        }
        if (flag)
        {
            MenuShop.currCat  = cat;
            MenuShop.currData = null;
        }
    }
Beispiel #9
0
    public static bool DrawItem(Rect r, MenuShop.CShopData data)
    {
        int num = (int)GUIM.YRES(1f);

        if (num < 1)
        {
            num = 1;
        }
        bool    flag = false;
        Vector2 mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);

        if (data == MenuShop.currData)
        {
            GUI.DrawTexture(r, MenuShop.tWhite);
        }
        else if (GUIM.Contains(r, mpos))
        {
            GUI.DrawTexture(r, MenuShop.tGray);
            GUI.color = new Color(1f, 1f, 1f, 0.1f);
            GUI.DrawTexture(r, MenuShop.tWhite);
            GUI.color = Color.white;
            flag      = true;
        }
        else
        {
            if (BaseData.item[data.wid] == 1)
            {
                GUI.color = new Color(1f, 1f, 1f, 0.05f);
                GUI.DrawTexture(r, MenuShop.tWhite);
                GUI.color = Color.white;
            }
            GUI.DrawTexture(new Rect(r.x, r.y, r.width, (float)num), MenuShop.tGray);
            GUI.DrawTexture(new Rect(r.x, r.y + r.height - (float)num, r.width, (float)num), MenuShop.tGray);
            GUI.DrawTexture(new Rect(r.x, r.y, (float)num, r.height), MenuShop.tGray);
            GUI.DrawTexture(new Rect(r.x + r.width - (float)num, r.y, (float)num, r.height), MenuShop.tGray);
        }
        if (data.level > 0)
        {
            BaseColor fontcolor = BaseColor.White;
            if (BaseData.iLevel < data.level)
            {
                fontcolor = BaseColor.Red;
            }
            GUIM.DrawText(r, "Lv." + data.level.ToString() + " ", TextAnchor.LowerRight, fontcolor, 1, 12, false);
        }
        if (data.section == 1)
        {
            GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f) + GUIM.YRES(33f), GUIM.YRES(88f), GUIM.YRES(22f)), data.icon);
        }
        if (data.section == 2)
        {
            GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), GUIM.YRES(88f), GUIM.YRES(88f)), data.icon);
        }
        if (data.section == 3 || data.section == 4)
        {
            GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), GUIM.YRES(88f), GUIM.YRES(88f)), data.icon);
        }
        if (data.section == 5)
        {
            GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), GUIM.YRES(88f), GUIM.YRES(88f)), data.icon);
        }
        if (data.section == 0)
        {
            GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f) + GUIM.YRES(22f), GUIM.YRES(88f), GUIM.YRES(44f)), data.icon);
        }
        if (MenuInventory.isActive())
        {
            bool flag2 = false;
            int  id    = WeaponData.GetId(data.name2);
            if (id > 0 && BaseData.profileWeapon[id] == data.wid)
            {
                flag2 = true;
            }
            if (BaseData.badge_back == data.wid || BaseData.badge_icon == data.wid || BaseData.mask_merc == data.wid || BaseData.mask_warcorp == data.wid || flag2)
            {
                GUI.color = Color.green;
                GUI.DrawTexture(new Rect(r.x + GUIM.YRES(4f), r.y + GUIM.YRES(4f), GUIM.YRES(10f), GUIM.YRES(10f)), MenuShop.apply);
                GUI.color = Color.white;
            }
            else if (flag && data.section > 0)
            {
                GUIM.DrawText(r, Lang.Get("_CLICK_TO_EQUIP"), TextAnchor.LowerCenter, BaseColor.White, 1, 10, false);
            }
        }
        bool result = false;

        if (GUIM.HideButton(r))
        {
            MenuShop.currData = data;
            if (MenuShop.show)
            {
                if (MenuShop.currData.section == 3 || MenuShop.currData.section == 4)
                {
                    MenuPlayer.PreviewMask(MenuShop.currData);
                    MenuPlayer.SetPosition(0.9f, 0.03f, -1f);
                }
                else if (MenuShop.currData.section == 5)
                {
                    MenuPlayer.playermodel = -1;
                    if (MenuShop.currData.name2 == "ak47")
                    {
                        MenuPlayer.ChangePlayer(0, 6, 22);
                    }
                    else if (MenuShop.currData.name2 == "aks74u")
                    {
                        MenuPlayer.ChangePlayer(0, 7, 22);
                    }
                    else if (MenuShop.currData.name2 == "asval")
                    {
                        MenuPlayer.ChangePlayer(0, 8, 22);
                    }
                    else if (MenuShop.currData.name2 == "aug")
                    {
                        MenuPlayer.ChangePlayer(0, 18, 22);
                    }
                    else if (MenuShop.currData.name2 == "awp")
                    {
                        MenuPlayer.ChangePlayer(0, 22, 8);
                    }
                    else if (MenuShop.currData.name2 == "beretta")
                    {
                        MenuPlayer.ChangePlayer(0, 2, 22);
                    }
                    else if (MenuShop.currData.name2 == "bm4")
                    {
                        MenuPlayer.ChangePlayer(0, 9, 22);
                    }
                    else if (MenuShop.currData.name2 == "colt")
                    {
                        MenuPlayer.ChangePlayer(0, 3, 8);
                    }
                    else if (MenuShop.currData.name2 == "deagle")
                    {
                        MenuPlayer.ChangePlayer(0, 4, 8);
                    }
                    else if (MenuShop.currData.name2 == "famas")
                    {
                        MenuPlayer.ChangePlayer(0, 10, 22);
                    }
                    else if (MenuShop.currData.name2 == "glock17")
                    {
                        MenuPlayer.ChangePlayer(0, 1, 8);
                    }
                    else if (MenuShop.currData.name2 == "m4a1")
                    {
                        MenuPlayer.ChangePlayer(0, 11, 22);
                    }
                    else if (MenuShop.currData.name2 == "m24")
                    {
                        MenuPlayer.ChangePlayer(0, 21, 22);
                    }
                    else if (MenuShop.currData.name2 == "m90")
                    {
                        MenuPlayer.ChangePlayer(0, 23, 22);
                    }
                    else if (MenuShop.currData.name2 == "m110")
                    {
                        MenuPlayer.ChangePlayer(0, 20, 22);
                    }
                    else if (MenuShop.currData.name2 == "m249")
                    {
                        MenuPlayer.ChangePlayer(0, 25, 22);
                    }
                    else if (MenuShop.currData.name2 == "mp5")
                    {
                        MenuPlayer.ChangePlayer(0, 12, 22);
                    }
                    else if (MenuShop.currData.name2 == "mp7")
                    {
                        MenuPlayer.ChangePlayer(0, 13, 22);
                    }
                    else if (MenuShop.currData.name2 == "p90")
                    {
                        MenuPlayer.ChangePlayer(0, 14, 22);
                    }
                    else if (MenuShop.currData.name2 == "pkp")
                    {
                        MenuPlayer.ChangePlayer(0, 24, 22);
                    }
                    else if (MenuShop.currData.name2 == "qbz95")
                    {
                        MenuPlayer.ChangePlayer(0, 15, 22);
                    }
                    else if (MenuShop.currData.name2 == "remington")
                    {
                        MenuPlayer.ChangePlayer(0, 5, 22);
                    }
                    else if (MenuShop.currData.name2 == "spas12")
                    {
                        MenuPlayer.ChangePlayer(0, 16, 8);
                    }
                    else if (MenuShop.currData.name2 == "svd")
                    {
                        MenuPlayer.ChangePlayer(0, 19, 22);
                    }
                    else if (MenuShop.currData.name2 == "ump45")
                    {
                        MenuPlayer.ChangePlayer(0, 17, 22);
                    }
                    MenuPlayer.SetPosition(0.9f, 0.03f, -1f);
                }
            }
            result = true;
        }
        return(result);
    }