示例#1
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();
        }
    }
示例#2
0
    private void OnGUI()
    {
        if (!EscapeMenu.show)
        {
            return;
        }
        Rect position = new Rect(0f, 0f, (float)Screen.width, (float)Screen.height);

        GUI.DrawTexture(position, this.tLoad);
        if (EscapeMenu.state == 0)
        {
            GUI.DrawTexture(new Rect(GUI2.YRES(60f), GUI2.YRES(128f), GUI2.YRES(256f), GUI2.YRES(32f)), this.tLogo);
            if (this.DrawButton(this.rButton[0], Lang.Get("_RESUME"), Lang.Get("_resume_to_game"), _Color.Gray))
            {
                EscapeMenu.Toggle();
            }
            if (this.DrawButton(this.rButton[1], Lang.Get("_VOTE"), Lang.Get("_vote_menu"), _Color.Gray))
            {
                EscapeMenu.Toggle();
                Vote.SetActive(true);
            }
            if (this.DrawButton(this.rButton[2], Lang.Get("_HELP"), Lang.Get("_tip_control"), _Color.Gray))
            {
                EscapeMenu.state = 1;
            }
            if (ScoreBoard.gamemode != 3)
            {
                if (this.DrawButton(this.rButton[3], Lang.Get("_CHOOSE_TEAM"), Lang.Get("_change_team_ingame"), _Color.Gray))
                {
                    EscapeMenu.Toggle();
                    ChooseTeam.Toggle();
                }
            }
            else
            {
                GUI2.DrawTextRes(this.rButton[3], Lang.Get("_CHOOSE_TEAM"), TextAnchor.MiddleRight, _Color.Gray, 1, 14, true);
            }
            if (this.DrawButton(this.rButton[4], Lang.Get("_FULLSCREEN"), Lang.Get("_open_game_in_fullscreen"), _Color.Gray))
            {
                EscapeMenu.Toggle();
                Options.ToggleFullScreen();
            }
            if (this.DrawButton(this.rButton[5], Lang.Get("_OPTIONS"), string.Empty, _Color.Gray))
            {
                EscapeMenu.state = 2;
                MenuOptions.ForceCenter();
                MenuOptions.SetActive(true);
            }
            if (this.DrawButton(this.rButton[6], Lang.Get("_EXIT_MENU"), Lang.Get("_progress_not_saved"), _Color.Yellow))
            {
                EscapeMenu.Toggle();
                global::Console.cs.Command("disconnect");
            }
        }
        else if (EscapeMenu.state == 1)
        {
            this.DrawHelp();
        }
        else if (EscapeMenu.state == 2)
        {
            MenuOptions.Draw();
        }
        if (this.DrawButton(new Rect(GUI2.YRES(60f), GUI2.YRES(400f), GUI2.YRES(64f), GUI2.YRES(32f)), Lang.Get("_BACK"), string.Empty, _Color.Gray))
        {
            EscapeMenu.Toggle();
        }
        GUI2.DrawTextRes(new Rect(GUI2.YRES(60f), GUI2.YRES(420f), GUI2.YRES(64f), GUI2.YRES(32f)), "ESC", TextAnchor.MiddleRight, _Color.Red, 2, 23, true);
    }