Beispiel #1
0
        private HorizontalSlider AddSlider(Panel panel, string key, Action <HorizontalSlider> setIndicator)
        {
            AddLabel(panel, key);
            y += 6;
            HorizontalSlider slider = DaggerfallUI.AddSlider(new Vector2(0, y), setIndicator, itemTextScale, panel);

            y += itemSpacing;
            return(slider);
        }
Beispiel #2
0
        public override void Setup(Panel parent)
        {
            Vector2 pos = settingsStartPos;

            // About this effect
            AddTipPanel(parent, TextManager.Instance.GetLocalizedText("ambientOcclusionTip"));

            // Enable toggle
            enableCheckbox = AddCheckbox(parent, TextManager.Instance.GetLocalizedText("enable"), ref pos);
            enableCheckbox.OnToggleState += EnableCheckbox_OnToggleState;

            // Method slider
            string[] aoMethods = GetSupportedMethods();
            aoMethodSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("method"), aoMethods.Length, ref pos);
            aoMethodSlider.OnScroll += AoMethodSlider_OnScroll;
            aoMethodSlider.SetIndicator(aoMethods, DaggerfallUnity.Settings.AmbientOcclusionMethod);
            StyleIndicator(aoMethodSlider);

            // Intensity slider
            intensitySlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("intensity"), 40, ref pos);
            intensitySlider.OnScroll += IntensitySlider_OnScroll;
            intensitySlider.SetIndicator(0.0f, 4.0f, DaggerfallUnity.Settings.AmbientOcclusionIntensity);
            StyleIndicator(intensitySlider);

            // Setup two panels to hold settings unique to each method
            method0Panel.Position = method1Panel.Position = pos;
            parent.Components.Add(method0Panel);
            parent.Components.Add(method1Panel);

            // Method0 - Radius slider
            pos                    = Vector2.zero;
            radiusSlider           = AddSlider(method0Panel, TextManager.Instance.GetLocalizedText("radius"), 20, ref pos);
            radiusSlider.OnScroll += RadiusSlider_OnScroll;;
            radiusSlider.SetIndicator(0.0f, 2.0f, DaggerfallUnity.Settings.AmbientOcclusionRadius);
            StyleIndicator(radiusSlider);

            // Method0 - Quality slider
            string[] qualityLevels = new string[]
            {
                TextManager.Instance.GetLocalizedText("lowest"),
                TextManager.Instance.GetLocalizedText("low"),
                TextManager.Instance.GetLocalizedText("medium"),
                TextManager.Instance.GetLocalizedText("high"),
                TextManager.Instance.GetLocalizedText("ultra")
            };
            qualitySlider           = AddSlider(method0Panel, TextManager.Instance.GetLocalizedText("quality"), aoMethods.Length, ref pos);
            qualitySlider.OnScroll += QualitySlider_OnScroll;
            qualitySlider.SetIndicator(qualityLevels, DaggerfallUnity.Settings.AmbientOcclusionQuality);
            StyleIndicator(qualitySlider);

            // Method1 - Thickness slider
            pos             = Vector2.zero;
            thicknessSlider = AddSlider(method1Panel, TextManager.Instance.GetLocalizedText("thickness"), 100, ref pos);
            thicknessSlider.SetIndicator(1.0f, 10.0f, DaggerfallUnity.Settings.AmbientOcclusionThickness);
            thicknessSlider.OnScroll += ThicknessSlider_OnScroll;
            StyleIndicator(thicknessSlider);
        }
Beispiel #3
0
        public override void InitWindow()
        {
            SetParameters(this.GetType().Name, this.GetType().Name, 800, 800, false);
            IsCentered = true;

            TitleBar titleBar = new TitleBar(this.GetType().Name);

            OpenGLLayer ogl = new OpenGLLayer();

            ogl.SetMargin(0, titleBar.GetHeight(), 0, 0);

            HorizontalStack toolbar = Items.GetToolbarLayout();

            ImagedButton btnRotateLeft  = Items.GetImagedButton(EmbeddedImage.ArrowUp, -90);
            ImagedButton btnRotateRight = Items.GetImagedButton(EmbeddedImage.ArrowUp, 90);

            HorizontalSlider zoom = Items.GetSlider();

            ImagedButton btnRestoreView = Items.GetImagedButton(EmbeddedImage.Refresh, 0);

            // adding
            AddItems(titleBar, ogl);
            ogl.AddItems(toolbar);
            toolbar.AddItems(btnRotateLeft, btnRotateRight, zoom, btnRestoreView);

            // assign events
            btnRestoreView.EventMousePress += (sender, args) =>
            {
                ogl.RestoreView();
            };

            btnRotateLeft.EventMousePress += (sender, args) =>
            {
                ogl.Rotate(KeyCode.Left);
            };

            btnRotateRight.EventMousePress += (sender, args) =>
            {
                ogl.Rotate(KeyCode.Right);
            };

            zoom.EventValueChanged += (sender) =>
            {
                ogl.SetZoom(zoom.GetCurrentValue());
            };

            // Set focus
            ogl.SetFocus();
            zoom.SetCurrentValue(3);
        }
Beispiel #4
0
        public static HorizontalSlider GetSlider()
        {
            HorizontalSlider slider = new HorizontalSlider();

            slider.SetStep(0.2f);
            slider.SetMinValue(2f);
            slider.SetMaxValue(10f);
            slider.SetSizePolicy(SizePolicy.Fixed, SizePolicy.Fixed);
            slider.SetSize(150, 30);
            slider.SetAlignment(ItemAlignment.HCenter, ItemAlignment.Bottom);
            slider.SetMargin(40, 0, 40, 0);
            slider.Handler.SetShadow(5, 0, 2, Color.Black);
            return(slider);
        }
Beispiel #5
0
        private void Video(Panel leftPanel, Panel rightPanel)
        {
            // Basic settings
            AddSectionTitle(leftPanel, "basic");
            resolution = AddSlider(leftPanel, "resolution",
                                   Array.FindIndex(resolutions, x => x.width == DaggerfallUnity.Settings.ResolutionWidth && x.height == DaggerfallUnity.Settings.ResolutionHeight),
                                   resolutions.Select(x => string.Format("{0}x{1}", x.width, x.height)).ToArray());
            resolution.OnScroll += Resolution_OnScroll;
            fullscreen           = AddCheckbox(leftPanel, "fullscreen", DaggerfallUnity.Settings.Fullscreen);
            //exclusiveFullscreen = AddCheckbox(leftPanel, "exclusiveFullscreen", DaggerfallUnity.Settings.ExclusiveFullscreen);
            fullscreen.OnToggleState += Fullscreen_OnToggleState;
            //exclusiveFullscreen.OnToggleState += ExclusiveFullscreen_OnToggleState;
            runInBackground        = AddCheckbox(leftPanel, "runInBackground", DaggerfallUnity.Settings.RunInBackground);
            qualityLevel           = AddSlider(leftPanel, "qualityLevel", DaggerfallUnity.Settings.QualityLevel, QualitySettings.names);
            qualityLevel.OnScroll += QualityLevel_OnScroll;
            string[] filterModes = new string[] { "Point", "Bilinear", "Trilinear" };
            mainFilterMode  = AddSlider(leftPanel, "mainFilterMode", DaggerfallUnity.Settings.MainFilterMode, filterModes);
            guiFilterMode   = AddSlider(leftPanel, "guiFilterMode", DaggerfallUnity.Settings.GUIFilterMode, filterModes);
            videoFilterMode = AddSlider(leftPanel, "videoFilterMode", DaggerfallUnity.Settings.VideoFilterMode, filterModes);
            string[] antiAliasingMethods = new string[] { "None", "FXAA", "SMAA", "TAA" };
            antiAliasingMethod = AddSlider(leftPanel, "antiAliasingMethod", DaggerfallUnity.Settings.Antialiasing, antiAliasingMethods);

            y = 0;

            // Advanced settings
            AddSectionTitle(rightPanel, "advanced");
            fovSlider            = AddSlider(rightPanel, "fovSlider", 60, 120, DaggerfallUnity.Settings.FieldOfView);
            terrainDistance      = AddSlider(rightPanel, "terrainDistance", 1, 4, DaggerfallUnity.Settings.TerrainDistance);
            shadowResolutionMode = AddSlider(rightPanel, "shadowResolutionMode",
                                             DaggerfallUnity.Settings.ShadowResolutionMode, "Low", "Medium", "High", "Very High");
            dungeonLightShadows  = AddCheckbox(rightPanel, "dungeonLightShadows", DaggerfallUnity.Settings.DungeonLightShadows);
            interiorLightShadows = AddCheckbox(rightPanel, "interiorLightShadows", DaggerfallUnity.Settings.InteriorLightShadows);
            exteriorLightShadows = AddCheckbox(rightPanel, "exteriorLightShadows", DaggerfallUnity.Settings.ExteriorLightShadows);
            ambientLitInteriors  = AddCheckbox(rightPanel, "ambientLitInteriors", DaggerfallUnity.Settings.AmbientLitInteriors);
            string textureArrayLabel = "Texture Arrays: ";

            if (!SystemInfo.supports2DArrayTextures)
            {
                textureArrayLabel += "Unsupported";
            }
            else
            {
                textureArrayLabel += DaggerfallUnity.Settings.EnableTextureArrays ? "Enabled" : "Disabled";
            }
            AddInfo(rightPanel, textureArrayLabel, "Improved implementation of terrain textures, with better performance and modding support");
            retroRenderingMode = AddSlider(rightPanel, "retroRenderingMode",
                                           DaggerfallUnity.Settings.RetroRenderingMode, "Off", "320x200", "640x400");
            postProcessingInRetroMode = AddSlider(rightPanel, "postProcessingInRetroMode",
                                                  DaggerfallUnity.Settings.PostProcessingInRetroMode, "Off", "Posterization (full)", "Posterization (-sky)", "Palettization (full)", "Palettization (-sky)");
        }
Beispiel #6
0
        public SliderTest(ControlBase parent) : base(parent)
        {
            TableLayout table = new TableLayout(parent);

            table.ColumnCount = 2;
            // table.Dock = Dock.Fill;
            table.Width  = 500;
            table.Height = 500;
            var row = table.CreateRow();
            // Gwen.Controls.sl
            VerticalSlider slider = new VerticalSlider(row.GetCell(0));

            slider.Tooltip = "val";
            slider.SetRange(0, 100);
            //row.AutoSizeToContents = true;
            HorizontalSlider slider2 = new HorizontalSlider(row.GetCell(1));

            slider2.Width = 100;
            slider2.SetRange(0, 100);
            row                  = table.CreateRow();
            slider               = new VerticalSlider(row.GetCell(0));
            slider.NotchCount    = 10;
            slider.ValueChanged += (o, e) =>
            {
                var sl = (Slider)o;
                Console.WriteLine(sl.Value);
            };
            slider.SnapToNotches = true;
            slider.SetRange(0, 100);
            //row.AutoSizeToContents = true;
            slider2 = new HorizontalSlider(row.GetCell(1));
            slider2.SnapToNotches = true;
            slider2.Width         = 100;
            slider2.SetRange(-100, 100);
            slider2.NotchCount    = 15;
            slider2.SnapToNotches = true;
            slider2.Tooltip       = "I have notches but theyre hidden";
            slider2.DrawNotches   = false;
            row     = table.CreateRow();
            slider2 = new HorizontalSlider(row.GetCell(1));
            slider2.SnapToNotches = true;
            slider2.Disable();
            slider2.Width = 100;
            slider2.SetRange(-100, 100);
            slider2.NotchCount    = 15;
            slider2.SnapToNotches = true;
            slider2.Tooltip       = "I have notches but theyre hidden";
            slider2.DrawNotches   = false;
        }
        private void Theme(Panel leftPanel, Panel rightPanel)
        {
            // Tooltips
            AddSectionTitle(leftPanel, "tooltips");
            toolTipDelayInSeconds  = AddSlider(leftPanel, "toolTipDelayInSeconds", 0, 10, DaggerfallUnity.Settings.ToolTipDelayInSeconds);
            toolTipTextColor       = AddColorPicker(leftPanel, "toolTipTextColor", DaggerfallUnity.Settings.ToolTipTextColor);
            toolTipBackgroundColor = AddColorPicker(leftPanel, "toolTipBackgroundColor", DaggerfallUnity.Settings.ToolTipBackgroundColor);

            // Others
            AddSectionTitle(leftPanel, "others");
            enableModernConversationStyleInTalkWindow = AddCheckbox(leftPanel, "enableModernConversationStyleInTalkWindow", DaggerfallUnity.Settings.EnableModernConversationStyleInTalkWindow);
            interactionModeIcon = AddSlider(leftPanel, "interactionModeIcon",
                                            Enum.IsDefined(typeof(InteractionModeIconModes), DaggerfallUnity.Settings.InteractionModeIcon) ? (int)Enum.Parse(typeof(InteractionModeIconModes), DaggerfallUnity.Settings.InteractionModeIcon) : 0,
                                            Enum.GetNames(typeof(InteractionModeIconModes)));
        }
Beispiel #8
0
        /// <summary>
        /// Get a slider.
        /// </summary>
        private HorizontalSlider GetSlider()
        {
            MovePosition(6);

            var slider = new HorizontalSlider();

            slider.Position        = new Vector2(x, y);
            slider.Size            = new Vector2(80.0f, 4.0f);
            slider.DisplayUnits    = 20;
            slider.BackgroundColor = new Color(0.5f, 0.5f, 0.5f, 0.3f);
            slider.TintColor       = new Color(153, 153, 0);
            modSliders.Add(slider);
            currentPanel.Components.Add(slider);
            return(slider);
        }
Beispiel #9
0
    public Simulator(Action invalidate, Action <Simulator> exit)
    {
        this.invalidate = invalidate;
        this.exit       = exit;

        GatherData();

        selectedSimbol  = tape[headPos];
        selectedCommand = new Command("", "", "", Direction.Stay, "0"); // first command only new state matters.
        head            = new Head();
        text            = new Text();
        slider          = new HorizontalSlider();
        InitButtons();
        Reposition();
        invalidate();
    }
Beispiel #10
0
        public SliderTest(ControlBase parent)
            : base(parent)
        {
            HorizontalLayout hlayout = new HorizontalLayout(this);

            VerticalLayout vlayout = new VerticalLayout(hlayout);

            {
                HorizontalSlider slider = new HorizontalSlider(vlayout);
                slider.Margin = Margin.Ten;
                slider.Width  = 150;
                slider.SetRange(0, 100);
                slider.Value         = 25;
                slider.ValueChanged += SliderMoved;
            }

            {
                HorizontalSlider slider = new HorizontalSlider(vlayout);
                slider.Margin = Margin.Ten;
                slider.Width  = 150;
                slider.SetRange(0, 100);
                slider.Value         = 20;
                slider.NotchCount    = 10;
                slider.SnapToNotches = true;
                slider.ValueChanged += SliderMoved;
            }

            {
                VerticalSlider slider = new VerticalSlider(hlayout);
                slider.Margin = Margin.Ten;
                slider.Height = 200;
                slider.SetRange(0, 100);
                slider.Value         = 25;
                slider.ValueChanged += SliderMoved;
            }

            {
                VerticalSlider slider = new VerticalSlider(hlayout);
                slider.Margin = Margin.Ten;
                slider.Height = 200;
                slider.SetRange(0, 100);
                slider.Value         = 20;
                slider.NotchCount    = 10;
                slider.SnapToNotches = true;
                slider.ValueChanged += SliderMoved;
            }
        }
Beispiel #11
0
        public override void Setup(Panel parent)
        {
            Vector2 pos = settingsStartPos;

            // About this effect
            AddTipPanel(parent, TextManager.Instance.GetLocalizedText("colorBoostTip"));

            // Enable toggle
            enableCheckbox = AddCheckbox(parent, TextManager.Instance.GetLocalizedText("enable"), ref pos);
            enableCheckbox.OnToggleState += EnableCheckbox_OnToggleState;

            // Radius slider
            radiusSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("radius"), 500, ref pos);
            radiusSlider.OnScroll += RadiusSlider_OnScroll;
            radiusSlider.SetIndicator(0.1f, 50.0f, DaggerfallUnity.Settings.ColorBoostRadius);
            StyleIndicator(radiusSlider);

            // Intensity slider
            intensitySlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("intensity"), 10, ref pos);
            intensitySlider.OnScroll += IntensitySlider_OnScroll;
            intensitySlider.SetIndicator(0.0f, 1.0f, DaggerfallUnity.Settings.ColorBoostIntensity);
            StyleIndicator(intensitySlider);

            // Dungeon Scale slider
            dungeonScaleSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("dungeonScale"), 80, ref pos);
            dungeonScaleSlider.OnScroll += DungeonScaleSlider_OnScroll;
            dungeonScaleSlider.SetIndicator(0.0f, 8.0f, DaggerfallUnity.Settings.ColorBoostDungeonScale);
            StyleIndicator(dungeonScaleSlider);

            // Interior Scale slider
            interiorScaleSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("interiorScale"), 80, ref pos);
            interiorScaleSlider.OnScroll += InteriorScaleSlider_OnScroll;
            interiorScaleSlider.SetIndicator(0.0f, 8.0f, DaggerfallUnity.Settings.ColorBoostInteriorScale);
            StyleIndicator(interiorScaleSlider);

            // Exterior Scale slider
            exteriorScaleSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("exteriorScale"), 80, ref pos);
            exteriorScaleSlider.OnScroll += ExteriorScaleSlider_OnScroll;
            exteriorScaleSlider.SetIndicator(0.0f, 8.0f, DaggerfallUnity.Settings.ColorBoostExteriorScale);
            StyleIndicator(exteriorScaleSlider);

            // Dungeon falloff
            dungeonFalloffSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("dungeonFalloff"), 80, ref pos);
            dungeonFalloffSlider.OnScroll += DungeonFalloffSlider_OnScroll;
            dungeonFalloffSlider.SetIndicator(0.0f, 8.0f, DaggerfallUnity.Settings.ColorBoostDungeonFalloff);
            StyleIndicator(dungeonFalloffSlider);
        }
Beispiel #12
0
        public override void Setup(Panel parent)
        {
            Vector2 pos = settingsStartPos;

            // About this effect
            AddTipPanel(parent, TextManager.Instance.GetLocalizedText("retroModeTip"));

            // Mode slider
            string[] modes = new string[]
            {
                TextManager.Instance.GetLocalizedText("retroModeOff"),
                TextManager.Instance.GetLocalizedText("retroMode320x200"),
                TextManager.Instance.GetLocalizedText("retroMode640x400"),
            };
            modeSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("mode"), modes.Length, ref pos);
            modeSlider.OnScroll += ModeSlider_OnScroll;
            modeSlider.SetIndicator(modes, DaggerfallUnity.Settings.RetroRenderingMode);
            StyleIndicator(modeSlider);

            // PostProcess Slider
            string[] postProcessModes = new string[]
            {
                TextManager.Instance.GetLocalizedText("off"),
                TextManager.Instance.GetLocalizedText("posterizationFull"),
                TextManager.Instance.GetLocalizedText("posterizationMinusSky"),
                TextManager.Instance.GetLocalizedText("palettizationFull"),
                TextManager.Instance.GetLocalizedText("palettizationMinusSky"),
            };
            postProcessSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("postProcess"), postProcessModes.Length, ref pos);
            postProcessSlider.OnScroll += PostProcessSlider_OnScroll;
            postProcessSlider.SetIndicator(postProcessModes, DaggerfallUnity.Settings.PostProcessingInRetroMode);
            StyleIndicator(postProcessSlider);

            // Aspect Correction Checkboxes
            // Not using a slider as the sudden rescale in UI can cause aspect to bounce back and forth based on mouse position while dragging slider thumb
            AddLabel(parent, TextManager.Instance.GetLocalizedText("retroModeAspectCorrection"), ref pos);
            pos.y += yIncrement;
            aspectCorrectionOff = AddCheckbox(parent, TextManager.Instance.GetLocalizedText("off"), ref pos);
            aspectCorrectionOff.OnToggleState        += AspectCorrectionOff_OnToggleState;
            aspectCorrectionFourThree                 = AddCheckbox(parent, TextManager.Instance.GetLocalizedText("FourThree"), ref pos);
            aspectCorrectionFourThree.OnToggleState  += AspectCorrectionFourThree_OnToggleState;
            aspectCorrectionSixteenTen                = AddCheckbox(parent, TextManager.Instance.GetLocalizedText("SixteenTen"), ref pos);
            aspectCorrectionSixteenTen.OnToggleState += AspectCorrectionSixteenTen_OnToggleState;
            UpdateAspectButtons();
        }
Beispiel #13
0
        private void BuildUI()
        {
            Position = new HorizontalSlider();
            Position.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            Position.Maximum             = 1;
            Position.Width = 500;
            Position.Id    = "Position";

            var panel1 = new Panel();

            panel1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
            panel1.VerticalAlignment   = Myra.Graphics2D.UI.VerticalAlignment.Bottom;
            panel1.Padding             = new Thickness(0, 0, 0, 30);
            panel1.Widgets.Add(Position);


            Widgets.Add(panel1);
        }
Beispiel #14
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            {
                HorizontalSlider slider = new HorizontalSlider(this);
                slider.SetPosition(10, 10);
                slider.SetSize(150, 20);
                slider.SetRange(0, 100);
                slider.Value         = 25;
                slider.ValueChanged += SliderMoved;
            }

            {
                HorizontalSlider slider = new HorizontalSlider(this);
                slider.SetPosition(10, 40);
                slider.SetSize(150, 20);
                slider.SetRange(0, 100);
                slider.Value         = 20;
                slider.NotchCount    = 10;
                slider.SnapToNotches = true;
                slider.ValueChanged += SliderMoved;
            }

            {
                VerticalSlider slider = new VerticalSlider(this);
                slider.SetPosition(160, 10);
                slider.SetSize(20, 200);
                slider.SetRange(0, 100);
                slider.Value         = 25;
                slider.ValueChanged += SliderMoved;
            }

            {
                VerticalSlider slider = new VerticalSlider(this);
                slider.SetPosition(190, 10);
                slider.SetSize(20, 200);
                slider.SetRange(0, 100);
                slider.Value         = 20;
                slider.NotchCount    = 10;
                slider.SnapToNotches = true;
                slider.ValueChanged += SliderMoved;
            }
        }
Beispiel #15
0
    /// <summary>
    /// Add a slider with a numerical indicator.
    /// </summary>
    /// <param name="panel">leftPanel, centerPanel or rightPanel.</param>
    /// <param name="minValue">Minimum value on slider.</param>
    /// <param name="maxValue">Maximum value on slider.</param>
    /// <param name="startValue">Initial value on slider.</param>
    /// <param name="title">Descriptive name of settings.</param>
    /// <param name="toolTip">Description of setting.</param>
    /// <param name="updateIndicator">Action to execute on scroll.</param>
    /// <param name="slider">Slider bar.</param>
    /// <param name="indicator">Slider value indicator.</param>
    void AddSlider(
        Panel panel,
        int minValue,
        int maxValue,
        int startValue,
        string title,
        string toolTip,
        HorizontalSlider.OnScrollHandler updateIndicator,
        out HorizontalSlider slider,
        out TextLabel indicator)
    {
        // Title
        TextLabel titleLabel = new TextLabel();

        titleLabel.Position    = new Vector2(0, y);
        titleLabel.TextScale   = itemTextScale;
        titleLabel.Text        = title;
        titleLabel.TextColor   = itemColor;
        titleLabel.ShadowColor = Color.clear;
        AddToolTipToTextLabel(titleLabel, toolTip);
        panel.Components.Add(titleLabel);

        y += 8;

        // Slider
        slider                 = new HorizontalSlider();
        slider.Position        = new Vector2(0, y);
        slider.Size            = new Vector2(80.0f, 5.0f);
        slider.DisplayUnits    = 20;
        slider.TotalUnits      = (maxValue - minValue) + 20;
        slider.ScrollIndex     = startValue - minValue;
        slider.BackgroundColor = scrollBarBackgroundColor;
        slider.TintColor       = new Color(153, 153, 0);
        slider.OnScroll       += updateIndicator;
        panel.Components.Add(slider);

        // Indicator
        indicator          = new TextLabel();
        indicator.Position = new Vector2(slider.Size.x + 15, y);
        updateIndicator();
        panel.Components.Add(indicator);

        y += itemSpacing;
    }
Beispiel #16
0
        private void BuildUI()
        {
            var label1 = new Label();

            label1.Text                = "Soup";
            label1.TextColor           = ColorStorage.CreateColor(254, 57, 48, 255);
            label1.DisabledTextColor   = ColorStorage.CreateColor(64, 64, 64, 255);
            label1.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;

            _menuLoadScenario      = new MenuItem();
            _menuLoadScenario.Text = "Load Scenario";
            _menuLoadScenario.Id   = "_menuLoadScenario";

            _newScenario      = new MenuItem();
            _newScenario.Text = "New Scenario";
            _newScenario.Id   = "_newScenario";

            _quit      = new MenuItem();
            _quit.Text = "Quit";
            _quit.Id   = "_quit";

            var verticalMenu1 = new VerticalMenu();

            verticalMenu1.Background = new SolidBrush("#404040FF");
            verticalMenu1.Items.Add(_menuLoadScenario);
            verticalMenu1.Items.Add(_newScenario);
            verticalMenu1.Items.Add(_quit);

            _gameSpeedSlider          = new HorizontalSlider();
            _gameSpeedSlider.Value    = 50;
            _gameSpeedSlider.MinWidth = 200;
            _gameSpeedSlider.Id       = "_gameSpeedSlider";

            _gameSpeedPanel = new Panel();
            _gameSpeedPanel.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Right;
            _gameSpeedPanel.Border = new SolidBrush("#5BC6FAFF");
            _gameSpeedPanel.Id     = "_gameSpeedPanel";
            _gameSpeedPanel.Widgets.Add(_gameSpeedSlider);


            Widgets.Add(label1);
            Widgets.Add(verticalMenu1);
            Widgets.Add(_gameSpeedPanel);
        }
        private void Video(Panel leftPanel, Panel rightPanel)
        {
            // Basic settings
            AddSectionTitle(leftPanel, "basic");
            resolution = AddSlider(leftPanel, "resolution",
                                   Array.FindIndex(resolutions, x => x.width == DaggerfallUnity.Settings.ResolutionWidth && x.height == DaggerfallUnity.Settings.ResolutionHeight),
                                   resolutions.Select(x => string.Format("{0}x{1}", x.width, x.height)).ToArray());
            resolution.OnScroll      += Resolution_OnScroll;
            fullscreen                = AddCheckbox(leftPanel, "fullscreen", DaggerfallUnity.Settings.Fullscreen);
            fullscreen.OnToggleState += Fullscreen_OnToggleState;
            qualityLevel              = AddSlider(leftPanel, "qualityLevel", DaggerfallUnity.Settings.QualityLevel, QualitySettings.names);
            qualityLevel.OnScroll    += QualityLevel_OnScroll;
            string[] filterModes = new string[] { "Point", "Bilinear", "Trilinear" };
            mainFilterMode  = AddSlider(leftPanel, "mainFilterMode", DaggerfallUnity.Settings.MainFilterMode, filterModes);
            guiFilterMode   = AddSlider(leftPanel, "guiFilterMode", DaggerfallUnity.Settings.GUIFilterMode, filterModes);
            videoFilterMode = AddSlider(leftPanel, "videoFilterMode", DaggerfallUnity.Settings.VideoFilterMode, filterModes);

            y = 0;

            // Advanced settings
            AddSectionTitle(rightPanel, "advanced");
            fovSlider            = AddSlider(rightPanel, "fovSlider", 60, 80, DaggerfallUnity.Settings.FieldOfView);
            terrainDistance      = AddSlider(rightPanel, "terrainDistance", 1, 4, DaggerfallUnity.Settings.TerrainDistance);
            shadowResolutionMode = AddSlider(rightPanel, "shadowResolutionMode",
                                             DaggerfallUnity.Settings.ShadowResolutionMode, "Low", "Medium", "High", "Very High");
            dungeonLightShadows  = AddCheckbox(rightPanel, "dungeonLightShadows", DaggerfallUnity.Settings.DungeonLightShadows);
            interiorLightShadows = AddCheckbox(rightPanel, "interiorLightShadows", DaggerfallUnity.Settings.InteriorLightShadows);
            useLegacyDeferred    = AddCheckbox(rightPanel, "useLegacyDeferred", DaggerfallUnity.Settings.UseLegacyDeferred);
            string textureArrayLabel = "Texture Arrays: ";

            if (!SystemInfo.supports2DArrayTextures)
            {
                textureArrayLabel += "Unsupported";
            }
            else
            {
                textureArrayLabel += DaggerfallUnity.Settings.EnableTextureArrays ? "Enabled" : "Disabled";
            }
            AddInfo(rightPanel, textureArrayLabel, "Improved implementation of terrain textures, with better performance and modding support");
            retroRenderingMode = AddSlider(rightPanel, "retroRenderingMode",
                                           DaggerfallUnity.Settings.RetroRenderingMode, "Off", "320x200", "640x400");
        }
Beispiel #18
0
        public override void Setup(Panel parent)
        {
            Vector2 pos = settingsStartPos;

            // About this effect
            AddTipPanel(parent, TextManager.Instance.GetLocalizedText("antialiasingTip"));

            // Method slider
            string[] antiAliasingMethods = new string[]
            {
                TextManager.Instance.GetLocalizedText("none"),
                TextManager.Instance.GetLocalizedText("fxaa"),
                TextManager.Instance.GetLocalizedText("smaa"),
                TextManager.Instance.GetLocalizedText("taa")
            };
            antialiasingMethodSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("method"), antiAliasingMethods.Length, ref pos);
            antialiasingMethodSlider.OnScroll += AntialiasingMethodSlider_OnScroll;
            antialiasingMethodSlider.SetIndicator(antiAliasingMethods, DaggerfallUnity.Settings.AntialiasingMethod);
            StyleIndicator(antialiasingMethodSlider);

            // FXAA Fast Mode toggle
            fxaaFastModeCheckbox = AddCheckbox(parent, TextManager.Instance.GetLocalizedText("fxaaFastMode"), ref pos);
            fxaaFastModeCheckbox.OnToggleState += FxaaFastMostCheckbox_OnToggleState;

            // SMAA Quality slider
            string[] smaaQuality = new string[]
            {
                TextManager.Instance.GetLocalizedText("low"),
                TextManager.Instance.GetLocalizedText("medium"),
                TextManager.Instance.GetLocalizedText("high")
            };
            smaaQualitySlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("smaaQuality"), smaaQuality.Length, ref pos);
            smaaQualitySlider.OnScroll += SmaaQualitySlider_OnScroll;
            smaaQualitySlider.SetIndicator(smaaQuality, DaggerfallUnity.Settings.AntialiasingSMAAQuality);
            StyleIndicator(smaaQualitySlider);

            // TAA Sharpness slider
            taaSharpnessSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("taaSharpness"), 30, ref pos);
            taaSharpnessSlider.OnScroll += TaaSharpnessSlider_OnScroll;
            taaSharpnessSlider.SetIndicator(0.0f, 3.0f, DaggerfallUnity.Settings.AntialiasingTAASharpness);
            StyleIndicator(taaSharpnessSlider);
        }
        public override void Setup(Panel parent)
        {
            Vector2 pos = settingsStartPos;

            // About this effect
            AddTipPanel(parent, TextManager.Instance.GetLocalizedText("depthOfFieldTip"));

            // Enable toggle
            enableCheckbox = AddCheckbox(parent, TextManager.Instance.GetLocalizedText("enable"), ref pos);
            enableCheckbox.OnToggleState += EnableCheckbox_OnToggleState;

            // Focus Distance slider
            focusDistanceSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("focusDistance"), 1000, ref pos);
            focusDistanceSlider.OnScroll += FocusDistanceSlider_OnScroll;
            focusDistanceSlider.SetIndicator(0.1f, 100.0f, DaggerfallUnity.Settings.DepthOfFieldFocusDistance);
            StyleIndicator(focusDistanceSlider);

            // Aperture slider
            apertureSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("aperture"), 320, ref pos);
            apertureSlider.OnScroll += ApertureSlider_OnScroll;
            apertureSlider.SetIndicator(0.1f, 32.0f, DaggerfallUnity.Settings.DepthOfFieldAperture);
            StyleIndicator(apertureSlider);

            // Focal Length slider
            focalLengthSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("focalLength"), 300, ref pos);
            focalLengthSlider.OnScroll += FocalLengthSlider_OnScroll;
            focalLengthSlider.SetIndicator(1, 300, DaggerfallUnity.Settings.DepthOfFieldFocalLength);
            StyleIndicator(focalLengthSlider);

            // Max Blur Size toggle
            string[] blurSizes = new string[]
            {
                TextManager.Instance.GetLocalizedText("small"),
                TextManager.Instance.GetLocalizedText("medium"),
                TextManager.Instance.GetLocalizedText("large"),
                TextManager.Instance.GetLocalizedText("veryLarge"),
            };
            maxBlurSizeSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("maxBlurSize"), blurSizes.Length, ref pos);
            maxBlurSizeSlider.OnScroll += MaxBlurSizeSlider_OnToggleState;
            maxBlurSizeSlider.SetIndicator(blurSizes, DaggerfallUnity.Settings.DepthOfFieldMaxBlurSize);
            StyleIndicator(maxBlurSizeSlider);
        }
        private void Video(Panel leftPanel, Panel rightPanel)
        {
            // Basic settings
            AddSectionTitle(leftPanel, "Basic");
            resolution = AddSlider(leftPanel, "Resolution", "Screen resolution",
                                   Array.FindIndex(Screen.resolutions, x => x.width == DaggerfallUnity.Settings.ResolutionWidth && x.height == DaggerfallUnity.Settings.ResolutionHeight),
                                   Screen.resolutions.Select(x => string.Format("{0}x{1}", x.width, x.height)).ToArray());
            resolution.OnScroll      += Resolution_OnScroll;
            fullscreen                = AddCheckbox(leftPanel, "Fullscreen", "Enable fullscreen", DaggerfallUnity.Settings.Fullscreen);
            fullscreen.OnToggleState += Fullscreen_OnToggleState;
            qualityLevel              = AddSlider(leftPanel, "Quality Level", "General graphic quality", DaggerfallUnity.Settings.QualityLevel, QualitySettings.names);
            qualityLevel.OnScroll    += QualityLevel_OnScroll;
            string[] filterModes = new string[] { "Point", "Bilinear", "Trilinear" };
            mainFilterMode  = AddSlider(leftPanel, "Main Filter", "Filter for game textures", DaggerfallUnity.Settings.MainFilterMode, filterModes);
            guiFilterMode   = AddSlider(leftPanel, "GUI Filter", "Filter for HUD images", DaggerfallUnity.Settings.GUIFilterMode, filterModes);
            videoFilterMode = AddSlider(leftPanel, "Video Filter", "Filter for movies", DaggerfallUnity.Settings.VideoFilterMode, filterModes);

            y = 0;

            // Advanced settings
            AddSectionTitle(rightPanel, "Advanced");
            fovSlider = AddSlider(rightPanel, "Field Of View", "The observable world that is seen at any given moment",
                                  60, 80, DaggerfallUnity.Settings.FieldOfView);
            terrainDistance = AddSlider(rightPanel, "Terrain Distance", "Maximum distance of active terrains from player position",
                                        1, 4, DaggerfallUnity.Settings.TerrainDistance);
            shadowResolutionMode = AddSlider(rightPanel, "Shadow Resolution", "Quality of shadows",
                                             DaggerfallUnity.Settings.ShadowResolutionMode, "Low", "Medium", "High", "Very High");
            dungeonLightShadows  = AddCheckbox(rightPanel, "Dungeon Light Shadows", "Dungeon lights cast shadows", DaggerfallUnity.Settings.DungeonLightShadows);
            interiorLightShadows = AddCheckbox(rightPanel, "Interior Light Shadows", "Interior lights cast shadows", DaggerfallUnity.Settings.InteriorLightShadows);
            useLegacyDeferred    = AddCheckbox(rightPanel, "Use Legacy Deferred", "Legacy rendering path", DaggerfallUnity.Settings.UseLegacyDeferred);
            string textureArrayLabel = "Texture Arrays: ";

            if (!SystemInfo.supports2DArrayTextures)
            {
                textureArrayLabel += "Unsupported";
            }
            else
            {
                textureArrayLabel += DaggerfallUnity.Settings.EnableTextureArrays ? "Enabled" : "Disabled";
            }
            AddInfo(rightPanel, textureArrayLabel, "Improved implementation of terrain textures, with better performance and modding support");
        }
Beispiel #21
0
        private void Setup()
        {
            ControlBase bottomcontainer = new ControlBase(this)
            {
                Margin             = new Margin(0, 0, 0, 0),
                Dock               = Dock.Bottom,
                AutoSizeToContents = true
            };

            _slider = new HorizontalSlider(bottomcontainer)
            {
                Dock  = Dock.Bottom,
                Max   = 1,
                Value = 0
            };
            _slider.ValueChanged += OnSliderValueChanged;
            SetupLeft();
            SetupRight();
            Populate();
        }
Beispiel #22
0
        private Base CreateSliderOption(Base parent, string labelText, float min, float max, float value, string valueStringFormat, int labelMaxWidth, int valueLabelMaxWidth, Action <float> onChange)
        {
            Base b = new Base(parent);

            b.Dock    = Pos.Top;
            b.Padding = new Padding(0, 0, 0, 4);

            Label label = new Label(b);

            label.Text    = labelText;
            label.Dock    = Pos.Left;
            label.Padding = new Padding(0, 0, Math.Max(0, labelMaxWidth - label.Width), 0);

            Label valueLabel = new Label(b);

            valueLabel.Dock = Pos.Right;

            HorizontalSlider slider = new HorizontalSlider(b);

            slider.Dock   = Pos.Fill;
            slider.Height = 20;
            slider.Min    = min;
            slider.Max    = max;
            slider.Value  = value;

            slider.ValueChanged += (s, e) =>
            {
                int prevWidth = valueLabel.Width;
                valueLabel.Text    = slider.Value.ToString(valueStringFormat);
                valueLabel.Padding = new Padding(valueLabel.Padding.Left - (valueLabel.Width - prevWidth), 0, 0, 0);
            };
            slider.ValueChanged += (s, e) => onChange(slider.Value);

            valueLabel.Text    = value.ToString(valueStringFormat);
            valueLabel.Padding = new Padding(Math.Max(0, valueLabelMaxWidth - valueLabel.Width), 0, 0, 0);
            onChange(value);

            b.SizeToChildren();

            return(b);
        }
Beispiel #23
0
        private void Gameplay(Panel leftPanel, Panel rightPanel)
        {
            // Game
            AddSectionTitle(leftPanel, "game");
            startInDungeon        = AddCheckbox(leftPanel, "startInDungeon", DaggerfallUnity.Settings.StartInDungeon);
            randomDungeonTextures = AddSlider(leftPanel, "randomDungeonTextures",
                                              DaggerfallUnity.Settings.RandomDungeonTextures, "classic", "climate", "climateOnly", "random", "randomOnly");
            cameraRecoilStrength = AddSlider(leftPanel, "cameraRecoilStrength",
                                             DaggerfallUnity.Settings.CameraRecoilStrength, "Off", "Low (25%)", "Medium (50%)", "High (75%)", "V. High(100%)");

            // Controls
            AddSectionTitle(leftPanel, "controls");
            mouseSensitivity = AddSlider(leftPanel, "mouseSensitivity", 0.1f, 8.0f, DaggerfallUnity.Settings.MouseLookSensitivity);
            //weaponSensitivity = AddSlider(leftPanel, "weaponSensitivity", 0.1f, 10.0f, DaggerfallUnity.Settings.WeaponSensitivity);
            movementAcceleration  = AddCheckbox(leftPanel, "movementAcceleration", DaggerfallUnity.Settings.MovementAcceleration);
            weaponAttackThreshold = AddTextbox(leftPanel, "weaponAttackThreshold", DaggerfallUnity.Settings.WeaponAttackThreshold.ToString());
            bowDrawback           = AddCheckbox(leftPanel, "bowDrawback", DaggerfallUnity.Settings.BowDrawback);
            toggleSneak           = AddCheckbox(leftPanel, "toggleSneak", DaggerfallUnity.Settings.ToggleSneak);

            y = 0;

            // Audio
            AddSectionTitle(rightPanel, "audio");
            TextBox soundFont = AddTextbox(rightPanel, "soundFont", !string.IsNullOrEmpty(DaggerfallUnity.Settings.SoundFont) ? DaggerfallUnity.Settings.SoundFont : "default");

            soundFont.ReadOnly       = true;
            alternateMusic           = AddCheckbox(rightPanel, "alternateMusic", DaggerfallUnity.Settings.AlternateMusic);
            soundVolume              = AddSlider(rightPanel, "soundVolume", 0, 100, DaggerfallUnity.Settings.SoundVolume * 100);
            soundVolume.DisplayUnits = 100;
            soundVolume.OnScroll    += SoundVolume_OnScroll;
            soundVolume.OnMouseUp   += SoundVolume_OnMouseUp;
            musicVolume              = AddSlider(rightPanel, "musicVolume", 0, 100, DaggerfallUnity.Settings.MusicVolume * 100);
            musicVolume.DisplayUnits = 100;
            musicVolume.OnScroll    += MusicVolume_OnScroll;

            // Spells
            AddSectionTitle(rightPanel, "spells");
            spellLighting = AddCheckbox(rightPanel, "spellLighting", DaggerfallUnity.Settings.EnableSpellLighting);
            spellShadows  = AddCheckbox(rightPanel, "spellShadows", DaggerfallUnity.Settings.EnableSpellShadows);
        }
Beispiel #24
0
        public FlowLayoutTest(ControlBase parent)
            : base(parent)
        {
            ControlBase layout = new DockLayout(this);

            FlowLayout flowLayout = new FlowLayout(layout);

            flowLayout.Width             = 200;
            flowLayout.Padding           = Net.Padding.Five;
            flowLayout.Dock              = Net.Dock.Fill;
            flowLayout.DrawDebugOutlines = true;
            {
                Button    button;
                int       buttonNum   = 1;
                const int buttonCount = 10;

                for (int n = 0; n < buttonCount; n++)
                {
                    button = new Button(flowLayout);
                    button.VerticalAlignment   = Net.VerticalAlignment.Top;
                    button.HorizontalAlignment = Net.HorizontalAlignment.Left;
                    button.Margin  = Net.Margin.Five;
                    button.Padding = Net.Padding.Five;
                    button.ShouldDrawBackground = false;
                    button.Text = String.Format("Button {0}", buttonNum++);
                    button.SetImage("test16.png", ImageAlign.Above);
                }
            }

            HorizontalSlider flowLayoutWidth = new HorizontalSlider(layout);

            flowLayoutWidth.Margin        = Net.Margin.Five;
            flowLayoutWidth.Width         = 500;
            flowLayoutWidth.Dock          = Net.Dock.Top;
            flowLayoutWidth.Min           = 50;
            flowLayoutWidth.Max           = 500;
            flowLayoutWidth.Value         = flowLayout.Width;
            flowLayoutWidth.ValueChanged += (control, args) => { flowLayout.Width = (int)flowLayoutWidth.Value; };
        }
Beispiel #25
0
 public override void SetComponent()
 {
     this.m_lbTitle  = (base.GetControl("LB_Title") as Label);
     this.m_lbCount  = (base.GetControl("LB_NumCount") as Label);
     this.m_lbNotice = (base.GetControl("LB_Notice") as Label);
     this.m_btnClose = (base.GetControl("Button_Exit") as Button);
     this.m_btnClose.AddValueChangedDelegate(new EZValueChangedDelegate(this.CloseForm));
     this.m_btnBuy = (base.GetControl("Button_Sel") as Button);
     this.m_btnBuy.AddValueChangedDelegate(new EZValueChangedDelegate(this.Click_Buy));
     this.m_btnCountMinus = (base.GetControl("Btn_Minus") as Button);
     this.m_btnCountMinus.AddValueChangedDelegate(new EZValueChangedDelegate(this.Click_Minus));
     this.m_btnCountPlus = (base.GetControl("Btn_Plus") as Button);
     this.m_btnCountPlus.AddValueChangedDelegate(new EZValueChangedDelegate(this.Click_Plus));
     this.m_btnCountNum = (base.GetControl("Btn_NumCount") as Button);
     this.m_btnCountNum.AddValueChangedDelegate(new EZValueChangedDelegate(this.Click_Number));
     this.m_hsCount      = (base.GetControl("HSlider_gage") as HorizontalSlider);
     this.m_nlbEquipInfo = (base.GetControl("NLB_EquipmentInfo") as NewListBox);
     this.m_nlbEquipList = (base.GetControl("NLB_EquipmentList") as NewListBox);
     this.m_nlbEquipList.AddValueChangedDelegate(new EZValueChangedDelegate(this.Click_Item));
     base.SetScreenCenter();
     this.Set_Init();
 }
Beispiel #26
0
        public static HorizontalSlider AddSlider(Vector2 position, Action <HorizontalSlider> setIndicator, float textScale = 1, Panel panel = null)
        {
            var slider = new HorizontalSlider();

            slider.Position        = position;
            slider.Size            = new Vector2(80.0f, 4.0f);
            slider.DisplayUnits    = 20;
            slider.BackgroundColor = new Color(0.5f, 0.5f, 0.5f, 0.3f);
            slider.TintColor       = new Color(153, 153, 0);
            if (panel != null)
            {
                panel.Components.Add(slider);
            }

            setIndicator(slider);
            slider.IndicatorOffset                   = 15;
            slider.Indicator.TextScale               = textScale;
            slider.Indicator.TextColor               = Color.white;
            slider.Indicator.ShadowColor             = Color.clear;
            slider.Indicator.HorizontalTextAlignment = TextLabel.HorizontalTextAlignmentSetting.Right;
            return(slider);
        }
        private void Gameplay(Panel leftPanel, Panel rightPanel)
        {
            // Game
            AddSectionTitle(leftPanel, "game");
            startInDungeon        = AddCheckbox(leftPanel, "startInDungeon", DaggerfallUnity.Settings.StartInDungeon);
            randomDungeonTextures = AddSlider(leftPanel, "randomDungeonTextures",
                                              DaggerfallUnity.Settings.RandomDungeonTextures, "classic", "climate", "climateOnly", "random", "randomOnly");
            cameraRecoilStrength = AddSlider(leftPanel, "cameraRecoilStrength",
                                             DaggerfallUnity.Settings.CameraRecoilStrength, "Off", "Low (25%)", "Medium (50%)", "High (75%)", "V. High(100%)");

            // GUI
            AddSectionTitle(leftPanel, "gui");
            crosshair = AddCheckbox(leftPanel, "crosshair", DaggerfallUnity.Settings.Crosshair);
            toolTips  = AddCheckbox(leftPanel, "toolTips", DaggerfallUnity.Settings.EnableToolTips);
            helmAndShieldMaterialDisplay = AddSlider(leftPanel, "helmAndShieldMaterialDisplay",
                                                     DaggerfallUnity.Settings.HelmAndShieldMaterialDisplay, "off", "noLeatChai", "noLeat", "on");
            inventoryInfoPanel = AddCheckbox(leftPanel, "inventoryInfoPanel", DaggerfallUnity.Settings.EnableInventoryInfoPanel); //TODO: better description
            enhancedItemLists  = AddCheckbox(leftPanel, "enhancedItemLists", DaggerfallUnity.Settings.EnableEnhancedItemLists);
            vitalsIndicators   = AddCheckbox(leftPanel, "vitalsIndicators", DaggerfallUnity.Settings.EnableVitalsIndicators);

            y = 0;

            // Controls
            AddSectionTitle(rightPanel, "controls");
            mouseSensitivity      = AddSlider(rightPanel, "mouseSensitivity", 0.1f, 4.0f, DaggerfallUnity.Settings.MouseLookSensitivity);
            weaponSensitivity     = AddSlider(rightPanel, "weaponSensitivity", 0.1f, 10.0f, DaggerfallUnity.Settings.WeaponSensitivity);
            movementAcceleration  = AddSlider(rightPanel, "movementAcceleration", InputManager.minAcceleration, InputManager.maxAcceleration, DaggerfallUnity.Settings.MovementAcceleration);
            weaponAttackThreshold = AddTextbox(rightPanel, "weaponAttackThreshold", DaggerfallUnity.Settings.WeaponAttackThreshold.ToString());

            // Enhancements
            AddSectionTitle(rightPanel, "enhancements");
            gameConsole                   = AddCheckbox(rightPanel, "gameConsole", DaggerfallUnity.Settings.LypyL_GameConsole);
            modSystem                     = AddCheckbox(rightPanel, "modSystem", DaggerfallUnity.Settings.LypyL_ModSystem);
            assetImport                   = AddCheckbox(rightPanel, "assetImport", DaggerfallUnity.Settings.MeshAndTextureReplacement);
            compressModdedTextures        = AddCheckbox(rightPanel, "compressModdedTextures", DaggerfallUnity.Settings.CompressModdedTextures);
            nearDeathWarning              = AddCheckbox(rightPanel, "nearDeathWarning", DaggerfallUnity.Settings.NearDeathWarning);
            alternateRandomEnemySelection = AddCheckbox(rightPanel, "alternateRandomEnemySelection", DaggerfallUnity.Settings.AlternateRandomEnemySelection);
            advancedClimbing              = AddCheckbox(rightPanel, "advancedClimbing", DaggerfallUnity.Settings.AdvancedClimbing);
        }
Beispiel #28
0
        public override void Setup(Panel parent)
        {
            Vector2 pos = settingsStartPos;

            // About this effect
            AddTipPanel(parent, TextManager.Instance.GetLocalizedText("motionBlurTip"));

            // Enable toggle
            enableCheckbox = AddCheckbox(parent, TextManager.Instance.GetLocalizedText("enable"), ref pos);
            enableCheckbox.OnToggleState += EnableCheckbox_OnToggleState;

            // Shutter angle slider
            shutterAngleSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("shutterAngle"), 360, ref pos);
            shutterAngleSlider.OnScroll += ShutterAngleSlider_OnScroll;
            shutterAngleSlider.SetIndicator(0, 360, DaggerfallUnity.Settings.MotionBlurShutterAngle);
            StyleIndicator(shutterAngleSlider);

            // Sample count slider
            sampleCountSlider           = AddSlider(parent, TextManager.Instance.GetLocalizedText("sampleCount"), 32, ref pos);
            sampleCountSlider.OnScroll += SampleCountSlider_OnScroll;
            sampleCountSlider.SetIndicator(4, 32, DaggerfallUnity.Settings.MotionBlurSampleCount);
            StyleIndicator(sampleCountSlider);
        }
Beispiel #29
0
        private void Interface(Panel leftPanel, Panel rightPanel)
        {
            // Tooltips
            AddSectionTitle(leftPanel, "tooltips");
            toolTips = AddCheckbox(leftPanel, "toolTips", DaggerfallUnity.Settings.EnableToolTips);
            toolTipDelayInSeconds = AddSlider(leftPanel, "toolTipDelayInSeconds", 0, 10, DaggerfallUnity.Settings.ToolTipDelayInSeconds);
            toolTipTextColor = AddColorPicker(leftPanel, "toolTipTextColor", DaggerfallUnity.Settings.ToolTipTextColor);
            toolTipBackgroundColor = AddColorPicker(leftPanel, "toolTipBackgroundColor", DaggerfallUnity.Settings.ToolTipBackgroundColor);

            // HUD
            AddSectionTitle(leftPanel, "hud");
            crosshair = AddCheckbox(leftPanel, "crosshair", DaggerfallUnity.Settings.Crosshair);
            vitalsIndicators = AddCheckbox(leftPanel, "vitalsIndicators", DaggerfallUnity.Settings.EnableVitalsIndicators);
            interactionModeIcon = AddSlider(leftPanel, "interactionModeIcon",
                Enum.IsDefined(typeof(InteractionModeIconModes), DaggerfallUnity.Settings.InteractionModeIcon) ? (int)Enum.Parse(typeof(InteractionModeIconModes), DaggerfallUnity.Settings.InteractionModeIcon) : 0,
                Enum.GetNames(typeof(InteractionModeIconModes)));
            arrowCounter = AddCheckbox(leftPanel, "arrowCounter", DaggerfallUnity.Settings.EnableArrowCounter);

            y = 0;

            // GUI
            AddSectionTitle(rightPanel, "gui");
            freeScaling = AddCheckbox(rightPanel, "freeScaling", DaggerfallUnity.Settings.FreeScaling);
            showQuestJournalClocksAsCountdown = AddCheckbox(rightPanel, "showQuestJournalClocksAsCountdown", DaggerfallUnity.Settings.ShowQuestJournalClocksAsCountdown);
            inventoryInfoPanel = AddCheckbox(rightPanel, "inventoryInfoPanel", DaggerfallUnity.Settings.EnableInventoryInfoPanel);
            enhancedItemLists = AddCheckbox(rightPanel, "enhancedItemLists", DaggerfallUnity.Settings.EnableEnhancedItemLists);
            enableModernConversationStyleInTalkWindow = AddCheckbox(rightPanel, "enableModernConversationStyleInTalkWindow", DaggerfallUnity.Settings.EnableModernConversationStyleInTalkWindow);
            iconsPositioningScheme = AddSlider(rightPanel, "iconsPositioningScheme",
                Enum.IsDefined(typeof(IconsPositioningSchemes), DaggerfallUnity.Settings.IconsPositioningScheme) ? (int)Enum.Parse(typeof(IconsPositioningSchemes), DaggerfallUnity.Settings.IconsPositioningScheme) : 0,
                Enum.GetNames(typeof(IconsPositioningSchemes)));
            helmAndShieldMaterialDisplay = AddSlider(rightPanel, "helmAndShieldMaterialDisplay",
                DaggerfallUnity.Settings.HelmAndShieldMaterialDisplay, "off", "noLeatChai", "noLeat", "on");
            geographicBackgrounds = AddCheckbox(rightPanel, "geographicBackgrounds", DaggerfallUnity.Settings.EnableGeographicBackgrounds);
            dungeonExitWagonPrompt = AddCheckbox(rightPanel, "dungeonExitWagonPrompt", DaggerfallUnity.Settings.DungeonExitWagonPrompt);
            loiterLimitInHours = AddSlider(rightPanel, "loiterLimitInHours", 3, 12, DaggerfallUnity.Settings.LoiterLimitInHours);

        }
Beispiel #30
0
        /// <summary>
        /// Add a slider with a numerical indicator.
        /// </summary>
        private HorizontalSlider CreateSlider(string text, int x, int y, float minValue, float maxValue, float startValue)
        {
            Panel sliderPanel = new Panel();

            sliderPanel.Position = new Vector2(x, y);
            sliderPanel.Size     = new Vector2(70.0f, 45);

            TextLabel label = new TextLabel();

            label.Position            = new Vector2(0, 0);
            label.HorizontalAlignment = HorizontalAlignment.Center;
            label.VerticalAlignment   = VerticalAlignment.Top;
            label.ShadowPosition      = Vector2.zero;
            label.Text = text;

            sliderPanel.Components.Add(label);

            Action <HorizontalSlider> setIndicator = ((s) => s.SetIndicator(minValue, maxValue, startValue));
            HorizontalSlider          slider       = DaggerfallUI.AddSlider(new Vector2(0, 6), 70.0f, setIndicator, 0.9f, sliderPanel);

            mainPanel.Components.Add(sliderPanel);

            return(slider);
        }