Esempio n. 1
0
        public void InitializeEntries()
        {
            var dropdown = GetComponent <Dropdown>();

            dropdown.options.Clear();
            int selected = 0;
            int i        = 0;

            foreach (var res in Screen.resolutions)
            {
                if (res.width == GameOption.Get <GraphicOption>().width&& res.height == GameOption.Get <GraphicOption>().height)
                {
                    if (!dropdown.options.Any(o => o.text == res.refreshRate.ToString()))
                    {
                        dropdown.options.Add(new Dropdown.OptionData(res.refreshRate.ToString()));
                    }

                    if (GameOption.Get <GraphicOption>().refreshRate == res.refreshRate)
                    {
                        selected = i;
                    }

                    i++;
                }
            }
            dropdown.SetValueWithoutNotify(selected);
        }
Esempio n. 2
0
        public void InitializeEntries()
        {
            var dropdown = GetComponent <Dropdown>();

            dropdown.options.Clear();
            int selected = 0;
            int i        = 0;

            foreach (var res in Screen.resolutions.OrderByDescending(o => o.width))
            {
                string option = $"{res.width}x{res.height}";

                if (!dropdown.options.Any(o => o.text == option))
                {
                    dropdown.options.Add(new Dropdown.OptionData(option));
                    if (res.width == GameOption.Get <GraphicOption>().width&& res.height == GameOption.Get <GraphicOption>().height)
                    {
                        selected = i;
                    }
                    i++;
                }
            }

            dropdown.SetValueWithoutNotify(selected);

            if (dropDownRefreshRate != null)
            {
                dropDownRefreshRate.InitializeEntries();
            }
        }
Esempio n. 3
0
        void UpdateOptions(int value)
        {
            string option = GetComponent <Dropdown>().options[value].text;

            string[] values = option.Split('x');
            GameOption.Get <GraphicOption>().width  = int.Parse(values[0]);
            GameOption.Get <GraphicOption>().height = int.Parse(values[1]);
        }
        void UpdateOptions(int value)
        {
            int val = Percentages[value];

            GameOption.Get <SpaceshipOptions>().screenPercentage = val;

            upsamplingDropdown.interactable = (val < 100);
            upsamplingDropdown.captionText.CrossFadeAlpha(val == 100 ? 0.1f : 1.0f, upsamplingDropdown.colors.fadeDuration, true);
        }
 void UpdateOptions(int value)
 {
     GameOption.Get <GraphicOption>().fullScreenMode = (FullScreenMode)value;
     if (refreshRateDropdown != null)
     {
         refreshRateDropdown.interactable = (value == 0);
         refreshRateDropdown.captionText.CrossFadeAlpha(value > 0 ? 0.1f : 1.0f, refreshRateDropdown.colors.fadeDuration, true);
     }
 }
 public void InitializeEntries(Dropdown dropdown)
 {
     dropdown.options.Clear();
     dropdown.options.Add(new Dropdown.OptionData("Full Screen (Exclusive)"));
     dropdown.options.Add(new Dropdown.OptionData("Full Screen (Windowed)"));
     dropdown.options.Add(new Dropdown.OptionData("Maximized Window"));
     dropdown.options.Add(new Dropdown.OptionData("Window"));
     dropdown.SetValueWithoutNotify((int)GameOption.Get <GraphicOption>().fullScreenMode);
 }
Esempio n. 7
0
        public void InitializeEntries(Dropdown dropdown)
        {
            dropdown.options.Clear();
            foreach (var framerate in TargetFramerates)
            {
                dropdown.options.Add(new Dropdown.OptionData(framerate == -1? InfiniteText : framerate.ToString()));
            }

            int current = GameOption.Get <GraphicOption>().targetFrameRate;

            dropdown.SetValueWithoutNotify(dropdown.options.FindIndex(o => o.text == current.ToString()));
        }
        public void InitializeEntries(Dropdown dropdown)
        {
            dropdown.options.Clear();
            foreach (var label in Labels)
            {
                dropdown.options.Add(new Dropdown.OptionData(label));
            }

            int current = (int)GameOption.Get <SpaceshipOptions>().fpsKeyboardScheme;

            dropdown.SetValueWithoutNotify(current);
        }
        public void InitializeEntries(Dropdown dropdown)
        {
            dropdown.options.Clear();
            foreach (var percentage in Percentages)
            {
                dropdown.options.Add(new Dropdown.OptionData($"{percentage}% {(percentage == 100?"(Native)":"")}"));
            }

            int current = GameOption.Get <SpaceshipOptions>().screenPercentage;

            dropdown.SetValueWithoutNotify(Percentages.ToList().FindIndex(o => o == current));
        }
Esempio n. 10
0
        public void InitializeEntries(Dropdown dropdown)
        {
            dropdown.options.Clear();

            foreach (var quality in QualitySettings.names)
            {
                dropdown.options.Add(new Dropdown.OptionData(quality));
            }

            int current = GameOption.Get <GraphicOption>().quality;

            dropdown.SetValueWithoutNotify(current);
        }
        void UpdateOptions(int value)
        {
            SpaceshipOptions.UpsamplingMethod val = (SpaceshipOptions.UpsamplingMethod)value;

            if (val == SpaceshipOptions.UpsamplingMethod.TAAU)
            {
                GameOption.Get <HDRPCameraOption>().antiAliasing = HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing;

                // Force Refresh
                if (antiAliasingDropdown != null)
                {
                    antiAliasingDropdown.enabled = false;
                    antiAliasingDropdown.enabled = true;
                }
            }

            GameOption.Get <SpaceshipOptions>().upsamplingMethod = val;
        }
        private void OnEnable()
        {
            var slider = GetComponent <Slider>();

            slider.onValueChanged.AddListener(UpdateOptions);

            if (LogarithmicScale)
            {
                slider.minValue = 0.0f;
                slider.maxValue = 1.0f;
            }
            else
            {
                slider.minValue = MinMaxSliderValue.x;
                slider.maxValue = MinMaxSliderValue.y;
            }

            slider.wholeNumbers = IntegerSliderValues;
            slider.SetValueWithoutNotify(ParameterToSlider(GameOption.Get <AudioOption>().GetParameter(Parameter)));
        }
        public void InitializeEntries(Dropdown dropdown)
        {
            dropdown.options.Clear();
            foreach (var method in Methods)
            {
                if (!method.Contains("DLSS"))
                {
                    dropdown.options.Add(new Dropdown.OptionData(method));
                }
                else
                {
                    // Add DLSS only if supported
                    if (HDDynamicResolutionPlatformCapabilities.DLSSDetected)
                    {
                        dropdown.options.Add(new Dropdown.OptionData(method));
                    }
                }
            }

            int current = (int)GameOption.Get <SpaceshipOptions>().upsamplingMethod;

            dropdown.SetValueWithoutNotify(current);
        }
Esempio n. 14
0
 void UpdateOptions(float value)
 {
     GameOption.Get <GraphicOption>().targetFrameRate = (int)value;
 }
Esempio n. 15
0
 void InitializeEntries(Slider slider)
 {
     slider.value = GameOption.Get <GraphicOption>().targetFrameRate;
 }
Esempio n. 16
0
 void UpdateOptions(int value)
 {
     GameOption.Get <GraphicOption>().targetFrameRate = TargetFramerates[value];
 }
 void UpdateOptions(float value)
 {
     GameOption.Get <AudioOption>().SetParameter(Parameter, SliderToParameter(value), ApplyParameter);
 }
Esempio n. 18
0
 void UpdateOptions(bool value)
 {
     GameOption.Get <GraphicOption>().vSync = value;
     UpdateTargetFramerate(value);
 }
Esempio n. 19
0
 public void InitializeEntries()
 {
     GetComponent <Toggle>().isOn = GameOption.Get <GraphicOption>().vSync;
 }
 void UpdateOptions(int value)
 {
     GameOption.Get <SpaceshipOptions>().fpsKeyboardScheme = (SpaceshipOptions.FPSKeyboardScheme)value;
 }
Esempio n. 21
0
 void UpdateOptions(int value)
 {
     GameOption.Get <GraphicOption>().refreshRate = int.Parse(GetComponent <Dropdown>().options[value].text);
 }
Esempio n. 22
0
 private void OnEnable()
 {
     InitializeEntries();
     GetComponent <Toggle>().onValueChanged.AddListener(UpdateOptions);
     UpdateTargetFramerate(GameOption.Get <GraphicOption>().vSync);
 }
Esempio n. 23
0
 void UpdateOptions(int value)
 {
     GameOption.Get <GraphicOption>().quality = value;
 }