private void OnSettingsChanged()
 {
     m_comboGraphicsPresets.SelectItemByKey((long)PresetEnum.Custom);
     ReadSettingsFromControls(ref m_settingsNew);
     MyVideoSettingsManager.Apply(m_settingsNew);
     RefreshPresetCombo(m_settingsNew.Render);
 }
Beispiel #2
0
        internal void SetToMediumQuality()
        {
            MyPerformanceSettings settings3 = new MyPerformanceSettings();
            MyRenderSettings1     settings4 = new MyRenderSettings1 {
                AnisotropicFiltering    = MyTextureAnisoFiltering.NONE,
                AntialiasingMode        = MyAntialiasingMode.FXAA,
                ShadowQuality           = MyShadowsQuality.MEDIUM,
                AmbientOcclusionEnabled = true,
                TextureQuality          = MyTextureQuality.MEDIUM,
                ModelQuality            = MyRenderQualityEnum.NORMAL,
                VoxelQuality            = MyRenderQualityEnum.NORMAL,
                GrassDrawDistance       = 160f,
                GrassDensityFactor      = 1f,
                HqDepth                  = true,
                VoxelShaderQuality       = MyRenderQualityEnum.NORMAL,
                AlphaMaskedShaderQuality = MyRenderQualityEnum.NORMAL,
                AtmosphereShaderQuality  = MyRenderQualityEnum.NORMAL,
                DistanceFade             = 100f
            };

            settings3.RenderSettings      = settings4;
            settings3.EnableDamageEffects = true;
            MyGraphicsSettings currentGraphicsSettings = MyVideoSettingsManager.CurrentGraphicsSettings;

            currentGraphicsSettings.PerformanceSettings = settings3;
            MyVideoSettingsManager.Apply(currentGraphicsSettings);
            MyVideoSettingsManager.SaveCurrentSettings();
        }
 public void OnOkClick(MyGuiControlButton sender)
 {
     //  Update NEW settings
     if (ReadSettingsFromControls(ref m_settingsNew))
     {
         MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox(
                                    buttonType: MyMessageBoxButtonsType.OK,
                                    messageText: MyTexts.Get(MySpaceTexts.MessageBoxTextRestartNeededAfterRendererSwitch),
                                    messageCaption: MyTexts.Get(MyCommonTexts.MessageBoxCaptionWarning)));
     }
     MyVideoSettingsManager.Apply(m_settingsNew);
     MyVideoSettingsManager.SaveCurrentSettings();
     CloseScreen();
 }
Beispiel #4
0
        public void OnOkClick(MyGuiControlButton sender)
        {
            //  Update NEW settings
            bool somethingChanged = ReadSettingsFromControls(ref m_settingsNew);

            //  Change video mode to new one
            if (somethingChanged)
            {
                OnVideoModeChangedAndConfirm(MyVideoSettingsManager.Apply(m_settingsNew));
            }
            else
            {
                CloseScreen();
            }
        }
Beispiel #5
0
        public override bool Draw()
        {
            if (!base.Draw())
            {
                return(false);
            }

            if (m_doRevert)
            {
                //  Revert changes - setting new video resolution must be done from Draw call, because when called
                //  from Update while game isn't active (alt-tabed or minimized) it will fail on weird XNA exceptions
                OnVideoModeChanged(MyVideoSettingsManager.Apply(m_settingsOld));
                m_doRevert = false;
            }

            return(true);
        }
        private void OnPresetSelected()
        {
            var preset = (PresetEnum)m_comboGraphicsPresets.GetSelectedKey();

            if (preset == PresetEnum.Custom)
            {
                return;
            }

            var presetSettings = m_presets[(int)preset];

            presetSettings.MultithreadingEnabled = m_checkboxMultithreadedRender.IsChecked;
            presetSettings.InterpolationEnabled  = m_checkboxRenderInterpolation.IsChecked;
            m_settingsNew.Render = presetSettings;
            WriteSettingsToControls(m_settingsNew);
            MyVideoSettingsManager.Apply(m_settingsNew);
        }
        public static string ChangeFOV(List <string> arg)
        {
            if (arg.Count < 1)
            {
                return("not enough arguments!");
            }

            float fovSetting;

            if (float.TryParse(arg[0], out fovSetting))
            {
                var currentsettings = MyVideoSettingsManager.CurrentGraphicsSettings;
                currentsettings.FieldOfView = MathHelper.ToRadians(fovSetting);
                MyVideoSettingsManager.Apply(currentsettings);
                MyVideoSettingsManager.SaveCurrentSettings();
                return($"Set FOV to: {fovSetting}");
            }

            return("Invalid input!");
        }
 public void OnCancelClick(MyGuiControlButton sender)
 {
     MyVideoSettingsManager.Apply(m_settingsOld);
     MyVideoSettingsManager.SaveCurrentSettings();
     CloseScreen();
 }