示例#1
0
 private static void DrawMenuButton(int state, Rect r, Texture2D normal, Texture2D hover)
 {
     Profile.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
     if (r.Contains(Profile.mpos))
     {
         GUI.DrawTexture(r, hover);
     }
     else
     {
         GUI.DrawTexture(r, normal);
     }
     if (GUIM.HideButton(r))
     {
         Main.HideAll();
         if (state == 0)
         {
             MenuPlayer.SetActive(true);
         }
         if (state == 1)
         {
             MenuInventory.SetActive(true);
         }
         if (state == 2)
         {
             MenuGold.SetActive(true);
         }
     }
 }
示例#2
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);
 }
示例#3
0
 public static void Draw()
 {
     if (!MenuGold.show)
     {
         return;
     }
     GUIM.DrawBox(MenuGold.rBack, MenuGold.tBlack);
     GUI.DrawTexture(MenuGold.rBackName, MenuGold.tOrange);
     GUIM.DrawText(MenuGold.rBackName, Lang.Get("_ADD_GOLD"), TextAnchor.MiddleCenter, BaseColor.White, 1, 16, false);
     if (GameData.gVK)
     {
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 0f, MenuGold.rBackName.width, GUIM.YRES(36f)), "1", "8", string.Empty))
         {
             Application.ExternalCall("order", new object[]
             {
                 "item0"
             });
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 1f, MenuGold.rBackName.width, GUIM.YRES(36f)), "5", "40", string.Empty))
         {
             Application.ExternalCall("order", new object[]
             {
                 "item1"
             });
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 2f, MenuGold.rBackName.width, GUIM.YRES(36f)), "10", "80", string.Empty))
         {
             Application.ExternalCall("order", new object[]
             {
                 "item2"
             });
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 3f, MenuGold.rBackName.width, GUIM.YRES(36f)), "50", "400", "+40"))
         {
             Application.ExternalCall("order", new object[]
             {
                 "item3"
             });
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 4f, MenuGold.rBackName.width, GUIM.YRES(36f)), "100", "800", "+100"))
         {
             Application.ExternalCall("order", new object[]
             {
                 "item4"
             });
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 5f, MenuGold.rBackName.width, GUIM.YRES(36f)), "200", "1600", "+240"))
         {
             Application.ExternalCall("order", new object[]
             {
                 "item5"
             });
         }
     }
     if (GameData.gFB)
     {
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 0f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$0.16", "8", string.Empty))
         {
             FBManager.BuyCoins(8);
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 1f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$0.80", "40", string.Empty))
         {
             FBManager.BuyCoins(40);
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 2f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$1.60", "80", string.Empty))
         {
             FBManager.BuyCoins(80);
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 3f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$8.00", "400", "+40"))
         {
             FBManager.BuyCoins(400);
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 4f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$16.00", "800", "+100"))
         {
             FBManager.BuyCoins(800);
         }
         if (MenuGold.DrawPrice(new Rect(MenuGold.rBackName.x, MenuGold.rBackName.y + GUIM.YRES(128f) + GUIM.YRES(44f) * 5f, MenuGold.rBackName.width, GUIM.YRES(36f)), "$32.00", "1600", "+240"))
         {
             FBManager.BuyCoins(1600);
         }
     }
 }
示例#4
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();
        }
    }