Exemple #1
0
        private void SetupWC(Viewport vp)
        {
            wc.Clear();
            Sim.Environment.World world = manager.UI.Sim.World;
            wc.Disable(manager.UI);
            Rectangle  wcArea  = new Rectangle(0, 0, vp.Width / 2, vp.Height / 3);
            ControlMat wcSpace = new ControlMat(wcArea, 7, 1, 2, ControlMat.FillOrder.RowsFirst);
            int        i       = 0;

            wc.Add(new Label("Weather Options", wcSpace.Spaces[i++], Label.Fit.AlignCenter));

            ToggleButton rain = new ToggleButton("Active", wcSpace.Spaces[i++]);

            rain.Use += delegate() { world.Weather.Active = !world.Weather.Active; };
            wc.Add(rain);

            Slider turbSlider = new Slider("Turbulence", wcSpace.Spaces[i++], 0, 30);

            turbSlider.SetValue(Sim.Settings.Graphics.Default.WindTurbulence);
            turbSlider.Use += delegate(float v) { Sim.Settings.Graphics.Default.WindTurbulence = v; };
            wc.Add(turbSlider);

            Slider windX = new Slider("Wind X", wcSpace.Spaces[i++], -75.0f, 75.0f);

            windX.SetValue(Sim.Settings.Graphics.Default.WindX);
            windX.Use += delegate(float v) { Sim.Settings.Graphics.Default.WindX = v; };
            wc.Add(windX);

            Slider windZ = new Slider("Wind Z", wcSpace.Spaces[i++], -75.0f, 75.0f);

            windZ.SetValue(Sim.Settings.Graphics.Default.WindZ);
            windZ.Use += delegate(float v) { Sim.Settings.Graphics.Default.WindZ = v; };
            wc.Add(windZ);

            Slider overcast = new Slider("Overcast", wcSpace.Spaces[i++], 1, 5);

            overcast.SetValue(Sim.Settings.Graphics.Default.Overcast);
            overcast.Use += delegate(float v) { Sim.Settings.Graphics.Default.Overcast = v; Shaders.Common.Parameters["overcast"].SetValue(v); };
            wc.Add(overcast);
        }
Exemple #2
0
        private void SetupMenu(Viewport vp)
        {
            menu.Clear();

            int menuHeight = vp.Height / 20;

            menuArea = new Rectangle(0, vp.Height - menuHeight, (int)(vp.Width * 0.7f), menuHeight);
            ControlMat menuSpace = new ControlMat(menuArea, 1, 5, 2, ControlMat.FillOrder.ColumnsFirst);
            int        i         = 0;

            Panel mPanel = new Panel("Menu Panel", new Rectangle(0, menuArea.Y, vp.Width, menuHeight), new Color(0, 0, 0, 128));

            mPanel.Texture = UserInterface.TexButtonM;
            menu.Add(mPanel);
            menu.Add(new Button("Menu", menuSpace.Spaces[i ++], delegate() { manager.ChangeScreen(new MenuScreen(manager)); }));
            menu.Add(new Button("Drawing", menuSpace.Spaces[i ++], delegate() { ChangeActiveCG(gc); }));
            menu.Add(new Button("Wildlife", menuSpace.Spaces[i ++], delegate() { ChangeActiveCG(ac); }));
            menu.Add(new Button("Weather", menuSpace.Spaces[i ++], delegate() { ChangeActiveCG(wc); }));
            menu.Add(new Button("Camera", menuSpace.Spaces[i ++], delegate() { ChangeActiveCG(cc); }));
            timeLabel = new Label("Time", new Rectangle(menuSpace.Spaces[i - 1].Right, menuArea.Y, vp.Width - menuArea.Width, menuArea.Height), Label.Fit.AlignCenter);
            menu.Add(timeLabel);
        }
Exemple #3
0
        private void SetupGC(Viewport vp)
        {
            gc.Clear();


            Sim.Environment.World world   = manager.UI.Sim.World;
            Rectangle             gcArea  = new Rectangle(0, 0, vp.Width / 3, (int)(vp.Height / 1.5f));
            ControlMat            gcSpace = new ControlMat(gcArea, 16, 1, 2, ControlMat.FillOrder.RowsFirst);
            int i = 0;

            gc.Add(new Label("Drawing Options", gcSpace.Spaces[i++], Label.Fit.AlignCenter));

            Spinner <FillMode> gcFillSpinner = new Spinner <FillMode>("Fill Mode", gcSpace.Spaces[i++]);

            gcFillSpinner.Add(FillMode.Solid);
            gcFillSpinner.Add(FillMode.WireFrame);
            gcFillSpinner.Add(FillMode.Point);
            gcFillSpinner.Use += delegate() { world.FillMode = gcFillSpinner.GetSelected(); };
            gc.Add(gcFillSpinner);
            gc.Disable(manager.UI);

            Sim.Settings.Graphics gs = Sim.Settings.Graphics.Default;

            gc.Add(new Button("Sky", gcSpace.Spaces[i ++], delegate() { world.Sky.Visible = !world.Sky.Visible; }));
            gc.Add(new Button("Terrain", gcSpace.Spaces[i ++], delegate() { world.Terrain.Visible = !world.Terrain.Visible; }));
            gc.Add(new Button("Water", gcSpace.Spaces[i ++], delegate() { world.Water.Visible = !world.Water.Visible; }));
            gc.Add(new Button("Axes", gcSpace.Spaces[i ++], delegate() { world.DrawAxes = !world.DrawAxes; }));
            gc.Add(new Button("Vegetation", gcSpace.Spaces[i ++], delegate() { world.Vegetation.Visible = !world.Vegetation.Visible; }));
            gc.Add(new Button("AI Nodes", gcSpace.Spaces[i ++], delegate() { world.Terrain.DrawNodes = !world.Terrain.DrawNodes; }));
            gc.Add(new Button("Terrain Normals", gcSpace.Spaces[i ++], delegate() { world.Terrain.DrawNormals = !world.Terrain.DrawNormals; }));
            gc.Add(new Button("Detail Texturing", gcSpace.Spaces[i ++], delegate() {
                gs.TerrainDetail = !gs.TerrainDetail;
                world.Terrain.Effect.Parameters["bDetailEnabled"].SetValue(gs.TerrainDetail);
            }));
            gc.Add(new Button("Bump Mapping", gcSpace.Spaces[i ++], delegate() {
                gs.BumpEnabled = !gs.BumpEnabled;
                world.Terrain.Effect.Parameters["bBumpEnabled"].SetValue(gs.BumpEnabled);
            }));
            gc.Add(new Button("Shadow Mapping", gcSpace.Spaces[i ++], delegate() {
                gs.ShadowsEnabled = !gs.ShadowsEnabled;
                Shaders.Common.Parameters["bShadowsEnabled"].SetValue(gs.ShadowsEnabled);
            }));
            gc.Add(new Button("Bloom", gcSpace.Spaces[i ++], delegate()
            {
                gs.BloomEnabled = !gs.BloomEnabled;
            }));

            Slider biSlider = new Slider("Bloom Intes.", gcSpace.Spaces[i++], 0, 10);

            biSlider.SetValue(1.25f);
            biSlider.Use += delegate(float v) { manager.UI.Sim.PostProcessManager.Bloom.SetIntensity(v); };
            gc.Add(biSlider);

            Slider btSlider = new Slider("Bloom Thres.", gcSpace.Spaces[i++], 0, 1);

            btSlider.SetValue(0.6f);
            btSlider.Use += delegate(float v) { manager.UI.Sim.PostProcessManager.Bloom.SetThreshold(v); };
            gc.Add(btSlider);

            Slider bbSlider = new Slider("Bloom Blur", gcSpace.Spaces[i++], 0, 20);

            bbSlider.SetValue(8);
            bbSlider.Use += delegate(float v) { manager.UI.Sim.PostProcessManager.Bloom.SetBlur(v); };
            gc.Add(bbSlider);
        }