Example #1
0
    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;
    }