private void SaveSettings()
        {
            /* GamePlay */

            DaggerfallUnity.Settings.StartInDungeon        = startInDungeon.IsChecked;
            DaggerfallUnity.Settings.RandomDungeonTextures = randomDungeonTextures.ScrollIndex;

            DaggerfallUnity.Settings.Crosshair      = crosshair.IsChecked;
            DaggerfallUnity.Settings.EnableToolTips = toolTips.ScrollIndex != 0;
            DaggerfallUnity.Settings.HQTooltips     = toolTips.ScrollIndex == 2;
            DaggerfallUnity.Settings.HelmAndShieldMaterialDisplay = helmAndShieldMaterialDisplay.ScrollIndex;
            DaggerfallUnity.Settings.EnableInventoryInfoPanel     = inventoryInfoPanel.IsChecked;
            DaggerfallUnity.Settings.EnableEnhancedItemLists      = enhancedItemLists.IsChecked;

            DaggerfallUnity.Settings.MouseLookSensitivity = mouseSensitivity.GetValue();
            DaggerfallUnity.Settings.WeaponSensitivity    = weaponSensitivity.GetValue();
            float weaponAttackThresholdValue;

            if (float.TryParse(weaponAttackThreshold.Text, out weaponAttackThresholdValue))
            {
                DaggerfallUnity.Settings.WeaponAttackThreshold = Mathf.Clamp(weaponAttackThresholdValue, 0.001f, 1.0f);
            }

            DaggerfallUnity.Settings.LypyL_GameConsole         = gameConsole.IsChecked;
            DaggerfallUnity.Settings.LypyL_ModSystem           = modSystem.IsChecked;
            DaggerfallUnity.Settings.MeshAndTextureReplacement = assetImport.IsChecked;
            DaggerfallUnity.Settings.CompressModdedTextures    = compressModdedTextures.IsChecked;

            /* Video */

            if (applyScreenChanges)
            {
                Resolution selectedResolution = Screen.resolutions[resolution.ScrollIndex];
                DaggerfallUnity.Settings.ResolutionWidth  = selectedResolution.width;
                DaggerfallUnity.Settings.ResolutionHeight = selectedResolution.height;
                DaggerfallUnity.Settings.Fullscreen       = fullscreen.IsChecked;
                Screen.SetResolution(selectedResolution.width, selectedResolution.height, fullscreen.IsChecked);

                DaggerfallUnity.Settings.QualityLevel = qualityLevel.ScrollIndex;
                QualitySettings.SetQualityLevel(qualityLevel.ScrollIndex);
            }
            DaggerfallUnity.Settings.MainFilterMode  = mainFilterMode.ScrollIndex;
            DaggerfallUnity.Settings.GUIFilterMode   = guiFilterMode.ScrollIndex;
            DaggerfallUnity.Settings.VideoFilterMode = videoFilterMode.ScrollIndex;

            DaggerfallUnity.Settings.FieldOfView          = fovSlider.Value;
            DaggerfallUnity.Settings.TerrainDistance      = terrainDistance.Value;
            DaggerfallUnity.Settings.ShadowResolutionMode = shadowResolutionMode.ScrollIndex;
            DaggerfallUnity.Settings.DungeonLightShadows  = dungeonLightShadows.IsChecked;
            DaggerfallUnity.Settings.UseLegacyDeferred    = useLegacyDeferred.IsChecked;

            DaggerfallUnity.Settings.SaveSettings();
        }
示例#2
0
        //leaving the window
        private void UpdateUnsavedSettingsToControls()
        {
            //no need to do UnsavedKeybindDict here.. it's already set in the WaitForKeyPress method

            UnsavedSettingsDict["JoystickLookSensitivity"]   = joystickCameraSensitivitySlider.GetValue();
            UnsavedSettingsDict["JoystickCursorSensitivity"] = joystickUIMouseSensitivitySlider.GetValue();
            UnsavedSettingsDict["JoystickMovementThreshold"] = joystickMovementThresholdSlider.GetValue();
            UnsavedSettingsDict["JoystickDeadzone"]          = joystickDeadzoneSlider.GetValue();

            UnsavedSettingsDict["EnableController"]         = enableControllerCheckbox.IsChecked;
            UnsavedSettingsDict["InvertMovementHorizontal"] = invertMovementHorizontalCheckbox.IsChecked;
            UnsavedSettingsDict["InvertMovementVertical"]   = invertMovementVerticalCheckbox.IsChecked;
            UnsavedSettingsDict["InvertCameraHorizontal"]   = invertLookHorizontalCheckbox.IsChecked;
            UnsavedSettingsDict["InvertCameraVertical"]     = invertLookVerticalCheckbox.IsChecked;
        }
示例#3
0
        private void OnUpdateValues()
        {
            DaggerfallUnity.Settings.MouseLookSensitivity  = mouseSensitivitySlider.GetValue();
            DaggerfallUnity.Settings.WeaponSensitivity     = weaponSensitivitySlider.GetValue();
            DaggerfallUnity.Settings.MoveSpeedAcceleration = moveSpeedAccelerationSlider.GetValue();
            DaggerfallUnity.Settings.InvertMouseVertical   = invertMouseVerticalCheckbox.IsChecked;
            DaggerfallUnity.Settings.MouseLookSmoothing    = mouseSmoothingCheckbox.IsChecked;
            DaggerfallUnity.Settings.ClickToAttack         = clickToAttackCheckbox.IsChecked;

            float weaponAttackThresholdValue;

            if (float.TryParse(weaponAttackThresholdTextbox.Text, out weaponAttackThresholdValue))
            {
                DaggerfallUnity.Settings.WeaponAttackThreshold = Mathf.Clamp(weaponAttackThresholdValue, 0.001f, 1.0f);
            }

            DaggerfallUnity.Settings.SaveSettings();

            GameManager.Instance.StartGameBehaviour.ApplyStartSettings();
        }
示例#4
0
        private void SaveSettings()
        {
            /* GamePlay */

            DaggerfallUnity.Settings.StartInDungeon        = startInDungeon.IsChecked;
            DaggerfallUnity.Settings.RandomDungeonTextures = randomDungeonTextures.ScrollIndex;

            DaggerfallUnity.Settings.MouseLookSensitivity = mouseSensitivity.GetValue();
            //DaggerfallUnity.Settings.WeaponSensitivity = weaponSensitivity.GetValue();
            DaggerfallUnity.Settings.MovementAcceleration = movementAcceleration.IsChecked;
            float weaponAttackThresholdValue;

            if (float.TryParse(weaponAttackThreshold.Text, out weaponAttackThresholdValue))
            {
                DaggerfallUnity.Settings.WeaponAttackThreshold = Mathf.Clamp(weaponAttackThresholdValue, 0.001f, 1.0f);
            }
            DaggerfallUnity.Settings.BowDrawback = bowDrawback.IsChecked;
            DaggerfallUnity.Settings.ToggleSneak = toggleSneak.IsChecked;

            DaggerfallUnity.Settings.AlternateMusic = alternateMusic.IsChecked;
            DaggerfallUnity.Settings.SoundVolume    = soundVolume.GetValue() / 100f;
            DaggerfallUnity.Settings.MusicVolume    = musicVolume.GetValue() / 100f;

            DaggerfallUnity.Settings.EnableSpellLighting = spellLighting.IsChecked;
            DaggerfallUnity.Settings.EnableSpellShadows  = spellShadows.IsChecked;

            /* GUI */

            DaggerfallUnity.Settings.EnableToolTips         = toolTips.IsChecked;
            DaggerfallUnity.Settings.ToolTipDelayInSeconds  = toolTipDelayInSeconds.GetValue();
            DaggerfallUnity.Settings.ToolTipTextColor       = toolTipTextColor.BackgroundColor;
            DaggerfallUnity.Settings.ToolTipBackgroundColor = toolTipBackgroundColor.BackgroundColor;

            DaggerfallUnity.Settings.Crosshair              = crosshair.IsChecked;
            DaggerfallUnity.Settings.InteractionModeIcon    = ((InteractionModeIconModes)interactionModeIcon.Value).ToString();
            DaggerfallUnity.Settings.EnableVitalsIndicators = vitalsIndicators.IsChecked;
            DaggerfallUnity.Settings.EnableArrowCounter     = arrowCounter.IsChecked;

            DaggerfallUnity.Settings.FreeScaling = freeScaling.IsChecked;
            DaggerfallUnity.Settings.ShowQuestJournalClocksAsCountdown         = showQuestJournalClocksAsCountdown.IsChecked;
            DaggerfallUnity.Settings.EnableInventoryInfoPanel                  = inventoryInfoPanel.IsChecked;
            DaggerfallUnity.Settings.EnableEnhancedItemLists                   = enhancedItemLists.IsChecked;
            DaggerfallUnity.Settings.EnableModernConversationStyleInTalkWindow = enableModernConversationStyleInTalkWindow.IsChecked;
            DaggerfallUnity.Settings.IconsPositioningScheme       = ((IconsPositioningSchemes)iconsPositioningScheme.Value).ToString();
            DaggerfallUnity.Settings.HelmAndShieldMaterialDisplay = helmAndShieldMaterialDisplay.ScrollIndex;
            DaggerfallUnity.Settings.EnableGeographicBackgrounds  = geographicBackgrounds.IsChecked;
            DaggerfallUnity.Settings.DungeonExitWagonPrompt       = dungeonExitWagonPrompt.IsChecked;
            DaggerfallUnity.Settings.LoiterLimitInHours           = loiterLimitInHours.Value;

            /* Enhancements */

            DaggerfallUnity.Settings.LypyL_GameConsole      = gameConsole.IsChecked;
            DaggerfallUnity.Settings.LypyL_ModSystem        = modSystem.IsChecked;
            DaggerfallUnity.Settings.AssetInjection         = assetInjection.IsChecked;
            DaggerfallUnity.Settings.CompressModdedTextures = compressModdedTextures.IsChecked;

            DaggerfallUnity.Settings.NearDeathWarning = nearDeathWarning.IsChecked;
            DaggerfallUnity.Settings.AlternateRandomEnemySelection = alternateRandomEnemySelection.IsChecked;
            DaggerfallUnity.Settings.CameraRecoilStrength          = cameraRecoilStrength.ScrollIndex;
            DaggerfallUnity.Settings.AdvancedClimbing          = advancedClimbing.IsChecked;
            DaggerfallUnity.Settings.CombatVoices              = combatVoices.IsChecked;
            DaggerfallUnity.Settings.EnemyInfighting           = enemyInfighting.IsChecked;
            DaggerfallUnity.Settings.EnhancedCombatAI          = enhancedCombatAI.IsChecked;
            DaggerfallUnity.Settings.AllowMagicRepairs         = allowMagicRepairs.IsChecked;
            DaggerfallUnity.Settings.InstantRepairs            = instantRepairs.IsChecked;
            DaggerfallUnity.Settings.GuildQuestListBox         = guildQuestListBox.IsChecked;
            DaggerfallUnity.Settings.BowLeftHandWithSwitching  = bowLeftHandWithSwitching.IsChecked;
            DaggerfallUnity.Settings.TravelMapLocationsOutline = travelMapLocationsOutline.IsChecked;

            DaggerfallUnity.Settings.DungeonAmbientLightScale = dungeonAmbientLightScale.GetValue();
            DaggerfallUnity.Settings.NightAmbientLightScale   = nightAmbientLightScale.GetValue();
            DaggerfallUnity.Settings.PlayerTorchLightScale    = playerTorchLightScale.GetValue();
            DaggerfallUnity.Settings.PlayerTorchFromItems     = playerTorchFromItems.IsChecked;

            /* Video */

            if (applyScreenChanges)
            {
                Resolution selectedResolution = resolutions[resolution.ScrollIndex];
                DaggerfallUnity.Settings.ResolutionWidth  = selectedResolution.width;
                DaggerfallUnity.Settings.ResolutionHeight = selectedResolution.height;
                DaggerfallUnity.Settings.Fullscreen       = fullscreen.IsChecked;
                //DaggerfallUnity.Settings.ExclusiveFullscreen = exclusiveFullscreen.IsChecked;

                if (DaggerfallUnity.Settings.ExclusiveFullscreen && DaggerfallUnity.Settings.Fullscreen)
                {
                    Screen.SetResolution(
                        selectedResolution.width,
                        selectedResolution.height,
                        FullScreenMode.ExclusiveFullScreen);
                }
                else
                {
                    Screen.SetResolution(
                        selectedResolution.width,
                        selectedResolution.height,
                        fullscreen.IsChecked);
                }

                DaggerfallUnity.Settings.QualityLevel = qualityLevel.ScrollIndex;
                QualitySettings.SetQualityLevel(qualityLevel.ScrollIndex);
            }
            Application.runInBackground              = DaggerfallUnity.Settings.RunInBackground = runInBackground.IsChecked;
            DaggerfallUnity.Settings.MainFilterMode  = mainFilterMode.ScrollIndex;
            DaggerfallUnity.Settings.GUIFilterMode   = guiFilterMode.ScrollIndex;
            DaggerfallUnity.Settings.VideoFilterMode = videoFilterMode.ScrollIndex;
            DaggerfallUnity.Settings.Antialiasing    = antiAliasingMethod.ScrollIndex;

            DaggerfallUnity.Settings.FieldOfView               = fovSlider.Value;
            DaggerfallUnity.Settings.TerrainDistance           = terrainDistance.Value;
            DaggerfallUnity.Settings.ShadowResolutionMode      = shadowResolutionMode.ScrollIndex;
            DaggerfallUnity.Settings.DungeonLightShadows       = dungeonLightShadows.IsChecked;
            DaggerfallUnity.Settings.InteriorLightShadows      = interiorLightShadows.IsChecked;
            DaggerfallUnity.Settings.ExteriorLightShadows      = exteriorLightShadows.IsChecked;
            DaggerfallUnity.Settings.AmbientLitInteriors       = ambientLitInteriors.IsChecked;
            DaggerfallUnity.Settings.RetroRenderingMode        = retroRenderingMode.ScrollIndex;
            DaggerfallUnity.Settings.PostProcessingInRetroMode = postProcessingInRetroMode.ScrollIndex;

            /* Accessibility */
            DaggerfallUnity.Settings.AutomapTempleColor = automapTempleColor.BackgroundColor;
            DaggerfallUnity.Settings.AutomapShopColor   = automapShopColor.BackgroundColor;
            DaggerfallUnity.Settings.AutomapTavernColor = automapTavernColor.BackgroundColor;
            DaggerfallUnity.Settings.AutomapHouseColor  = automapHouseColor.BackgroundColor;

            DaggerfallUnity.Settings.SaveSettings();
        }
        private void SaveSettings()
        {
            /* GamePlay */

            DaggerfallUnity.Settings.StartInDungeon        = startInDungeon.IsChecked;
            DaggerfallUnity.Settings.RandomDungeonTextures = randomDungeonTextures.ScrollIndex;

            DaggerfallUnity.Settings.MouseLookSensitivity  = mouseSensitivity.GetValue();
            DaggerfallUnity.Settings.WeaponSensitivity     = weaponSensitivity.GetValue();
            DaggerfallUnity.Settings.MoveSpeedAcceleration = movementAcceleration.GetValue();
            float weaponAttackThresholdValue;

            if (float.TryParse(weaponAttackThreshold.Text, out weaponAttackThresholdValue))
            {
                DaggerfallUnity.Settings.WeaponAttackThreshold = Mathf.Clamp(weaponAttackThresholdValue, 0.001f, 1.0f);
            }

            DaggerfallUnity.Settings.SoundVolume = soundVolume.GetValue();
            DaggerfallUnity.Settings.MusicVolume = musicVolume.GetValue();

            DaggerfallUnity.Settings.EnableSpellLighting = spellLighting.IsChecked;
            DaggerfallUnity.Settings.EnableSpellShadows  = spellShadows.IsChecked;

            /* GUI */

            DaggerfallUnity.Settings.EnableToolTips         = toolTips.IsChecked;
            DaggerfallUnity.Settings.ToolTipDelayInSeconds  = toolTipDelayInSeconds.GetValue();
            DaggerfallUnity.Settings.ToolTipTextColor       = toolTipTextColor.BackgroundColor;
            DaggerfallUnity.Settings.ToolTipBackgroundColor = toolTipBackgroundColor.BackgroundColor;

            DaggerfallUnity.Settings.Crosshair              = crosshair.IsChecked;
            DaggerfallUnity.Settings.InteractionModeIcon    = ((InteractionModeIconModes)interactionModeIcon.Value).ToString();
            DaggerfallUnity.Settings.EnableVitalsIndicators = vitalsIndicators.IsChecked;

            DaggerfallUnity.Settings.FreeScaling = freeScaling.IsChecked;
            DaggerfallUnity.Settings.ShowQuestJournalClocksAsCountdown         = showQuestJournalClocksAsCountdown.IsChecked;
            DaggerfallUnity.Settings.EnableInventoryInfoPanel                  = inventoryInfoPanel.IsChecked;
            DaggerfallUnity.Settings.EnableEnhancedItemLists                   = enhancedItemLists.IsChecked;
            DaggerfallUnity.Settings.EnableModernConversationStyleInTalkWindow = enableModernConversationStyleInTalkWindow.IsChecked;
            DaggerfallUnity.Settings.HelmAndShieldMaterialDisplay              = helmAndShieldMaterialDisplay.ScrollIndex;

            /* Enhancements */

            DaggerfallUnity.Settings.LypyL_GameConsole         = gameConsole.IsChecked;
            DaggerfallUnity.Settings.LypyL_ModSystem           = modSystem.IsChecked;
            DaggerfallUnity.Settings.MeshAndTextureReplacement = assetImport.IsChecked;
            DaggerfallUnity.Settings.CompressModdedTextures    = compressModdedTextures.IsChecked;

            DaggerfallUnity.Settings.NearDeathWarning = nearDeathWarning.IsChecked;
            DaggerfallUnity.Settings.AlternateRandomEnemySelection = alternateRandomEnemySelection.IsChecked;
            DaggerfallUnity.Settings.CameraRecoilStrength          = cameraRecoilStrength.ScrollIndex;
            DaggerfallUnity.Settings.AdvancedClimbing = advancedClimbing.IsChecked;
            DaggerfallUnity.Settings.CombatVoices     = combatVoices.IsChecked;
            DaggerfallUnity.Settings.EnemyInfighting  = enemyInfighting.IsChecked;

            DaggerfallUnity.Settings.DungeonAmbientLightScale = dungeonAmbientLightScale.GetValue();
            DaggerfallUnity.Settings.NightAmbientLightScale   = nightAmbientLightScale.GetValue();
            DaggerfallUnity.Settings.PlayerTorchLightScale    = playerTorchLightScale.GetValue();

            /* Video */

            if (applyScreenChanges)
            {
                Resolution selectedResolution = Screen.resolutions[resolution.ScrollIndex];
                DaggerfallUnity.Settings.ResolutionWidth  = selectedResolution.width;
                DaggerfallUnity.Settings.ResolutionHeight = selectedResolution.height;
                DaggerfallUnity.Settings.Fullscreen       = fullscreen.IsChecked;
                Screen.SetResolution(selectedResolution.width, selectedResolution.height, fullscreen.IsChecked);

                DaggerfallUnity.Settings.QualityLevel = qualityLevel.ScrollIndex;
                QualitySettings.SetQualityLevel(qualityLevel.ScrollIndex);
            }
            DaggerfallUnity.Settings.MainFilterMode  = mainFilterMode.ScrollIndex;
            DaggerfallUnity.Settings.GUIFilterMode   = guiFilterMode.ScrollIndex;
            DaggerfallUnity.Settings.VideoFilterMode = videoFilterMode.ScrollIndex;

            DaggerfallUnity.Settings.FieldOfView          = fovSlider.Value;
            DaggerfallUnity.Settings.TerrainDistance      = terrainDistance.Value;
            DaggerfallUnity.Settings.ShadowResolutionMode = shadowResolutionMode.ScrollIndex;
            DaggerfallUnity.Settings.DungeonLightShadows  = dungeonLightShadows.IsChecked;
            DaggerfallUnity.Settings.InteriorLightShadows = interiorLightShadows.IsChecked;
            DaggerfallUnity.Settings.UseLegacyDeferred    = useLegacyDeferred.IsChecked;

            DaggerfallUnity.Settings.SaveSettings();
        }