public static void Draw()
    {
        if (!MenuOptions.show)
        {
            return;
        }
        float num = Time.time - MenuOptions.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(MenuOptions.rBack.center.x - MenuOptions.rBack.center.x * num, MenuOptions.rBack.center.y - MenuOptions.rBack.center.y * num, 1f);

        GUI.matrix = Matrix4x4.TRS(pos, Quaternion.identity, s);
        GUIM.DrawBox(MenuOptions.rBack, MenuOptions.tBlack);
        GUIM.DrawBox(MenuOptions.rBackSave, MenuOptions.tBlack);
        MenuOptions.DrawButtonOption(0, new Rect(MenuOptions.rBack.x + GUIM.YRES(4f), MenuOptions.rBack.y + GUIM.YRES(4f), GUIM.YRES(120f), GUIM.YRES(24f)), Lang.Get("_VIDEO"));
        MenuOptions.DrawButtonOption(1, new Rect(MenuOptions.rBack.x + GUIM.YRES(4f) + GUIM.YRES(124f) * 1f, MenuOptions.rBack.y + GUIM.YRES(4f), GUIM.YRES(120f), GUIM.YRES(24f)), Lang.Get("_AUDIO"));
        MenuOptions.DrawButtonOption(2, new Rect(MenuOptions.rBack.x + GUIM.YRES(4f) + GUIM.YRES(124f) * 2f, MenuOptions.rBack.y + GUIM.YRES(4f), GUIM.YRES(120f), GUIM.YRES(24f)), Lang.Get("_GAME"));
        MenuOptions.DrawButtonOption(3, new Rect(MenuOptions.rBack.x + GUIM.YRES(4f) + GUIM.YRES(124f) * 3f, MenuOptions.rBack.y + GUIM.YRES(4f), GUIM.YRES(120f), GUIM.YRES(24f)), Lang.Get("_CONTROL"));
        if (MenuOptions.currCat == 0)
        {
            MenuOptions.DrawVideo();
        }
        else if (MenuOptions.currCat == 1)
        {
            MenuOptions.DrawAudio();
        }
        else if (MenuOptions.currCat == 2)
        {
            MenuOptions.DrawGame();
        }
        else if (MenuOptions.currCat == 3)
        {
            MenuOptions.DrawControl();
        }
        if (GUIM.Button(MenuOptions.rButtonSave, BaseColor.Blue, Lang.Get("_SAVE"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true))
        {
            Options.Save();
            Options.Apply();
            Options.ApplyResolution();
            MenuOptions.saved = true;
            if (MenuOptions.ingame)
            {
                Options.ApplyInGame();
            }
            Main.lastwidth = 0f;
            HUD.lastwidth  = 0f;
        }
        if (MenuOptions.saved)
        {
            GUIM.DrawBox(MenuOptions.rBackSaved, MenuOptions.tBlack);
            GUIM.DrawText(MenuOptions.rBackSaved, Lang.Get("_OPTIONS_SAVED"), TextAnchor.MiddleCenter, BaseColor.Gray, 1, 12, false);
        }
        GUI.matrix = matrix;
    }
 private static void DrawControl()
 {
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 0f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), "W", ref vp_FPInput.control[0]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 1f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), "A", ref vp_FPInput.control[1]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 2f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), "S", ref vp_FPInput.control[2]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 3f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), "D", ref vp_FPInput.control[3]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 4f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_SPRINT"), ref vp_FPInput.control[4]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 5f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_CREEP"), ref vp_FPInput.control[20]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 6f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_JUMP"), ref vp_FPInput.control[5]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 7f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_CROUCH"), ref vp_FPInput.control[6]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 8f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_RELOAD"), ref vp_FPInput.control[7]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 9f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_LAST_WEAPON"), ref vp_FPInput.control[8]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 10f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_DROP_WEAPON"), ref vp_FPInput.control[11]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 11f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_FAST_KNIFE"), ref vp_FPInput.control[9]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 12f, MenuOptions.rBack.width / 2f - GUIM.YRES(80f), GUIM.YRES(24f)), Lang.Get("_THROW_GRENADE"), ref vp_FPInput.control[10]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(360f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 0f, MenuOptions.rBack.width / 2f - GUIM.YRES(76f), GUIM.YRES(24f)), Lang.Get("_CHOOSE_TEAM"), ref vp_FPInput.control[16]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(360f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 1f, MenuOptions.rBack.width / 2f - GUIM.YRES(76f), GUIM.YRES(24f)), Lang.Get("_SCOREBOARD"), ref vp_FPInput.control[17]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(360f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 2f, MenuOptions.rBack.width / 2f - GUIM.YRES(76f), GUIM.YRES(24f)), Lang.Get("_TEAM_CHAT"), ref vp_FPInput.control[18]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(360f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 3f, MenuOptions.rBack.width / 2f - GUIM.YRES(76f), GUIM.YRES(24f)), Lang.Get("_BUY_MENU"), ref vp_FPInput.control[19]);
     MenuOptions.DrawParamKey(new Rect(MenuOptions.rBack.x + GUIM.YRES(360f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 4f, MenuOptions.rBack.width / 2f - GUIM.YRES(76f), GUIM.YRES(24f)), Lang.Get("_AMMUNITION_BUY"), ref vp_FPInput.control[21]);
     if (GUIM.Button(new Rect(MenuOptions.rBack.x + GUIM.YRES(32f), MenuOptions.rBack.y + GUIM.YRES(48f) + GUIM.YRES(28f) * 15f, GUIM.YRES(120f), GUIM.YRES(24f)), BaseColor.Gray, Lang.Get("_RESET"), TextAnchor.MiddleCenter, BaseColor.White, 0, 14, false))
     {
         PlayerPrefs.DeleteKey("control");
         Options.LoadControl();
     }
 }
Exemple #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;
     }
 }
    private static void DrawButtonMode(int mode, Rect r, string name)
    {
        bool flag;

        if (MenuServers.currMode == mode)
        {
            flag = GUIM.Button(r, BaseColor.White, name, TextAnchor.MiddleCenter, BaseColor.Orange, 1, 12, false);
        }
        else
        {
            flag = GUIM.Button(r, BaseColor.Gray, name, TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false);
        }
        if (flag)
        {
            MenuServers.currMode = mode;
        }
    }
    private static void DrawButtonOption(int cat, Rect r, string name)
    {
        bool flag;

        if (MenuOptions.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)
        {
            MenuOptions.currCat = cat;
            MenuOptions.WaitKey = false;
        }
    }
    private static void DrawButtonChannel(int channel, Rect r, string name)
    {
        bool flag;

        if (MenuServers.currChannel == channel)
        {
            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)
        {
            MenuServers.currChannel = channel;
            MenuServers.currMode    = -1;
            MenuServers.Refresh(channel);
        }
    }
Exemple #7
0
 public static void Draw()
 {
     if (!MenuPlayer.show)
     {
         return;
     }
     GUI.color = new Color(1f, 1f, 1f, 0.8f);
     GUI.DrawTexture(new Rect((float)Screen.width / 2f + GUIM.YRES(180f), GUIM.YRES(96f), GUIM.YRES(16f), GUIM.YRES(16f)), MenuPlayer.tBlack);
     GUI.DrawTexture(new Rect((float)Screen.width / 2f + GUIM.YRES(180f) + GUIM.YRES(20f), GUIM.YRES(96f), GUIM.YRES(16f), GUIM.YRES(16f)), MenuPlayer.tBlack);
     GUI.color = Color.white;
     if (GUIM.Button(new Rect((float)Screen.width / 2f + GUIM.YRES(180f) + 2f, GUIM.YRES(96f) + 2f, GUIM.YRES(16f) - 4f, GUIM.YRES(16f) - 4f), BaseColor.Orange, string.Empty, TextAnchor.MiddleCenter, BaseColor.White, 0, 0, false))
     {
         MenuPlayer.ChangePlayer(0, 8, 22);
     }
     if (GUIM.Button(new Rect((float)Screen.width / 2f + GUIM.YRES(180f) + GUIM.YRES(20f) + 2f, GUIM.YRES(96f) + 2f, GUIM.YRES(16f) - 4f, GUIM.YRES(16f) - 4f), BaseColor.Blue, string.Empty, TextAnchor.MiddleCenter, BaseColor.White, 0, 0, false))
     {
         MenuPlayer.ChangePlayer(1, 8, 22);
     }
 }
Exemple #8
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;
            }
        }
    }
    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 (MenuInventory.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)
        {
            MenuInventory.currCat = cat;
        }
    }
    private static void DrawParamKey(Rect r, string text, ref KeyCode param)
    {
        GUIM.DrawText(r, text, TextAnchor.MiddleLeft, BaseColor.White, 1, 12, true);
        Rect r2   = new Rect(r.x + r.width - GUIM.YRES(80f), r.y, GUIM.YRES(80f), GUIM.YRES(24f));
        bool flag = GUIM.Button(r2, BaseColor.Gray, param.ToString(), TextAnchor.MiddleCenter, BaseColor.White, 1, 14, false);

        if (flag)
        {
            MenuOptions.WaitKey  = true;
            MenuOptions.rWaitKey = r;
        }
        if (MenuOptions.WaitKey && MenuOptions.rWaitKey == r)
        {
            GUIM.Button(r2, BaseColor.Red, "_", TextAnchor.MiddleCenter, BaseColor.White, 1, 14, false);
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                MenuOptions.WaitKey = false;
            }
            for (int i = 0; i < 32; i++)
            {
                if (vp_FPInput.control[i] == Event.current.keyCode)
                {
                    return;
                }
            }
            if (Event.current.isKey)
            {
                param = Event.current.keyCode;
                MenuOptions.WaitKey = false;
            }
            if (Event.current.shift)
            {
                param = KeyCode.LeftShift;
                MenuOptions.WaitKey = false;
            }
        }
    }
    private static bool DrawParamInt(Rect r, string text, ref int param, string[] options)
    {
        bool      result    = false;
        BaseColor fontcolor = BaseColor.White;

        if (options == null && param == 0)
        {
            fontcolor = BaseColor.Gray;
        }
        GUIM.DrawText(r, text, TextAnchor.MiddleLeft, fontcolor, 1, 12, true);
        if (options == null)
        {
            Rect r2 = new Rect(r.x + r.width - GUIM.YRES(68f), r.y, GUIM.YRES(32f), GUIM.YRES(24f));
            bool flag;
            if (param == 1)
            {
                flag = GUIM.Button(r2, BaseColor.White, MenuOptions.trigger[1], TextAnchor.MiddleCenter, BaseColor.Blue, 1, 10, false);
            }
            else
            {
                flag = GUIM.Button(r2, BaseColor.Gray, MenuOptions.trigger[1], TextAnchor.MiddleCenter, BaseColor.White, 1, 10, false);
            }
            if (flag)
            {
                param  = 1;
                result = true;
            }
            Rect r3 = new Rect(r.x + r.width - GUIM.YRES(32f), r.y, GUIM.YRES(32f), GUIM.YRES(24f));
            if (param == 0)
            {
                flag = GUIM.Button(r3, BaseColor.White, MenuOptions.trigger[0], TextAnchor.MiddleCenter, BaseColor.Blue, 1, 10, false);
            }
            else
            {
                flag = GUIM.Button(r3, BaseColor.Gray, MenuOptions.trigger[0], TextAnchor.MiddleCenter, BaseColor.White, 1, 10, false);
            }
            if (flag)
            {
                param  = 0;
                result = true;
            }
        }
        else if (options.Length >= 1)
        {
            Rect rect = new Rect(r.x + r.width - GUIM.YRES(32f) - GUIM.YRES(4f) - GUIM.YRES(200f), r.y, GUIM.YRES(200f), GUIM.YRES(24f));
            GUI.DrawTexture(rect, MenuOptions.tGray);
            GUIM.DrawText(rect, options[param], TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true);
            Rect rect2 = new Rect(rect.x - GUIM.YRES(4f) - GUIM.YRES(32f), r.y, GUIM.YRES(32f), GUIM.YRES(24f));
            GUI.DrawTexture(rect2, MenuOptions.tGray);
            bool flag = GUIM.Button(rect2, BaseColor.Gray, "-", TextAnchor.MiddleCenter, BaseColor.White, 1, 16, false);
            if (flag)
            {
                param--;
                result = true;
            }
            Rect r4 = new Rect(r.x + r.width - GUIM.YRES(32f), r.y, GUIM.YRES(32f), GUIM.YRES(24f));
            flag = GUIM.Button(r4, BaseColor.Gray, "+", TextAnchor.MiddleCenter, BaseColor.White, 1, 16, false);
            if (flag)
            {
                param++;
                result = true;
            }
            if (param < 0)
            {
                param  = 0;
                result = false;
            }
            if (param >= options.Length)
            {
                param  = options.Length - 1;
                result = false;
            }
        }
        return(result);
    }
    public static void Draw()
    {
        if (!MenuServers.show)
        {
            return;
        }
        float num = Time.time - MenuServers.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(MenuServers.rBack.center.x - MenuServers.rBack.center.x * num, MenuServers.rBack.center.y - MenuServers.rBack.center.y * num, 1f);

        GUI.matrix = Matrix4x4.TRS(pos, Quaternion.identity, s);
        GUIM.DrawBox(MenuServers.rBack, MenuServers.tBlack);
        Rect rect = new Rect(MenuServers.rBack.x + GUIM.YRES(4f), MenuServers.rBack.y + GUIM.YRES(4f), GUIM.YRES(40f), GUIM.YRES(24f));

        GUI.DrawTexture(rect, MenuServers.tGray);
        GUIM.DrawText(rect, "#", TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false);
        rect.x     = rect.x + GUIM.YRES(2f) + rect.width;
        rect.width = GUIM.YRES(120f);
        GUI.DrawTexture(rect, MenuServers.tGray);
        GUIM.DrawText(rect, Lang.Get("_MODE"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false);
        rect.x     = rect.x + GUIM.YRES(2f) + rect.width;
        rect.width = GUIM.YRES(104f);
        GUI.DrawTexture(rect, MenuServers.tGray);
        GUIM.DrawText(rect, Lang.Get("_MAP"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false);
        rect.x     = rect.x + GUIM.YRES(2f) + rect.width;
        rect.width = GUIM.YRES(60f);
        GUI.DrawTexture(rect, MenuServers.tGray);
        GUIM.DrawText(rect, Lang.Get("_RATE"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false);
        rect.x     = rect.x + GUIM.YRES(2f) + rect.width;
        rect.width = GUIM.YRES(80f);
        GUI.DrawTexture(rect, MenuServers.tGray);
        GUIM.DrawText(rect, Lang.Get("_PLAYERS"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false);
        int num2 = 0;

        for (int i = 0; i < MenuServers.server.Count; i++)
        {
            if (MenuServers.server[i].channel == MenuServers.currChannel)
            {
                num2++;
            }
        }
        MenuServers.scroll = GUIM.BeginScrollView(new Rect(MenuServers.rBack.x + GUIM.YRES(4f), MenuServers.rBack.y + GUIM.YRES(32f), MenuServers.rBack.width - GUIM.YRES(8f), MenuServers.rBack.height - GUIM.YRES(40f)), MenuServers.scroll, new Rect(0f, 0f, 0f, (float)num2 * GUIM.YRES(26f)));
        int num3 = 0;

        for (int j = 16; j >= 0; j--)
        {
            for (int k = 0; k < MenuServers.server.Count; k++)
            {
                if (MenuServers.currMode != 0 || MenuServers.server[k].gamemode == 0)
                {
                    if (MenuServers.currMode != 1 || MenuServers.server[k].gamemode == 1)
                    {
                        if (MenuServers.currMode != 2 || MenuServers.server[k].gamemode == 2)
                        {
                            if (MenuServers.currMode != 3 || MenuServers.server[k].gamemode == 3)
                            {
                                if (MenuServers.server[k].channel == MenuServers.currChannel)
                                {
                                    if (MenuServers.server[k].players == j)
                                    {
                                        if (MenuServers.DrawButtonServer(MenuServers.server[k], num3))
                                        {
                                            MenuServers.currServer = MenuServers.server[k];
                                        }
                                        num3++;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        GUIM.EndScrollView();
        MenuServers.rBackChannel = new Rect(MenuServers.rBack.x + MenuServers.rBack.width + GUIM.YRES(12f), MenuServers.rBack.y, GUIM.YRES(200f), GUIM.YRES(28f) * (float)(MenuServers.CServerData.maxchannel + 1) + GUIM.YRES(4f));
        GUIM.DrawBox(MenuServers.rBackChannel, MenuServers.tBlack);
        GUIM.DrawBox(MenuServers.rBackPlay, MenuServers.tBlack);
        for (int l = 0; l < MenuServers.CServerData.maxchannel + 1; l++)
        {
            MenuServers.DrawButtonChannel(l, new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + GUIM.YRES(4f) + (float)l * GUIM.YRES(28f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f)), Lang.Get("_CHANNEL") + " " + l.ToString("00"));
        }
        MenuServers.rBackMode      = new Rect(MenuServers.rBackChannel.x, MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f), MenuServers.rBackChannel.width, GUIM.YRES(28f) * 4f + GUIM.YRES(4f));
        MenuServers.rButtonMode[0] = new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f) + GUIM.YRES(4f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f));
        MenuServers.rButtonMode[1] = new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f) * 2f + GUIM.YRES(4f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f));
        MenuServers.rButtonMode[2] = new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f) * 3f + GUIM.YRES(4f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f));
        MenuServers.rButtonMode[3] = new Rect(MenuServers.rBackChannel.x + GUIM.YRES(4f), MenuServers.rBackChannel.y + MenuServers.rBackChannel.height + GUIM.YRES(28f) * 4f + GUIM.YRES(4f), MenuServers.rBackChannel.width - GUIM.YRES(8f), GUIM.YRES(24f));
        GUIM.DrawBox(MenuServers.rBackMode, MenuServers.tBlack);
        MenuServers.DrawButtonMode(0, MenuServers.rButtonMode[0], Lang.Get("_DEATHMATCH"));
        MenuServers.DrawButtonMode(1, MenuServers.rButtonMode[1], Lang.Get("_CONFRONTATION"));
        MenuServers.DrawButtonMode(2, MenuServers.rButtonMode[2], Lang.Get("_DETONATION"));
        MenuServers.DrawButtonMode(3, MenuServers.rButtonMode[3], Lang.Get("_ZOMBIEMATCH"));
        GUI.DrawTexture(MenuServers.rButtonRefresh, MenuServers.tGray);
        float  num4 = MenuServers.RefreshTime[MenuServers.currChannel] + 5f - Time.time;
        string str  = string.Empty;

        if (num4 >= 0f)
        {
            str = " " + num4.ToString("0.00");
        }
        if (GUIM.Button(MenuServers.rButtonRefresh, BaseColor.Gray, Lang.Get("_REFRESH") + str, TextAnchor.MiddleCenter, BaseColor.White, 1, 12, false))
        {
            MenuServers.Refresh(MenuServers.currChannel);
        }
        bool flag = false;

        if (MenuServers.currServer != null)
        {
            flag = GUIM.Button(MenuServers.rButtonPlay, BaseColor.Orange, Lang.Get("_CONNECT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true);
        }
        else
        {
            GUIM.Button(MenuServers.rButtonPlay, BaseColor.Black, Lang.Get("_CONNECT"), TextAnchor.MiddleCenter, BaseColor.White, 1, 12, true);
        }
        if (flag)
        {
            PlayerPrefs.SetInt("localplay", 0);
            PlayerPrefs.SetString("autostart", "connect " + MenuServers.currServer.ip + " " + MenuServers.currServer.port.ToString());
            Application.LoadLevel("game");
        }
        GUI.matrix = matrix;
    }
Exemple #13
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();
        }
    }
Exemple #14
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;
    }