예제 #1
0
        private void CreateBasicTab(TabControl tcontainer)
        {
            var container = tcontainer.AddPage("Basic").Page;

            tcontainer.Dock = Gwen.Pos.Fill;
            //modes
            GroupBox gb      = new GroupBox(container);
            var      modesgb = gb;

            gb.Text   = "Modes";
            gb.Width  = 180;
            gb.Height = 160;
            var marg = tcontainer.Margin;

            marg.Bottom       = 5;
            tcontainer.Margin = marg;
            marg        = gb.Margin;
            marg.Bottom = 15;
            marg.Right  = 5;
            gb.Margin   = marg;
            RecurseLayout(Skin);
            Gwen.Align.AlignBottom(gb);
            Gwen.Align.AlignRight(gb);
            LabeledCheckBox lcb = new LabeledCheckBox(gb);

            marg              = lcb.Margin;
            marg.Top         += 5;
            lcb.Margin        = marg;
            lcb.Text          = "Recording Mode";
            lcb.Dock          = Pos.Top;
            lcb.IsChecked     = game.SettingRecordingMode;
            lcb.CheckChanged += (o, e) => { game.SettingRecordingMode = ((LabeledCheckBox)o).IsChecked; };
            lcb.SetToolTipText(@"Disables many editor features
and changes the client so it can be 
recorded with a specific aesthetic");
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Color Playback";
            lcb.IsChecked     = game.SettingColorPlayback;
            lcb.CheckChanged += (o, e) => { game.SettingColorPlayback = ((LabeledCheckBox)o).IsChecked; };
            lcb.SetToolTipText(@"During playback the lines will no
longer turn black by default, and 
will stay as they are in editor mode");
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Hit Test";
            lcb.IsChecked     = game.HitTest;
            lcb.CheckChanged += (o, e) => { game.HitTest = ((LabeledCheckBox)o).IsChecked; };
            lcb.SetToolTipText(@"During playback, hitting a line will turn it 
the color of the original line.");
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Preview Mode";
            lcb.IsChecked     = game.SettingPreviewMode;
            lcb.CheckChanged += (o, e) => { game.SettingPreviewMode = ((LabeledCheckBox)o).IsChecked; };
            lcb.Dock          = Pos.Top;
            lcb.SetToolTipText(@"The opposite of Color Playback. The editor will
shoe the lines as black instead");
            //

            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Zero Start";
            lcb.IsChecked     = game.Track.ZeroStart;
            lcb.CheckChanged += (o, e) => { game.Track.ZeroStart = ((LabeledCheckBox)o).IsChecked; };
            lcb.Dock          = Pos.Top;
            lcb.SetToolTipText(@"Starts the track with 0 momentum");

            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Smooth Camera";
            lcb.IsChecked     = Settings.Default.SmoothCamera;
            lcb.CheckChanged += (o, e) =>
            {
                Settings.Default.SmoothCamera = ((LabeledCheckBox)o).IsChecked;
                Settings.Default.Save();
            };
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Onion Skinning";
            lcb.IsChecked     = game.SettingOnionSkinning;
            lcb.CheckChanged += (o, e) =>
            {
                game.SettingOnionSkinning = ((LabeledCheckBox)o).IsChecked;
                game.Invalidate();
            };
            lcb.Dock = Pos.Top;
            //
            gb          = new GroupBox(container);
            gb.Text     = "Editor View";
            gb.Width    = 180;
            gb.Height   = 100;
            marg        = gb.Margin;
            marg.Bottom = 15;
            marg.Right  = 5;
            gb.Margin   = marg;
            Gwen.Align.AlignTop(gb);
            Gwen.Align.AlignRight(gb);
            Align.PlaceDownLeft(modesgb, gb);
            lcb               = new LabeledCheckBox(gb);
            marg              = lcb.Margin;
            marg.Top         += 5;
            lcb.Margin        = marg;
            lcb.Text          = "Contact Lines";
            lcb.IsChecked     = game.SettingDrawContactPoints;
            lcb.CheckChanged += (o, e) => { game.SettingDrawContactPoints = ((LabeledCheckBox)o).IsChecked; };
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Momentum Vectors";
            lcb.IsChecked     = game.SettingMomentumVectors;
            lcb.CheckChanged += (o, e) => { game.SettingMomentumVectors = ((LabeledCheckBox)o).IsChecked; };
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Gravity Wells";
            lcb.IsChecked     = game.SettingRenderGravityWells;
            lcb.CheckChanged += (o, e) => { game.SettingRenderGravityWells = ((LabeledCheckBox)o).IsChecked; game.InvalidateTrack(); };
            lcb.Dock          = Pos.Top;
            //playback
            gb          = new GroupBox(container);
            gb.Text     = "Playback";
            gb.Width    = 180;
            gb.Height   = 150;
            marg        = gb.Margin;
            marg.Bottom = 5;
            marg.Right  = 5;
            gb.Margin   = marg;
            Gwen.Align.AlignTop(gb);
            Gwen.Align.AlignLeft(gb);
            RadioButtonGroup rbg = new RadioButtonGroup(gb);

            rbg.Text = "Playback Zoom";
            rbg.AddOption("Current Zoom");
            rbg.AddOption("Default Zoom");
            rbg.AddOption("Specific Zoom");
            rbg.SetSelection(Settings.Default.PlaybackZoom);
            rbg.SelectionChanged += (o, e) =>
            {
                Settings.Default.PlaybackZoom = ((RadioButtonGroup)o).SelectedIndex;
                Settings.Default.Save();
            };
            rbg.Dock = Pos.Top;
            rbg.AutoSizeToContents = false;
            rbg.Height             = 90;
            var nud = new NumericUpDown(rbg);

            nud.Value         = Settings.Default.PlaybackZoomSpecific;
            nud.Max           = 24;
            nud.Min           = 1;
            nud.Dock          = Pos.Bottom;
            nud.ValueChanged += (o, e) =>
            {
                Settings.Default.PlaybackZoomSpecific = ((NumericUpDown)o).Value;
                Settings.Default.Save();
            };
            var cbplayback = new ComboBox(gb);

            cbplayback.Dock = Pos.Top;
            for (var i = 0; i < GLWindow.MotionArray.Length; i++)
            {
                var f = (GLWindow.MotionArray[i] / 40f);
                cbplayback.AddItem("Playback: " + f + "x", f.ToString(CultureInfo.InvariantCulture), f);
            }
            cbplayback.SelectByName(game.SettingDefaultPlayback.ToString(CultureInfo.InvariantCulture));
            cbplayback.ItemSelected += (o, e) =>
            {
                game.SettingDefaultPlayback = (float)e.SelectedItem.UserData;
            };
            var cbslowmo = new ComboBox(gb);

            cbslowmo.Dock = Pos.Top;
            var fpsarray = new[] { 1, 2, 5, 10, 20 };

            for (var i = 0; i < fpsarray.Length; i++)
            {
                cbslowmo.AddItem("Slowmo FPS: " + fpsarray[i], fpsarray[i].ToString(CultureInfo.InvariantCulture),
                                 fpsarray[i]);
            }
            cbslowmo.SelectByName(game.SettingSlowmoSpeed.ToString(CultureInfo.InvariantCulture));
            cbslowmo.ItemSelected += (o, e) =>
            {
                game.SettingSlowmoSpeed = (int)e.SelectedItem.UserData;
            };
            //editor
            var backup = gb;

            gb          = new GroupBox(container);
            gb.Text     = "Editor";
            gb.Width    = 180;
            gb.Height   = 170;
            marg        = gb.Margin;
            marg.Bottom = 5;
            marg.Right  = 5;
            gb.Margin   = marg;
            Gwen.Align.PlaceDownLeft(gb, backup);
            //Gwen.Align.AlignRight(gb);
            lcb               = new LabeledCheckBox(gb);
            marg              = lcb.Margin;
            marg.Top         += 5;
            lcb.Margin        = marg;
            lcb.Text          = "All Pink Lifelock";
            lcb.IsChecked     = Settings.Default.PinkLifelock;
            lcb.CheckChanged += (o, e) => { Settings.Default.PinkLifelock = ((LabeledCheckBox)o).IsChecked; Settings.Default.Save(); };
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Disable Line Snap";
            lcb.IsChecked     = game.SettingDisableSnap;
            lcb.CheckChanged += (o, e) => { game.SettingDisableSnap = ((LabeledCheckBox)o).IsChecked; };
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Force XY Snap";
            lcb.IsChecked     = game.SettingForceXySnap;
            lcb.CheckChanged += (o, e) => { game.SettingForceXySnap = ((LabeledCheckBox)o).IsChecked; };
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Superzoom";
            lcb.IsChecked     = Settings.Default.SuperZoom;
            lcb.CheckChanged += (o, e) => { Settings.Default.SuperZoom = ((LabeledCheckBox)o).IsChecked; Settings.Default.Save(); };
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "White BG";
            lcb.SetToolTipText(@"For if you're a bad person");
            lcb.IsChecked     = Settings.Default.WhiteBG;
            lcb.CheckChanged += (o, e) =>
            {
                Settings.Default.WhiteBG = ((LabeledCheckBox)o).IsChecked;
                Settings.Default.Save();
                if (!Settings.Default.NightMode)
                {
                    GL.ClearColor(Settings.Default.WhiteBG ? GLWindow.ColorWhite : GLWindow.ColorOffwhite);
                }
            };
            lcb.Dock          = Pos.Top;
            lcb               = new LabeledCheckBox(gb);
            lcb.Text          = "Night Mode";
            lcb.IsChecked     = Settings.Default.NightMode;
            lcb.CheckChanged += (o, e) =>
            {
                if (((LabeledCheckBox)o).IsChecked)
                {
                    GL.ClearColor(new Color4(50, 50, 60, 255));
                }
                else
                {
                    GL.ClearColor(Settings.Default.WhiteBG ? GLWindow.ColorWhite : GLWindow.ColorOffwhite);
                }
                Settings.Default.NightMode = ((LabeledCheckBox)o).IsChecked;
                Settings.Default.Save();
                game.Canvas.ButtonsToggleNightmode();
                game.Track.RefreshTrack();
            };
            lcb.Dock = Pos.Top;
            lcb      = new LabeledCheckBox(gb);
            lcb.Text = "Live Line Editing";
            lcb.SetToolTipText("For the line adjust tool during playback\r\nEnable this if you have a slow PC");
            lcb.IsChecked     = Settings.Default.LiveAdjustment;
            lcb.CheckChanged += (o, e) => { Settings.Default.LiveAdjustment = ((LabeledCheckBox)o).IsChecked; Settings.Default.Save(); };
            lcb.Dock          = Pos.Top;
        }