public static void Save() { Debug.Log("Saving Preferences"); PlayerPrefs.SetInt("Preset_v16", PlayerPreferences.Preset); PlayerPrefs.SetInt("LowMemoryMode", (!PlayerPreferences.LowMemoryMode) ? 0 : 1); PlayerPrefs.SetFloat("Brightness", PlayerPreferences.Brightness); PlayerPrefs.SetFloat("Volume", PlayerPreferences.Volume); PlayerPrefs.SetFloat("MusicVolume", PlayerPreferences.MusicVolume); PlayerPrefs.SetInt("VoiceCount", PlayerPreferences.VoiceCount); PlayerPrefs.SetInt("MouseInvert", (!PlayerPreferences.MouseInvert) ? 0 : 1); PlayerPrefs.SetFloat("MouseSensitivity", PlayerPreferences.MouseSensitivity); PlayerPrefs.SetFloat("Fov", PlayerPreferences.Fov); PlayerPrefs.SetInt("ColorGrading", PlayerPreferences.ColorGrading); TheForestQualitySettings.Save(); PlayerPrefs.SetInt("VSync", (!PlayerPreferences.VSync) ? 0 : 1); PlayerPrefs.SetInt("ShowHud", (!PlayerPreferences.ShowHud) ? 0 : 1); PlayerPrefs.SetInt("ShowOverlayIcons", (!PlayerPreferences.ShowOverlayIcons) ? 0 : 1); PlayerPrefs.SetInt("ShowProjectileReticle", (!PlayerPreferences.ShowProjectileReticle) ? 0 : 1); PlayerPrefs.SetInt("UseXInput", (!PlayerPreferences.UseXInput) ? 0 : 1); PlayerPrefs.SetInt("ShowPlayerNamesMP", (!PlayerPreferences.ShowPlayerNamesMP) ? 0 : 1); PlayerPrefs.SetInt("ShowStealthMeter", (!PlayerPreferences.ShowStealthMeter) ? 0 : 1); PlayerPrefs.SetInt("MaxFrameRate2", PlayerPreferences.MaxFrameRate); PlayerPrefs.SetInt("UseCrouchToggle", (!PlayerPreferences.UseCrouchToggle) ? 0 : 1); PlayerPrefs.Save(); }
public static void Load() { Debug.Log("PlayerPreferences.Load"); if (PlayerPreferences.alreadyLoaded) { return; } PlayerPreferences.Preset = ((!CoopPeerStarter.DedicatedHost) ? PlayerPrefs.GetInt("Preset_v16", PlayerPreferences.Preset) : 5); PlayerPreferences.LowMemoryMode = (PlayerPrefs.GetInt("LowMemoryMode", 0) > 0); PlayerPreferences.MemorySafeSaveMode = (PlayerPrefs.GetInt("MemorySafeSaveMode", 0) > 0); PlayerPreferences.GammaWorldAndDay = PlayerPrefs.GetFloat("GammaWorldAndDay", 2f); PlayerPreferences.GammaCavesAndNight = PlayerPrefs.GetFloat("GammaCavesAndNight", 2f); PlayerPreferences.Contrast = PlayerPrefs.GetFloat("Contrast", 1f); PlayerPreferences.Volume = PlayerPrefs.GetFloat("Volume", 0.5f); PlayerPreferences.MusicVolume = PlayerPrefs.GetFloat("MusicVolume", 1f); PlayerPreferences.MicrophoneVolume = PlayerPrefs.GetFloat("MicrophoneVolume", 5f); PlayerPreferences.VoiceCount = PlayerPrefs.GetInt("VoiceCount", 128); PlayerPreferences.MouseInvert = (PlayerPrefs.GetInt("MouseInvert", 0) > 0); PlayerPreferences.MouseSensitivityX = PlayerPrefs.GetFloat("MouseSensitivity", 0.5f); PlayerPreferences.MouseSensitivityY = PlayerPrefs.GetFloat("MouseSensitivityY", PlayerPrefs.GetFloat("MouseSensitivity", 0.5f)); PlayerPreferences.MouseSmoothing = PlayerPrefs.GetFloat("MouseSmoothing2", 0.1f); PlayerPreferences.Fov = PlayerPrefs.GetFloat("Fov", 75f); PlayerPreferences.MaxFrameRate = PlayerPrefs.GetInt("MaxFrameRate2", -1); PlayerPreferences.ApplyMaxFrameRate(); PlayerPreferences.SetLowQualityPhysics(PlayerPrefs.GetInt("LowQualityPhysics", 0) > 0); PlayerPreferences.Language = PlayerPrefs.GetString("Language", "English"); PlayerPreferences.SetGhostTint(PlayerPrefs.GetInt("GhostTint", 0), PlayerPrefs.GetFloat("GhostTintOpacity", 0.0784f)); PlayerPreferences.ColorGrading = PlayerPrefs.GetInt("ColorGrading", 0); PlayerPreferences.VSync = (PlayerPrefs.GetInt("VSync", QualitySettings.vSyncCount) > 0); PlayerPreferences.ShowHud = (PlayerPrefs.GetInt("ShowHud", 1) > 0); PlayerPreferences.ShowOverlayIcons = (PlayerPrefs.GetInt("ShowOverlayIcons", 1) > 0); PlayerPreferences.OverlayIconsGrouping = (PlayerPrefs.GetInt("OverlayIconsGroupingV2", 1) > 0); PlayerPreferences.ShowProjectileReticle = (PlayerPrefs.GetInt("ShowProjectileReticle", 1) > 0); PlayerPreferences.UseXInput = (PlayerPrefs.GetInt("UseXInputV2", 1) > 0); PlayerPreferences.ShowPlayerNamesMP = (PlayerPrefs.GetInt("ShowPlayerNamesMP", 1) > 0); PlayerPreferences.ShowStealthMeter = (PlayerPrefs.GetInt("ShowStealthMeter", 1) > 0); PlayerPreferences.UseCrouchToggle = (PlayerPrefs.GetInt("UseCrouchToggle", 0) > 0); PlayerPreferences.UseSprintToggle = (PlayerPrefs.GetInt("UseSprintToggle", 0) > 0); PlayerPreferences.UseGamepadRumble = (PlayerPrefs.GetInt("UseGamepadRumble", 1) > 0); if (!CoopPeerStarter.DedicatedHost) { PlayerPreferences.TreeRegrowthLocal = (PlayerPrefs.GetInt("TreeRegrowth", 0) > 0); PlayerPreferences.NoDestructionLocal = (PlayerPrefs.GetInt("NoDestruction", 0) > 0); PlayerPreferences.AllowEnemiesCreative = (PlayerPrefs.GetInt("AllowEnemiesCreative", 0) > 0); PlayerPreferences.CheatsAllowed = (PlayerPrefs.GetInt("CheatsAllowed", 0) > 0); } PlayerPreferences.ExWallAutofill = (PlayerPrefs.GetInt("ExWallAutofill", 1) > 0); PlayerPreferences.ExFloorsAutofill = (PlayerPrefs.GetInt("ExFloorsAutofill", 1) > 0); if (!TheForestQualitySettings.Load()) { TheForestQualitySettings.CopyPreset(-1); } QualitySettings.SetQualityLevel((int)TheForestQualitySettings.UserSettings.ShadowLevel); if (!TheForestQualitySettings.Load()) { TheForestQualitySettings.CopyPreset(-1); } PlayerPreferences.ApplyValues(); PlayerPreferences.alreadyLoaded = true; }
public static void CopyPreset(int level = -1) { if (level < 0) { level = PlayerPreferences.Preset; } TheForestQualitySettings.Copy(TheForestQualitySettings.GetPreset(level), TheForestQualitySettings.UserSettings); }
public static void Save() { if (PlayerPreferences.PreventSaving) { return; } UnityEngine.Debug.Log("Saving Preferences"); PlayerPrefs.SetInt("Preset_v16", PlayerPreferences.Preset); PlayerPrefs.SetInt("LowMemoryMode", (!PlayerPreferences.LowMemoryMode) ? 0 : 1); PlayerPrefs.SetInt("MemorySafeSaveMode", (!PlayerPreferences.MemorySafeSaveMode) ? 0 : 1); PlayerPrefs.SetFloat("GammaCavesAndNight", PlayerPreferences.GammaCavesAndNight); PlayerPrefs.SetFloat("GammaWorldAndDay", PlayerPreferences.GammaWorldAndDay); PlayerPrefs.SetFloat("Contrast", PlayerPreferences.Contrast); if (ForestVR.Enabled) { PlayerPrefs.SetString((!ForestVR.Enabled) ? "AudioDriver" : "AudioDriverVR", PlayerPreferences.AudioDriver); } PlayerPrefs.SetFloat("Volume", PlayerPreferences.Volume); PlayerPrefs.SetFloat("MusicVolume", PlayerPreferences.MusicVolume); PlayerPrefs.SetFloat("MicrophoneVolume", PlayerPreferences.MicrophoneVolume); PlayerPrefs.SetInt("VoiceCount", PlayerPreferences.VoiceCount); PlayerPrefs.SetInt("MouseInvert", (!PlayerPreferences.MouseInvert) ? 0 : 1); PlayerPrefs.SetFloat("MouseSensitivity", PlayerPreferences.MouseSensitivityX); PlayerPrefs.SetFloat("MouseSensitivityY", PlayerPreferences.MouseSensitivityY); PlayerPrefs.SetFloat("MouseSmoothing2", PlayerPreferences.MouseSmoothing); PlayerPrefs.SetFloat("Fov", PlayerPreferences.Fov); PlayerPrefs.SetInt("GhostTint", PlayerPreferences.GhostTintNum); PlayerPrefs.SetFloat("GhostTintOpacity", PlayerPreferences.GhostTintOpacity); PlayerPrefs.SetInt("ColorGrading", PlayerPreferences.ColorGrading); TheForestQualitySettings.Save(); PlayerPrefs.SetInt("VSync", (!PlayerPreferences.VSync) ? 0 : 1); PlayerPrefs.SetInt("ShowHud", (!PlayerPreferences.ShowHud) ? 0 : 1); PlayerPrefs.SetInt("ShowOverlayIcons", (!PlayerPreferences.ShowOverlayIcons) ? 0 : 1); PlayerPrefs.SetInt("OverlayIconsGroupingV2", (!PlayerPreferences.OverlayIconsGrouping) ? 0 : 1); PlayerPrefs.SetInt("ShowProjectileReticle", (!PlayerPreferences.ShowProjectileReticle) ? 0 : 1); PlayerPrefs.SetInt("UseXInputV2", (!PlayerPreferences.UseXInput) ? 0 : 1); PlayerPrefs.SetInt("ShowPlayerNamesMP", (!PlayerPreferences.ShowPlayerNamesMP) ? 0 : 1); PlayerPrefs.SetInt("ShowStealthMeter", (!PlayerPreferences.ShowStealthMeter) ? 0 : 1); PlayerPrefs.SetInt("MaxFrameRate2", PlayerPreferences.MaxFrameRate); PlayerPrefs.SetInt("LowQualityPhysics", (!PlayerPreferences.LowQualityPhysics) ? 0 : 1); PlayerPrefs.SetString("Language", PlayerPreferences.Language); PlayerPrefs.SetInt("UseCrouchToggle", (!PlayerPreferences.UseCrouchToggle) ? 0 : 1); PlayerPrefs.SetInt("UseSprintToggle", (!PlayerPreferences.UseSprintToggle) ? 0 : 1); PlayerPrefs.SetInt("UseGamepadRumble", (!PlayerPreferences.UseGamepadRumble) ? 0 : 1); PlayerPrefs.SetInt("TreeRegrowth", (!PlayerPreferences.TreeRegrowthLocal) ? 0 : 1); PlayerPrefs.SetInt("NoDestruction", (!PlayerPreferences.NoDestructionLocal) ? 0 : 1); PlayerPrefs.SetInt("CheatsAllowed", (!PlayerPreferences.CheatsAllowed) ? 0 : 1); PlayerPrefs.SetInt("AllowEnemiesCreative", (!PlayerPreferences.AllowEnemiesCreative) ? 0 : 1); PlayerPrefs.SetInt("VRTurnSnap", PlayerPreferences.VRTurnSnap); PlayerPrefs.SetInt("VRMoveDarkening", (int)PlayerPreferences.VRMoveDarkening); PlayerPrefs.SetInt("VRAntiAliasing", (int)PlayerPreferences.VRAntiAliasing); PlayerPrefs.SetInt("VRUsePhysicalCrouching", (!PlayerPreferences.VRUsePhysicalCrouching) ? 0 : 1); PlayerPrefs.SetInt("VRForwardMovement", (int)PlayerPreferences.VRForwardMovement); PlayerPrefs.SetInt("VRAutoRun", (!PlayerPreferences.VRAutoRun) ? 0 : 1); PlayerPrefs.SetInt("VRUseRightHandedBow", (!PlayerPreferences.VRUseRightHandedBow) ? 0 : 1); PlayerPrefs.SetInt("VRUseRightHandedWeapon", (!PlayerPreferences.VRUseRightHandedWeapon) ? 0 : 1); PlayerPrefs.Save(); }
public static bool Load() { bool flag = TheForestQualitySettings.HasSavedSettings(); if (flag) { int @int = PlayerPrefs.GetInt("Quality_v016_Version", 35); TheForestQualitySettings.UserSettings.Preset = (TheForestQualitySettings.PresetLevels)PlayerPrefs.GetInt("Quality_v016_Preset", (int)TheForestQualitySettings.UserSettings.Preset); int num = PlayerPrefs.GetInt("Quality_v016_CascadeCount", (int)TheForestQualitySettings.UserSettings.CascadeCount); int num2 = PlayerPrefs.GetInt("Quality_v016_ShadowLevel", (int)TheForestQualitySettings.UserSettings.ShadowLevel); if (@int < 35) { num2++; } if (PlayerPreferences.is32bit) { num = Mathf.Max(num, 1); num2 = Mathf.Max(num, 1); } TheForestQualitySettings.UserSettings.CascadeCount = (TheForestQualitySettings.ShadowCascadeCount)num; TheForestQualitySettings.UserSettings.ShadowLevel = (TheForestQualitySettings.ShadowLevels)num2; TheForestQualitySettings.UserSettings.FarShadowMode = (TheForestQualitySettings.FarShadowModes)PlayerPrefs.GetInt("Quality_v016_FarShadowMode", (int)TheForestQualitySettings.UserSettings.FarShadowMode); TheForestQualitySettings.UserSettings.MotionBlur = (TheForestQualitySettings.MotionBlurQuality)PlayerPrefs.GetInt("Quality_v016_MotionBlur", (int)TheForestQualitySettings.UserSettings.MotionBlur); TheForestQualitySettings.UserSettings.DrawDistance = (TheForestQualitySettings.DrawDistances)Mathf.Clamp(PlayerPrefs.GetInt("Quality_v016_DrawDistance", (int)TheForestQualitySettings.UserSettings.DrawDistance), 1, 5); TheForestQualitySettings.UserSettings.GrassMode = (TheForestQualitySettings.GrassModes)PlayerPrefs.GetInt("Quality_v016_GrassMode", (int)TheForestQualitySettings.UserSettings.GrassMode); TheForestQualitySettings.UserSettings.GrassDistance = PlayerPrefs.GetFloat("Quality_v016_GrassDistance", TheForestQualitySettings.UserSettings.GrassDistance); TheForestQualitySettings.UserSettings.GrassDensity = PlayerPrefs.GetFloat("Quality_v016_GrassDensity", TheForestQualitySettings.UserSettings.GrassDensity); TheForestQualitySettings.UserSettings.SSAOType = (TheForestQualitySettings.SSAOTypes)PlayerPrefs.GetInt("Quality_v016_SSAOType", (int)TheForestQualitySettings.UserSettings.SSAOType); TheForestQualitySettings.UserSettings.SSAO = (TheForestQualitySettings.SSAOTechnique)PlayerPrefs.GetInt("Quality_v016_SSAO", (int)TheForestQualitySettings.UserSettings.SSAO); TheForestQualitySettings.UserSettings.SEBloom = (TheForestQualitySettings.SEBloomTechnique)PlayerPrefs.GetInt("Quality_v016_SEBloom", (int)TheForestQualitySettings.UserSettings.SEBloom); TheForestQualitySettings.UserSettings.CA = (TheForestQualitySettings.ChromaticAberration)PlayerPrefs.GetInt("Quality_v016_CA", (int)TheForestQualitySettings.UserSettings.CA); TheForestQualitySettings.UserSettings.Fg = (TheForestQualitySettings.FilmGrain)PlayerPrefs.GetInt("Quality_v016_Fg", (int)TheForestQualitySettings.UserSettings.Fg); TheForestQualitySettings.UserSettings.DofTech = (TheForestQualitySettings.Dof)PlayerPrefs.GetInt("Quality_v016_DofTech", (int)TheForestQualitySettings.UserSettings.DofTech); TheForestQualitySettings.UserSettings.screenSpaceReflection = (TheForestQualitySettings.ScreenSpaceReflection)PlayerPrefs.GetInt("Quality_v016_ScreenSpaceReflection", (int)TheForestQualitySettings.UserSettings.screenSpaceReflection); TheForestQualitySettings.UserSettings.volumetricClouds = (TheForestQualitySettings.VolumetricClouds)PlayerPrefs.GetInt("Quality_v016_VolumetricClouds", (int)TheForestQualitySettings.UserSettings.volumetricClouds); TheForestQualitySettings.UserSettings.SunshineOcclusion = (TheForestQualitySettings.SunshineOcclusionOn)PlayerPrefs.GetInt("Quality_v016_SunshineOcclusion", (int)TheForestQualitySettings.UserSettings.SunshineOcclusion); TheForestQualitySettings.UserSettings.VolumetricsType = (TheForestQualitySettings.VolumetricsTypes)PlayerPrefs.GetInt("Quality_v016_VolumetricsType", (int)TheForestQualitySettings.UserSettings.VolumetricsType); TheForestQualitySettings.UserSettings.PostEffectsSystem = (TheForestQualitySettings.PostEffectsSystems)PlayerPrefs.GetInt("Quality_v016_PostEffectsSystem", (int)TheForestQualitySettings.UserSettings.PostEffectsSystem); TheForestQualitySettings.UserSettings.Caustics = (TheForestQualitySettings.CausticsOn)PlayerPrefs.GetInt("Quality_v016_Caustics", (int)TheForestQualitySettings.UserSettings.Caustics); TheForestQualitySettings.UserSettings.AntiAliasing = (TheForestQualitySettings.AntiAliasingTechnique)PlayerPrefs.GetInt("Quality_v016_AntiAliasing", (int)TheForestQualitySettings.UserSettings.AntiAliasing); TheForestQualitySettings.UserSettings.LightmapResolution = PlayerPrefs.GetInt("Quality_v016_LightmapResolution", TheForestQualitySettings.UserSettings.LightmapResolution); TheForestQualitySettings.UserSettings.LightDistance = PlayerPrefs.GetFloat("Quality_v016_LightDistance", TheForestQualitySettings.UserSettings.LightDistance); TheForestQualitySettings.UserSettings.LightmapUpdateIntervalFrames = PlayerPrefs.GetInt("Quality_v016_LightmapUpdateIntervalFrames", TheForestQualitySettings.UserSettings.LightmapUpdateIntervalFrames); TheForestQualitySettings.UserSettings.ScatterResolution = (SunshineRelativeResolutions)PlayerPrefs.GetInt("Quality_v016_ScatterResolution", (int)TheForestQualitySettings.UserSettings.ScatterResolution); TheForestQualitySettings.UserSettings.ScatterSamplingQuality = (SunshineScatterSamplingQualities)PlayerPrefs.GetInt("Quality_v016_ScatterSamplingQuality", (int)TheForestQualitySettings.UserSettings.ScatterSamplingQuality); TheForestQualitySettings.UserSettings.SetTerrainQuality((TheForestQualitySettings.TerrainQualities)PlayerPrefs.GetInt("Quality_v016_TerrainQuality", (int)TheForestQualitySettings.UserSettings.TerrainQuality)); TheForestQualitySettings.UserSettings.ReflexionMode = (TheForestQualitySettings.ReflexionModes)PlayerPrefs.GetInt("Quality_v016_ReflexionMode", (int)TheForestQualitySettings.UserSettings.ReflexionMode); TheForestQualitySettings.UserSettings.OceanQuality = (TheForestQualitySettings.OceanQualities)PlayerPrefs.GetInt("Quality_v016_OceanQuality", 0); TheForestQualitySettings.UserSettings.SetTextureQuality((TheForestQualitySettings.TextureQualities)PlayerPrefs.GetInt("Quality_v016_TextureQuality", 0)); TheForestQualitySettings.UserSettings.SetMaterialQuality((TheForestQualitySettings.MaterialQualities)PlayerPrefs.GetInt("Quality_v016_MaterialQuality", (int)TheForestQualitySettings.UserSettings.MaterialQuality)); } return(flag); }
public static int GetGrassLevelDensity() { int num = QualitySettings.names.Length; for (int i = 0; i < num; i++) { TheForestQualitySettings preset = TheForestQualitySettings.GetPreset(i); if (preset.GrassDensity == TheForestQualitySettings.UserSettings.GrassDensity) { return(i); } } return(-1); }
public static int GetScatterLevel() { int num = QualitySettings.names.Length; for (int i = 0; i < num; i++) { TheForestQualitySettings preset = TheForestQualitySettings.GetPreset(i); if (preset.ScatterResolution == TheForestQualitySettings.UserSettings.ScatterResolution && preset.ScatterSamplingQuality == TheForestQualitySettings.UserSettings.ScatterSamplingQuality) { return(i); } } return(-1); }
private static int GetPreset() { if (CoopPeerStarter.DedicatedHost) { return(5); } int @int = PlayerPrefs.GetInt("Preset_v16", PlayerPreferences.Preset); if (@int == 5 && !TheForestQualitySettings.HasSavedSettings()) { return(PlayerPreferences.Preset); } return(@int); }
public static void Copy(TheForestQualitySettings from, TheForestQualitySettings to) { to.Preset = from.Preset; to.AntiAliasing = from.AntiAliasing; if (PlayerPreferences.is32bit) { to.CascadeCount = (TheForestQualitySettings.ShadowCascadeCount)Mathf.Max((int)from.CascadeCount, 1); } else { to.CascadeCount = from.CascadeCount; } to.ShadowLevel = from.ShadowLevel; to.FarShadowMode = from.FarShadowMode; to.LightDistance = from.LightDistance; to.LightmapResolution = from.LightmapResolution; to.LightmapUpdateIntervalFrames = from.LightmapUpdateIntervalFrames; to.MotionBlur = from.MotionBlur; to.ScatterResolution = from.ScatterResolution; to.ScatterSamplingQuality = from.ScatterSamplingQuality; to.SSAOType = from.SSAOType; to.SSAO = from.SSAO; to.PostEffectsSystem = from.PostEffectsSystem; to.SEBloom = from.SEBloom; to.Fg = from.Fg; to.CA = from.CA; to.DofTech = from.DofTech; to.screenSpaceReflection = from.screenSpaceReflection; to.volumetricClouds = from.volumetricClouds; to.SunshineOcclusion = from.SunshineOcclusion; to.VolumetricsType = from.VolumetricsType; to.Caustics = from.Caustics; to.SkyLighting = from.SkyLighting; to.SetTerrainQuality(from.TerrainQuality); to.DrawDistance = from.DrawDistance; to.GrassMode = from.GrassMode; to.GrassDistance = from.GrassDistance; to.GrassDensity = from.GrassDensity; to.ReflexionMode = from.ReflexionMode; to.OceanQuality = from.OceanQuality; to.SetTextureQuality(from.TextureQuality); to.SetMaterialQuality(from.MaterialQuality); }
public static void Load() { Debug.Log("PlayerPreferences.Load"); if (PlayerPreferences.alreadyLoaded) { return; } PlayerPreferences.Preset = PlayerPrefs.GetInt("Preset_v16", PlayerPreferences.Preset); PlayerPreferences.LowMemoryMode = (PlayerPrefs.GetInt("LowMemoryMode", 0) > 0); PlayerPreferences.Brightness = PlayerPrefs.GetFloat("Brightness", 0.5f); PlayerPreferences.Volume = PlayerPrefs.GetFloat("Volume", 0.5f); PlayerPreferences.MusicVolume = PlayerPrefs.GetFloat("MusicVolume", 1f); PlayerPreferences.VoiceCount = PlayerPrefs.GetInt("VoiceCount", 128); PlayerPreferences.MouseInvert = (PlayerPrefs.GetInt("MouseInvert", (!PlayerPreferences.MouseInvert) ? 0 : 1) > 0); PlayerPreferences.MouseSensitivity = PlayerPrefs.GetFloat("MouseSensitivity", 0.5f); PlayerPreferences.Fov = PlayerPrefs.GetFloat("Fov", 75f); int @int = PlayerPrefs.GetInt("MaxFrameRate2", -1); Application.targetFrameRate = @int; PlayerPreferences.MaxFrameRate = @int; PlayerPreferences.VSync = (PlayerPrefs.GetInt("VSync", QualitySettings.vSyncCount) > 0); PlayerPreferences.ShowHud = (PlayerPrefs.GetInt("ShowHud", 1) > 0); PlayerPreferences.ShowOverlayIcons = (PlayerPrefs.GetInt("ShowOverlayIcons", 1) > 0); PlayerPreferences.ShowProjectileReticle = (PlayerPrefs.GetInt("ShowProjectileReticle", 1) > 0); PlayerPreferences.UseXInput = (PlayerPrefs.GetInt("UseXInput", 0) > 0); PlayerPreferences.ShowPlayerNamesMP = (PlayerPrefs.GetInt("ShowPlayerNamesMP", 1) > 0); PlayerPreferences.ShowStealthMeter = (PlayerPrefs.GetInt("ShowStealthMeter", 1) > 0); PlayerPreferences.UseCrouchToggle = (PlayerPrefs.GetInt("UseCrouchToggle", 0) > 0); if (!TheForestQualitySettings.Load()) { TheForestQualitySettings.CopyPreset(-1); } QualitySettings.SetQualityLevel((int)TheForestQualitySettings.UserSettings.ShadowLevel); if (!TheForestQualitySettings.Load()) { TheForestQualitySettings.CopyPreset(-1); } PlayerPreferences.ApplyValues(); PlayerPreferences.alreadyLoaded = true; }
internal static void SetUnityQualityFromShadowLevel(TheForestQualitySettings.ShadowLevels shadowLevel) { QualitySettings.SetQualityLevel(TheForestQualitySettings.ConvertToQualityIndex(shadowLevel)); TheForestQualitySettings.UpdateUnityQualityShadowResolution(shadowLevel); }
public static void Load() { UnityEngine.Debug.Log("PlayerPreferences.Load"); if (PlayerPreferences.alreadyLoaded) { return; } PlayerPreferences.Preset = PlayerPreferences.GetPreset(); PlayerPreferences.LowMemoryMode = (PlayerPrefs.GetInt("LowMemoryMode", 0) > 0); PlayerPreferences.MemorySafeSaveMode = (PlayerPrefs.GetInt("MemorySafeSaveMode", 0) > 0); PlayerPreferences.GammaWorldAndDay = PlayerPrefs.GetFloat("GammaWorldAndDay", 2f); PlayerPreferences.GammaCavesAndNight = PlayerPrefs.GetFloat("GammaCavesAndNight", 2f); PlayerPreferences.Contrast = PlayerPrefs.GetFloat("Contrast", 1f); if (ForestVR.Enabled) { PlayerPreferences.SetAudioDriver(PlayerPrefs.GetString((!ForestVR.Enabled) ? "AudioDriver" : "AudioDriverVR", string.Empty), -1); } PlayerPreferences.Volume = PlayerPrefs.GetFloat("Volume", 0.5f); PlayerPreferences.MusicVolume = PlayerPrefs.GetFloat("MusicVolume", 1f); PlayerPreferences.MicrophoneVolume = PlayerPrefs.GetFloat("MicrophoneVolume", 5f); PlayerPreferences.VoiceCount = PlayerPrefs.GetInt("VoiceCount", 128); PlayerPreferences.MouseInvert = (PlayerPrefs.GetInt("MouseInvert", 0) > 0); PlayerPreferences.MouseSensitivityX = PlayerPrefs.GetFloat("MouseSensitivity", 0.5f); PlayerPreferences.MouseSensitivityY = PlayerPrefs.GetFloat("MouseSensitivityY", PlayerPrefs.GetFloat("MouseSensitivity", 0.5f)); PlayerPreferences.MouseSmoothing = PlayerPrefs.GetFloat("MouseSmoothing2", 0.1f); PlayerPreferences.Fov = PlayerPrefs.GetFloat("Fov", 75f); PlayerPreferences.MaxFrameRate = PlayerPrefs.GetInt("MaxFrameRate2", -1); PlayerPreferences.ApplyMaxFrameRate(); PlayerPreferences.SetLowQualityPhysics(PlayerPrefs.GetInt("LowQualityPhysics", 0) > 0); PlayerPreferences.Language = PlayerPrefs.GetString("Language", "English"); PlayerPreferences.SetGhostTint(PlayerPrefs.GetInt("GhostTint", 0), PlayerPrefs.GetFloat("GhostTintOpacity", 0.0784f)); PlayerPreferences.ColorGrading = PlayerPrefs.GetInt("ColorGrading", 0); PlayerPreferences.VSync = (PlayerPrefs.GetInt("VSync", QualitySettings.vSyncCount) > 0); PlayerPreferences.ShowHud = (PlayerPrefs.GetInt("ShowHud", 1) > 0); PlayerPreferences.ShowOverlayIcons = (PlayerPrefs.GetInt("ShowOverlayIcons", 1) > 0); PlayerPreferences.OverlayIconsGrouping = (PlayerPrefs.GetInt("OverlayIconsGroupingV2", 1) > 0); PlayerPreferences.ShowProjectileReticle = (PlayerPrefs.GetInt("ShowProjectileReticle", 1) > 0); PlayerPreferences.UseXInput = (PlayerPrefs.GetInt("UseXInputV2", 1) > 0); PlayerPreferences.ShowPlayerNamesMP = (PlayerPrefs.GetInt("ShowPlayerNamesMP", 1) > 0); PlayerPreferences.ShowStealthMeter = (PlayerPrefs.GetInt("ShowStealthMeter", 1) > 0); PlayerPreferences.UseCrouchToggle = (PlayerPrefs.GetInt("UseCrouchToggle", 0) > 0); PlayerPreferences.UseSprintToggle = (PlayerPrefs.GetInt("UseSprintToggle", 0) > 0); PlayerPreferences.UseGamepadRumble = (PlayerPrefs.GetInt("UseGamepadRumble", 1) > 0); if (!CoopPeerStarter.DedicatedHost) { PlayerPreferences.TreeRegrowthLocal = (PlayerPrefs.GetInt("TreeRegrowth", 0) > 0); PlayerPreferences.NoDestructionLocal = (PlayerPrefs.GetInt("NoDestruction", 0) > 0); PlayerPreferences.AllowEnemiesCreative = (PlayerPrefs.GetInt("AllowEnemiesCreative", 0) > 0); PlayerPreferences.CheatsAllowed = (PlayerPrefs.GetInt("CheatsAllowed", 0) > 0); } PlayerPreferences.ExWallAutofill = (PlayerPrefs.GetInt("ExWallAutofill", 1) > 0); PlayerPreferences.ExFloorsAutofill = (PlayerPrefs.GetInt("ExFloorsAutofill", 1) > 0); PlayerPreferences.VRTurnSnap = PlayerPrefs.GetInt("VRTurnSnap", PlayerPreferences.VRTurnSnap); PlayerPreferences.VRMoveDarkening = (PlayerPreferences.VRMoveDarkeningTypes)PlayerPrefs.GetInt("VRMoveDarkening", (int)PlayerPreferences.VRMoveDarkening); PlayerPreferences.VRAntiAliasing = (PlayerPreferences.VRAntiAliasingTypes)PlayerPrefs.GetInt("VRAntiAliasing", (int)PlayerPreferences.VRAntiAliasing); PlayerPreferences.VRUsePhysicalCrouching = (PlayerPrefs.GetInt("VRUsePhysicalCrouching", (!PlayerPreferences.VRUsePhysicalCrouching) ? 0 : 1) > 0); PlayerPreferences.VRForwardMovement = (PlayerPreferences.VRForwardDirectionTypes)PlayerPrefs.GetInt("VRForwardMovement", (int)PlayerPreferences.VRForwardMovement); PlayerPreferences.VRAutoRun = (PlayerPrefs.GetInt("VRAutoRun", (!PlayerPreferences.VRAutoRun) ? 0 : 1) > 0); PlayerPreferences.VRUseRightHandedBow = (PlayerPrefs.GetInt("VRUseRightHandedBow", (!PlayerPreferences.VRUseRightHandedBow) ? 0 : 1) > 0); PlayerPreferences.VRUseRightHandedWeapon = (PlayerPrefs.GetInt("VRUseRightHandedWeapon", (!PlayerPreferences.VRUseRightHandedWeapon) ? 0 : 1) > 0); if (!TheForestQualitySettings.Load()) { TheForestQualitySettings.CopyPreset(-1); } TheForestQualitySettings.SetUnityQualityFromShadowLevel(TheForestQualitySettings.UserSettings.ShadowLevel); if (!TheForestQualitySettings.Load()) { TheForestQualitySettings.CopyPreset(-1); } PlayerPreferences.ApplyValues(); PlayerPreferences.alreadyLoaded = true; }