Exemple #1
0
 public static void SetActive(bool val)
 {
     MenuPlayer.show = val;
     if (!MenuPlayer.show)
     {
         if (MenuPlayer.goPlayer)
         {
             MenuPlayer.goPlayer.name = string.Concat(new object[]
             {
                 "dead_",
                 Time.time,
                 " ",
                 UnityEngine.Random.Range(0, 1000)
             });
             UnityEngine.Object.Destroy(MenuPlayer.goPlayer);
         }
         MenuPlayer.playermodel = -1;
         MenuFriends.SetActive(false);
     }
     else
     {
         MenuPlayer.ChangePlayer(1, 8, 22);
         MenuFriends.SetActive(true);
     }
 }
Exemple #2
0
 public void PostAwake()
 {
     Main.tBlack         = TEX.GetTextureByName("black");
     Main.tLoadingBackgr = (Resources.Load("GUI/loading_backgr") as Texture2D);
     Main.tLoadingCooler = (Resources.Load("GUI/loading_cooler") as Texture2D);
     Main.tLoadingProgr0 = (Resources.Load("GUI/loading_progr0") as Texture2D);
     Main.tLoadingProgr1 = (Resources.Load("GUI/loading_progr1") as Texture2D);
     Main.tLoadingProgr2 = (Resources.Load("GUI/loading_progr2") as Texture2D);
     Main.tLoadingProgr3 = (Resources.Load("GUI/loading_progr3") as Texture2D);
     Main.tLoadingProgr4 = (Resources.Load("GUI/loading_progr4") as Texture2D);
     Main.tLoadingProgr5 = (Resources.Load("GUI/loading_progr5") as Texture2D);
     Main.tLoadingProgr6 = (Resources.Load("GUI/loading_progr6") as Texture2D);
     Main.tLoadingProgr7 = (Resources.Load("GUI/loading_progr7") as Texture2D);
     this.OnResize();
     Options.Load();
     Options.Apply();
     Options.ApplyResolutionOnce();
     if (GameData.gSteam)
     {
         Steam.Init();
     }
     if (GameData.gSteam)
     {
         this.LoadAvatar();
     }
     Main.HideAll();
     if (GameData.gSteam)
     {
         Main.MainAuthSteam();
     }
     if (GameData.gSteam)
     {
         WebHandler.get_servers();
     }
     if (GameData.gSteam && Steam.active && Steam.logged)
     {
         Main.MainInventory();
     }
     if (GameData.gSteam)
     {
         MenuFriends.Load();
     }
     if (PlayerPrefs.HasKey("reconnect"))
     {
         PlayerPrefs.DeleteKey("reconnect");
         Application.LoadLevel("game");
     }
 }
Exemple #3
0
    public static void Draw()
    {
        if (!MenuFriends.show)
        {
            return;
        }
        GUIM.DrawText(new Rect((float)Screen.width / 2f + GUIM.YRES(240f), GUIM.YRES(110f) - GUIM.YRES(18f), GUIM.YRES(200f), GUIM.YRES(18f)), Lang.Get("_FRIENDS"), TextAnchor.MiddleLeft, BaseColor.White, 1, 12, false);
        int num  = (int)GUIM.YRES(36f);
        int num2 = (int)GUIM.YRES(4f);
        int num3 = 0;
        int num4 = MenuFriends.currpage * 14;
        int num5 = (MenuFriends.currpage + 1) * 14;

        if (num5 > MenuFriends.friendlistorder.Count)
        {
            num5 = MenuFriends.friendlistorder.Count;
        }
        for (int i = num4; i < num5; i++)
        {
            MenuFriends.DrawFriend(new Rect((float)Screen.width / 2f + GUIM.YRES(240f), GUIM.YRES(110f) + (float)((num + num2) * num3), GUIM.YRES(200f), (float)num), MenuFriends.friendlistorder[i]);
            num3++;
        }
        if (GUIM.Button(new Rect((float)Screen.width / 2f + GUIM.YRES(396f), GUIM.YRES(110f) - GUIM.YRES(18f), GUIM.YRES(20f), GUIM.YRES(16f)), BaseColor.Black, "<", TextAnchor.MiddleCenter, BaseColor.Gray, 1, 16, false))
        {
            MenuFriends.currpage--;
            if (MenuFriends.currpage < 0)
            {
                MenuFriends.currpage = 0;
            }
        }
        if (GUIM.Button(new Rect((float)Screen.width / 2f + GUIM.YRES(396f) + GUIM.YRES(24f), GUIM.YRES(110f) - GUIM.YRES(18f), GUIM.YRES(20f), GUIM.YRES(16f)), BaseColor.Black, ">", TextAnchor.MiddleCenter, BaseColor.Gray, 1, 16, false))
        {
            MenuFriends.currpage++;
            if (MenuFriends.currpage > MenuFriends.friendlistorder.Count / 14)
            {
                MenuFriends.currpage = MenuFriends.friendlistorder.Count / 14;
            }
        }
    }
Exemple #4
0
    private static void DrawFriend(Rect r, MenuFriends.FriendData f)
    {
        if (f == null)
        {
            return;
        }
        int num = (int)GUIM.YRES(2f);

        GUIM.DrawBox(r, MenuFriends.tBlack);
        if (f.avatar != null)
        {
            GUI.DrawTexture(new Rect(r.x + (float)num, r.y + (float)num, GUIM.YRES(32f), GUIM.YRES(32f)), f.avatar);
        }
        GUIM.DrawText(new Rect(r.x + GUIM.YRES(40f), r.y + (float)num, GUIM.YRES(140f), GUIM.YRES(20f)), f.name, TextAnchor.MiddleLeft, BaseColor.White, 1, 14, false);
        if (f.ingame)
        {
            GUIM.DrawText(new Rect(r.x + GUIM.YRES(40f), r.y + GUIM.YRES(16f), GUIM.YRES(140f), GUIM.YRES(20f)), "WARMODE", TextAnchor.MiddleLeft, BaseColor.Yellow, 0, 12, false);
        }
        else
        {
            string state = MenuFriends.GetState(f.state);
            GUIM.DrawText(new Rect(r.x + GUIM.YRES(40f), r.y + GUIM.YRES(16f), GUIM.YRES(140f), GUIM.YRES(20f)), state, TextAnchor.MiddleLeft, BaseColor.Gray, 0, 12, false);
        }
    }
Exemple #5
0
    private void OnGUI()
    {
        Rect r = new Rect((float)Screen.width / 2f - GUIM.YRES(160f), (float)Screen.height / 2f - GUIM.YRES(30f), GUIM.YRES(400f), GUIM.YRES(80f));

        if (GameData.gSteam)
        {
            if (!Steam.active)
            {
                GUIM.DrawBox(r, Main.tBlack);
                GUIM.DrawText(r, Lang.Get("_STEAM_NOT_LAUNCHED"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true);
                return;
            }
            if (!Steam.logged)
            {
                GUIM.DrawBox(r, Main.tBlack);
                GUIM.DrawText(r, Lang.Get("_STEAM_NOT_LOGGEDON"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true);
                return;
            }
        }
        if (!ContentLoader_.proceed)
        {
            UIManager.SetLoadingActive(true);
            return;
        }
        UIManager.SetLoadingActive(false);
        if (BaseData.banCost != string.Empty)
        {
            GUIM.DrawBox(r, Main.tBlack);
            Rect   r2  = new Rect(r.x, r.y, r.width, r.height - GUIM.YRES(36f));
            string str = "$" + BaseData.banCost;
            if (GameData.gVK)
            {
                str = BaseData.banCost + " г.";
            }
            if (GameData.gFB)
            {
                int num = Convert.ToInt32(BaseData.banCost);
                str = string.Format("{0:C}", (float)num * 0.12f);
            }
            GUIM.DrawText(r2, Lang.Get("_YOU_BANNED!_UNBAN_COST") + " - " + str, TextAnchor.MiddleCenter, BaseColor.White, 1, 16, true);
            Rect r3 = new Rect(r.x + GUIM.YRES(84f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f));
            if (GameData.gSocial)
            {
                r3 = new Rect(r.x + GUIM.YRES(150f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f));
            }
            if (Main.inbuySteam || Main.inbuySocial)
            {
                GUIM.Button(r3, BaseColor.Gray, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true);
            }
            else
            {
                if (GameData.gSteam && GUIM.Button(r3, BaseColor.Green, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true))
                {
                    WebHandler.get_buy("&itemid=10000");
                    Main.inbuySteam = true;
                }
                if (GameData.gVK && GUIM.Button(r3, BaseColor.Green, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true))
                {
                    Main.inbuySocial = true;
                    Application.ExternalCall("order", new object[]
                    {
                        "item10000"
                    });
                }
                if (GameData.gFB && GUIM.Button(r3, BaseColor.Green, Lang.Get("_UNBAN"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true))
                {
                    Main.inbuySocial = true;
                    FBManager.BuyUnbun(Convert.ToInt32(BaseData.banCost));
                }
            }
            if (GameData.gSteam)
            {
                Rect r4 = new Rect(r.x + GUIM.YRES(216f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f));
                if (GUIM.Button(r4, BaseColor.Red, Lang.Get("_EXIT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true))
                {
                    Application.Quit();
                }
            }
            return;
        }
        if (!Client.actualVersion)
        {
            GUIM.DrawBox(r, Main.tBlack);
            Rect r5 = new Rect(r.x, r.y, r.width, r.height - GUIM.YRES(36f));
            if (GameData.gSteam)
            {
                GUIM.DrawText(r5, Lang.Get("_UPDATE_VERSION"), TextAnchor.MiddleCenter, BaseColor.White, 1, 16, true);
                Rect r6 = new Rect(r.x + GUIM.YRES(150f), r.y + GUIM.YRES(44f), GUIM.YRES(100f), GUIM.YRES(22f));
                if (GUIM.Button(r6, BaseColor.Red, Lang.Get("_EXIT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true))
                {
                    Application.Quit();
                }
            }
            if (GameData.gSocial)
            {
                GUIM.DrawText(r, Lang.Get("_UPDATE_VERSION"), TextAnchor.MiddleCenter, BaseColor.White, 1, 16, true);
            }
            return;
        }
        if (!BaseData.Auth)
        {
            GUIM.DrawBox(r, Main.tBlack);
            GUIM.DrawText(r, Lang.Get("_AUTHORIZATION"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true);
            return;
        }
        if (Main.tVig)
        {
            GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), Main.tVig);
        }
        TopBar.Draw();
        BottomBar.Draw();
        Profile.Draw();
        MenuPlayer.Draw();
        MenuGold.Draw();
        MenuServers.Draw();
        MenuShop.Draw();
        MenuOptions.Draw();
        MenuInventory.Draw();
        MenuPreview.Draw();
        if (GameData.gSteam)
        {
            MenuFriends.Draw();
        }
    }