Decompiled source of OnTogether Day and Night v1.0.0

plugins\On-Together_Day_and_Night\On-Together_Day_and_Night.dll

Decompiled 16 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using StylizedWater3;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace OnTogetherDayAndNight;

[BepInPlugin("cn.ontogether.dayandnight", "On-Together: Day and Night", "1.0.0")]
public sealed class DayAndNightPlugin : BaseUnityPlugin
{
	private sealed class CameraSkyboxState
	{
		public Skybox Skybox;

		public Material OriginalMaterial;
	}

	private sealed class ShadowRendererState
	{
		public Renderer Renderer;

		public ShadowCastingMode OriginalMode;

		public bool OriginalReceiveShadows;
	}

	private sealed class SpecialLocalLight
	{
		public float DayIntensity;

		public float NightIntensity;

		public bool ReserveBudget;
	}

	private sealed class CampfireEmissionState
	{
		public GameObject Overlay;

		public Material[] Materials;

		public bool[] Visible;
	}

	private sealed class DeviceScreenState
	{
		public Renderer Source;

		public GameObject Overlay;

		public Material[] Materials;

		public Light Light;

		public bool HasScreenAnchor;

		public Vector3 ScreenLocalCenter;

		public Vector3 ScreenLocalNormal;

		public bool IsGameConsole;

		public Color DisplayColor;

		public Color TargetDisplayColor;

		public float NextDisplayChangeAt;
	}

	private sealed class WaterMaterial
	{
		public Material Material;

		public int[] PropertyIds;

		public string[] PropertyNames;

		public Color[] Originals;

		public Color[] DrivenColors;

		public bool HasReflectionStrength;

		public float OriginalReflectionStrength;

		public bool IsWaterfall;
	}

	private sealed class WaterParticleState
	{
		public ParticleSystem System;

		public MinMaxGradient OriginalStartColor;
	}

	private sealed class HiddenCloudRendererState
	{
		public Renderer Renderer;

		public bool OriginalForceRenderingOff;

		public bool OriginalEnabled;
	}

	private sealed class HiddenWorldCloudRootState
	{
		public GameObject Root;

		public bool OriginalActive;
	}

	private sealed class CloudInstancingState
	{
		public CloudInstancing Instancing;

		public bool OriginalEnabled;
	}

	private sealed class ToonMaterial
	{
		public Material Material;

		public bool HadSystemShadows;

		public float OrigSystemShadows;

		public bool HadSystemShadowLevel;

		public float OrigSystemShadowLevel;

		public bool HadBaseColorStep;

		public float OrigBaseColorStep;

		public bool HadUseBaseAs1st;

		public float OrigUseBaseAs1st;

		public bool HadUse1stAs2nd;

		public float OrigUse1stAs2nd;

		public bool PlayerShadowAdjusted;

		public bool SurfaceShadowAdjusted;

		public bool Has1st;

		public Color Orig1st;

		public bool Has2nd;

		public Color Orig2nd;
	}

	private const float CloudFieldRadius = 210f;

	private ConfigEntry<bool> _gradingEnabled;

	private ConfigEntry<float> _temperature;

	private ConfigEntry<float> _tint;

	private ConfigEntry<float> _postExposure;

	private ConfigEntry<float> _contrast;

	private ConfigEntry<float> _saturation;

	private ConfigEntry<Color> _dayColorFilter;

	private ConfigEntry<float> _shadowCooling;

	private ConfigEntry<string> _tonemapping;

	private ConfigEntry<bool> _disableFilmGrain;

	private ConfigEntry<bool> _disableDepthOfField;

	private ConfigEntry<bool> _disableMotionBlur;

	private ConfigEntry<bool> _disableBloom;

	private ConfigEntry<bool> _disableVignette;

	private ConfigEntry<bool> _neutralizeSplitToning;

	private ConfigEntry<bool> _adjustSun;

	private ConfigEntry<float> _sunElevation;

	private ConfigEntry<float> _sunAzimuth;

	private ConfigEntry<float> _sunIntensity;

	private ConfigEntry<float> _sunShadowStrength;

	private ConfigEntry<float> _sunNeutralize;

	private ConfigEntry<bool> _forceShadowCasting;

	private ConfigEntry<bool> _restoreTreeShadows;

	private ConfigEntry<bool> _hardShadows;

	private ConfigEntry<int> _shadowMapResolution;

	private ConfigEntry<int> _shadowCascadeCount;

	private ConfigEntry<bool> _stabilizeShadowEdges;

	private ConfigEntry<bool> _dayCycleEnabled;

	private ConfigEntry<float> _cycleMinutes;

	private ConfigEntry<float> _noonMinute;

	private ConfigEntry<float> _maxElevation;

	private ConfigEntry<float> _nightBrightness;

	private ConfigEntry<float> _minimumNightLight;

	private ConfigEntry<float> _nightExposureDip;

	private ConfigEntry<float> _shadowDistance;

	private ConfigEntry<bool> _lampsEnabled;

	private ConfigEntry<string> _lampStyle;

	private ConfigEntry<string> _lampKeywords;

	private ConfigEntry<int> _maxLitLamps;

	private ConfigEntry<float> _lampRange;

	private ConfigEntry<float> _lampIntensity;

	private ConfigEntry<float> _haloSize;

	private ConfigEntry<bool> _deckStringLightsEnabled;

	private ConfigEntry<float> _deckStringLightRange;

	private ConfigEntry<float> _deckStringLightIntensity;

	private ConfigEntry<float> _deckStringColorCycleSeconds;

	private ConfigEntry<float> _deskLampRange;

	private ConfigEntry<float> _deskLampIntensity;

	private ConfigEntry<bool> _campfireLightsEnabled;

	private ConfigEntry<bool> _treeLanternLightsEnabled;

	private ConfigEntry<bool> _playTowerSunLightEnabled;

	private ConfigEntry<bool> _deviceScreensGlow;

	private ConfigEntry<bool> _waterDaylight;

	private ConfigEntry<float> _nightWaterBrightness;

	private ConfigEntry<Color> _dayWaterPatternColor;

	private ConfigEntry<Color> _nightWaterPatternColor;

	private ConfigEntry<float> _waterWaveBrightness;

	private ConfigEntry<float> _nightWaterfallFoamBrightness;

	private ConfigEntry<bool> _waterReflections;

	private ConfigEntry<bool> _waterShadowOverlayEnabled;

	private ConfigEntry<float> _waterShadowOverlayStrength;

	private ConfigEntry<bool> _toonShading;

	private ConfigEntry<float> _shadeDarkness;

	private ConfigEntry<float> _surfaceShadeStep;

	private ConfigEntry<float> _surfaceNoonShadeStep;

	private ConfigEntry<float> _surfaceSystemShadowLevel;

	private ConfigEntry<float> _playerShadeDarkness;

	private ConfigEntry<float> _playerSystemShadowLevel;

	private ConfigEntry<float> _playerShadeStep;

	private ConfigEntry<bool> _replaceSkybox;

	private ConfigEntry<float> _atmosphereThickness;

	private ConfigEntry<float> _skyExposure;

	private ConfigEntry<float> _sunSize;

	private ConfigEntry<Color> _skyTint;

	private ConfigEntry<Color> _groundColor;

	private ConfigEntry<bool> _moonEnabled;

	private ConfigEntry<float> _lunarCycleDays;

	private ConfigEntry<float> _newMoonBrightness;

	private ConfigEntry<float> _moonSize;

	private ConfigEntry<Color> _moonColor;

	private ConfigEntry<bool> _sunsetGlowEnabled;

	private ConfigEntry<float> _sunsetGlowStrength;

	private ConfigEntry<float> _pinkDuskChance;

	private ConfigEntry<float> _redDuskChance;

	private ConfigEntry<float> _twilightWorldTint;

	private ConfigEntry<bool> _starsEnabled;

	private ConfigEntry<int> _starCount;

	private ConfigEntry<float> _meteorChance;

	private ConfigEntry<bool> _cloudsEnabled;

	private ConfigEntry<int> _cloudCount;

	private ConfigEntry<bool> _cloudShadows;

	private ConfigEntry<float> _cloudSpeed;

	private ConfigEntry<float> _cloudDirection;

	private ConfigEntry<float> _cloudAltitude;

	private ConfigEntry<float> _cloudScale;

	private ConfigEntry<bool> _hideVanillaClouds;

	private ConfigEntry<bool> _weatherEnabled;

	private ConfigEntry<bool> _randomRain;

	private ConfigEntry<string> _rainToggleKey;

	private ConfigEntry<float> _clearMinutesMin;

	private ConfigEntry<float> _clearMinutesMax;

	private ConfigEntry<float> _rainMinutesMin;

	private ConfigEntry<float> _rainMinutesMax;

	private ConfigEntry<float> _weatherTransitionSeconds;

	private ConfigEntry<float> _rainLightMultiplier;

	private ConfigEntry<float> _rainExposureDip;

	private ConfigEntry<float> _rainAudioVolume;

	private ConfigEntry<float> _thunderChancePerMinute;

	private ConfigEntry<float> _rainDropSize;

	private ConfigEntry<float> _rainDensity;

	private ConfigEntry<bool> _decorDimming;

	private ConfigEntry<float> _nightDecorBrightness;

	private ConfigEntry<string> _decorExcludeKeywords;

	private ConfigEntry<float> _ambientCoolShift;

	private ConfigEntry<float> _ambientIntensity;

	private ConfigEntry<bool> _natureAmbienceEnabled;

	private ConfigEntry<float> _noonCicadaVolume;

	private ConfigEntry<float> _nightNatureVolume;

	private ConfigEntry<float> _natureFadeSeconds;

	private ConfigEntry<float> _rainNatureMultiplier;

	private ConfigEntry<bool> _configMenuEnabled;

	private ConfigEntry<string> _configMenuKey;

	private ConfigEntry<string> _configMenuLanguage;

	private GameObject _volumeObject;

	private Volume _volume;

	private VolumeProfile _profile;

	private Material _skyMaterial;

	private Material _originalSkybox;

	private bool _skyApplied;

	private bool _skyRuntimeEnabled;

	private GameObject _moonObject;

	private Material _moonMaterial;

	private Texture2D _moonTexture;

	private Mesh _moonMesh;

	private float _moonPhase;

	private float _moonIllumination = 1f;

	private float _lastMoonTexturePhase = -10f;

	private float _nextMoonPhaseUpdate;

	private bool _ambientCaptured;

	private AmbientMode _origAmbientMode;

	private Color _origAmbientLight;

	private Color _origAmbientSky;

	private Color _origAmbientEquator;

	private Color _origAmbientGround;

	private float _origAmbientIntensity;

	private Coroutine _applyRoutine;

	private Light _sunLight;

	private bool _sunCaptured;

	private Quaternion _origSunRotation;

	private Color _origSunColor;

	private float _origSunIntensity;

	private float _origSunShadowStrength;

	private int _postForcedCount;

	private int _skyboxForcedCount;

	private int _cameraSkyboxForcedCount;

	private float _nextPostCheck;

	private readonly Dictionary<int, CameraSkyboxState> _cameraSkyboxStates = new Dictionary<int, CameraSkyboxState>();

	private readonly Dictionary<int, ShadowRendererState> _shadowRendererStates = new Dictionary<int, ShadowRendererState>();

	private LightShadows _origSunShadows;

	private float _nextGiUpdate;

	private float _nextShadowRescan;

	private float _nextPlayerShadowRefresh;

	private float _nextSceneFeatureLampRescan;

	private bool _playerDiagnosticsWritten;

	private ColorAdjustments _colorAdjustments;

	private bool _colorGradingModeCaptured;

	private ColorGradingMode _originalColorGradingMode;

	private readonly List<Light> _lampLights = new List<Light>();

	private readonly List<GameObject> _lampHolders = new List<GameObject>();

	private readonly List<Transform> _lampHalos = new List<Transform>();

	private readonly Dictionary<Light, float> _deckStringLightHues = new Dictionary<Light, float>();

	private readonly Dictionary<Renderer, float> _deckStringHaloHues = new Dictionary<Renderer, float>();

	private readonly Dictionary<Light, SpecialLocalLight> _specialLocalLights = new Dictionary<Light, SpecialLocalLight>();

	private readonly List<CampfireEmissionState> _campfireEmissionStates = new List<CampfireEmissionState>();

	private readonly List<DeviceScreenState> _deviceScreenStates = new List<DeviceScreenState>();

	private static readonly Color[] DeckStringPastelColors = (Color[])(object)new Color[6]
	{
		new Color(1f, 0.68f, 0.66f, 1f),
		new Color(0.98f, 0.82f, 0.56f, 1f),
		new Color(0.71f, 0.88f, 0.64f, 1f),
		new Color(0.57f, 0.82f, 0.88f, 1f),
		new Color(0.65f, 0.7f, 0.96f, 1f),
		new Color(0.88f, 0.66f, 0.92f, 1f)
	};

	private Material _haloMaterial;

	private Mesh _haloMesh;

	private float _nextLampUpdate;

	private float _lastDayWeight = 1f;

	private float _lampWeight;

	private readonly List<WaterMaterial> _waterMaterials = new List<WaterMaterial>();

	private readonly HashSet<Material> _waterSeen = new HashSet<Material>();

	private readonly List<WaterParticleState> _waterParticles = new List<WaterParticleState>();

	private readonly HashSet<int> _waterParticleIds = new HashSet<int>();

	private PlanarReflectionRenderer _waterReflectionRenderer;

	private GameObject _waterReflectionObject;

	private float _nextWaterEffectScan;

	private float _origReflectionIntensity = 1f;

	private Material _waterShadowOverlayMaterial;

	private readonly List<GameObject> _waterShadowOverlayObjects = new List<GameObject>();

	private readonly HashSet<int> _waterShadowOverlaySourceIds = new HashSet<int>();

	private readonly List<WaterMaterial> _decorMaterials = new List<WaterMaterial>();

	private readonly HashSet<Material> _decorSeen = new HashSet<Material>();

	private float _nextDecorRescan;

	private readonly Dictionary<int, string> _playerRendererSignatures = new Dictionary<int, string>();

	private int _lastTwilightId = int.MinValue;

	private string _twilightVariantName = "orange";

	private Color _twilightGlowColor = new Color(1f, 0.58f, 0.32f, 1f);

	private Color _twilightSkyTint = new Color(0.62f, 0.46f, 0.4f, 1f);

	private Color _twilightSunColor = new Color(1f, 0.72f, 0.5f, 1f);

	private GameObject _sunsetGlowObject;

	private Material _sunsetGlowMaterial;

	private Texture2D _sunsetGlowTexture;

	private GameObject _duskShadeObject;

	private Material _duskShadeMaterial;

	private bool _celestialValid;

	private float _lastSignedElevation;

	private float _lastSunAzimuth;

	private Camera _shadowAaCamera;

	private AntialiasingMode _originalAntialiasing;

	private AntialiasingQuality _originalAntialiasingQuality;

	private bool _shadowAaCaptured;

	private GameObject _starObject;

	private Material _starMaterial;

	private Mesh _starMesh;

	private Texture2D _starTexture;

	private readonly List<Color> _starBaseColors = new List<Color>();

	private readonly List<float> _starTwinklePhases = new List<float>();

	private readonly List<float> _starTwinkleSpeeds = new List<float>();

	private readonly List<float> _starTwinkleAmounts = new List<float>();

	private readonly List<Color> _starAnimatedColors = new List<Color>();

	private float _nextStarTwinkleUpdate;

	private GameObject _meteorObject;

	private Material _meteorMaterial;

	private bool _meteorActive;

	private Vector3 _meteorDir;

	private Vector3 _meteorVelocity;

	private float _meteorStartTime;

	private float _nextMeteorRoll;

	private readonly Random _visualRandom = new Random();

	private readonly Dictionary<int, HiddenCloudRendererState> _hiddenVanillaClouds = new Dictionary<int, HiddenCloudRendererState>();

	private readonly Dictionary<int, HiddenWorldCloudRootState> _hiddenWorldCloudRoots = new Dictionary<int, HiddenWorldCloudRootState>();

	private readonly Dictionary<int, CloudInstancingState> _hiddenCloudInstancers = new Dictionary<int, CloudInstancingState>();

	private float _nextVanillaCloudScan;

	private readonly HashSet<int> _cloudSuspectsLogged = new HashSet<int>();

	private readonly HashSet<int> _skyRenderersLogged = new HashSet<int>();

	private GameObject _cloudRoot;

	private Material _cloudMaterial;

	private readonly List<Transform> _cloudTransforms = new List<Transform>();

	private readonly List<Vector3> _cloudBaseScales = new List<Vector3>();

	private readonly List<Mesh> _cloudMeshList = new List<Mesh>();

	private bool _rainTarget;

	private float _rainBlend;

	private float _nextWeatherChange;

	private float _nextWorldProbe;

	private bool _worldSceneReady;

	private KeyCode _weatherToggleKey = (KeyCode)291;

	private readonly Random _weatherRandom = new Random();

	private GameObject _stormCloudRoot;

	private Material _stormCloudMaterial;

	private readonly List<Transform> _stormCloudTransforms = new List<Transform>();

	private readonly List<Vector3> _stormCloudBaseScales = new List<Vector3>();

	private readonly List<Mesh> _stormCloudMeshes = new List<Mesh>();

	private GameObject _rainObject;

	private ParticleSystem _rainParticles;

	private Material _rainMaterial;

	private Texture2D _rainTexture;

	private bool _rainUsesNativeMaterial;

	private GameObject _splashObject;

	private ParticleSystem _splashParticles;

	private Material _splashMaterial;

	private Texture2D _splashTexture;

	private float _splashAccumulator;

	private bool _splashDiagnosticWritten;

	private GameObject _weatherAudioObject;

	private AudioSource _rainAudioSource;

	private AudioSource _rainDetailAudioSource;

	private AudioSource _thunderAudioSource;

	private AudioClip _rainAudioClip;

	private AudioClip _rainDetailAudioClip;

	private AudioClip _thunderAudioClip;

	private string _weatherAudioPairSignature = "";

	private float _nextWeatherAudioProbe;

	private bool _weatherAudioWarningWritten;

	private float _nextThunderRoll;

	private float _lightningFlash;

	private bool _weatherFogCaptured;

	private bool _originalFogEnabled;

	private FogMode _originalFogMode;

	private Color _originalFogColor;

	private float _originalFogDensity;

	private float _originalFogStart;

	private float _originalFogEnd;

	private GameObject _natureAudioObject;

	private AudioSource _cicadaAudioSource;

	private AudioSource _nightNatureAudioSource;

	private AudioClip _cicadaAudioClip;

	private AudioClip _nightNatureAudioClip;

	private Coroutine _natureAudioLoadRoutine;

	private bool _natureAudioLoadAttempted;

	private int _lastNatureAudioPhase = -1;

	private KeyCode _configMenuKeyCode = (KeyCode)292;

	private bool _configMenuVisible;

	private bool _hotConfigDirty;

	private float _hotConfigApplyAt;

	private Rect _configMenuRect = new Rect(36f, 36f, 680f, 700f);

	private Vector2 _configMenuScroll;

	private int _configMenuTab;

	private CursorLockMode _cursorLockBeforeMenu;

	private bool _cursorVisibleBeforeMenu;

	private GUIStyle _menuTitleStyle;

	private GUIStyle _menuSectionStyle;

	private GUIStyle _menuNoteStyle;

	private GUIStyle _menuValueStyle;

	private Font _configMenuFont;

	private bool _ownsConfigMenuFont;

	private readonly HashSet<int> _lampRootIds = new HashSet<int>();

	private readonly HashSet<int> _sceneFeatureLightSourceIds = new HashSet<int>();

	private readonly List<ToonMaterial> _toonMaterials = new List<ToonMaterial>();

	private readonly List<ToonMaterial> _surfaceToonEntries = new List<ToonMaterial>();

	private readonly HashSet<Material> _toonSeen = new HashSet<Material>();

	private readonly HashSet<Material> _surfaceToonMaterials = new HashSet<Material>();

	private readonly HashSet<Material> _basketCourtToonMaterials = new HashSet<Material>();

	private void Awake()
	{
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0311: Unknown result type (might be due to invalid IL or missing references)
		//IL_03da: Unknown result type (might be due to invalid IL or missing references)
		//IL_0db5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dee: Unknown result type (might be due to invalid IL or missing references)
		//IL_11fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_1213: Unknown result type (might be due to invalid IL or missing references)
		_gradingEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Grading", "Enabled", true, "Master switch for the Day and Night colour grade (white balance, exposure, contrast, shadow tone). F6 toggles it live for A/B comparison.");
		_temperature = ((BaseUnityPlugin)this).Config.Bind<float>("Grading", "Temperature", 0f, "White balance temperature, -100 (cold) to 100 (warm). Negative values counteract the game's warm cast.");
		_tint = ((BaseUnityPlugin)this).Config.Bind<float>("Grading", "Tint", 10f, "White balance green-magenta tint, -100 to 100. Positive counteracts the green cast of the grass-dominated daylight scenes.");
		_postExposure = ((BaseUnityPlugin)this).Config.Bind<float>("Grading", "Post exposure", 0f, "Exposure adjustment in EV. Zero preserves the clear authored highlights and sun disc.");
		_contrast = ((BaseUnityPlugin)this).Config.Bind<float>("Grading", "Contrast", 14f, "Contrast, -100 to 100. Positive values give shadows more presence.");
		_saturation = ((BaseUnityPlugin)this).Config.Bind<float>("Grading", "Saturation", 3f, "Saturation, -100 to 100.");
		_dayColorFilter = ((BaseUnityPlugin)this).Config.Bind<Color>("Grading", "Day color filter", new Color(1f, 0.98f, 1f, 1f), "Final daylight RGB multiplier. Kept very close to white so the grade removes only the green bias without laying a gray/magenta veil over the whole image.");
		_shadowCooling = ((BaseUnityPlugin)this).Config.Bind<float>("Grading", "Shadow cooling", 0.08f, "0-1. Shifts shadow regions toward a cooler, slightly deeper tone so they read as natural shade instead of warm haze.");
		_tonemapping = ((BaseUnityPlugin)this).Config.Bind<string>("Grading", "Tonemapping", "None", "None, Neutral or ACES. None preserves crisp pastel highlights and keeps the sun from being compressed into a gray disc; Neutral/ACES intentionally roll highlights off.");
		_disableFilmGrain = ((BaseUnityPlugin)this).Config.Bind<bool>("Grading", "Disable film grain", true, "Removes the game's film grain overlay, which contributes to the washed-out look.");
		_disableDepthOfField = ((BaseUnityPlugin)this).Config.Bind<bool>("Grading", "Disable depth of field", true, "Removes the game's depth-of-field blur. Sharper distance view and slightly cheaper on the GPU.");
		_disableMotionBlur = ((BaseUnityPlugin)this).Config.Bind<bool>("Grading", "Disable motion blur", true, "Removes the game's motion blur, which smears the image at sub-60 frame rates.");
		_disableBloom = ((BaseUnityPlugin)this).Config.Bind<bool>("Grading", "Disable bloom", true, "The game's own bloom (never visible before, since it shipped with post-processing off) washes the bright pastel scene into haze, especially at noon.");
		_disableVignette = ((BaseUnityPlugin)this).Config.Bind<bool>("Grading", "Disable vignette", true, "Removes the game's corner darkening.");
		_neutralizeSplitToning = ((BaseUnityPlugin)this).Config.Bind<bool>("Grading", "Neutralize split toning", true, "Overrides the game's own shadow/highlight color toning with neutral gray. Try this if the image still feels tinted after the white balance change.");
		_replaceSkybox = ((BaseUnityPlugin)this).Config.Bind<bool>("Sky", "Replace skybox", true, "Replaces the flat sky with a procedural atmosphere: deep blue zenith fading to a pale horizon, plus a visible sun disc that follows the scene's directional light. F5 toggles it live.");
		_atmosphereThickness = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Atmosphere thickness", 0.7f, "0.5-2. Higher values deepen the blue but also whiten the horizon haze.");
		_skyExposure = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Exposure", 1.2f, "Skybox brightness.");
		_sunSize = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Sun size", 0.028f, "Apparent size of the daytime sun. The default keeps it compact and consistent through dawn and dusk.");
		_skyTint = ((BaseUnityPlugin)this).Config.Bind<Color>("Sky", "Sky tint", new Color(0.5f, 0.5f, 0.5f, 1f), "Tint applied to the atmosphere. Neutral gray gives a natural blue sky.");
		_groundColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Sky", "Ground color", new Color(0.6f, 0.8f, 0.85f, 1f), "Color of the skybox below the horizon. Keep it close to the sea color so the strip between the ocean edge and the sky blends in instead of showing a pale band.");
		_moonEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Sky", "Enable moon phases", true, "Replaces the night-time miniature sun disc with a dedicated procedural moon whose lit face changes through a lunar cycle.");
		_lunarCycleDays = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Lunar cycle game days", 8f, "Number of in-game day/night cycles per complete lunar cycle. Eight gives the familiar eight recognizable moon phases; with a 30-minute day this is a four-hour lunar cycle.");
		_newMoonBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "New moon light multiplier", 0.6f, "0-1. Night directional-light brightness at new moon relative to full moon. Full moon always uses the existing Night brightness value as its baseline.");
		_moonSize = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Moon angular size", 0.075f, "Apparent size of the moon in the night sky.");
		_moonColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Sky", "Moon color", new Color(0.82f, 0.9f, 1f, 1f), "Tint of the illuminated lunar surface and its subtle halo.");
		_sunsetGlowEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Sky", "Sunset glow", true, "Directional dawn/dusk color: a soft glow band hugs the horizon around the sun, so the sky blushes on the sun side while the opposite side stays dim, like a real sunset.");
		_sunsetGlowStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Sunset glow strength", 1f, "0-2. Opacity multiplier for the horizon glow band.");
		_pinkDuskChance = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Pink twilight chance", 0.18f, "0-1. Probability that a dawn/dusk rolls a pink sky instead of the usual orange. Rolled once per twilight, deterministically from the real clock, and colors the glow band, sky tint and low-sun light together.");
		_redDuskChance = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Crimson twilight chance", 0.1f, "0-1. Probability of a deep crimson twilight. Checked before the pink roll.");
		_twilightWorldTint = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Twilight world tint", 0.5f, "0-1. How strongly the whole frame (ground, buildings, characters, sea) is pulled toward the twilight color while the sun crosses the horizon. 0 = only the sky and the low sun change color, like before.");
		_starsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Sky", "Stars", true, "Starfield that fades in at dusk and out at dawn, slowly wheeling across the night sky.");
		_starCount = ((BaseUnityPlugin)this).Config.Bind<int>("Sky", "Star count", 180, "40-800. Number of stylized stars. A restrained count fits the game's clean cartoon sky better.");
		_meteorChance = ((BaseUnityPlugin)this).Config.Bind<float>("Sky", "Shooting star chance", 0.035f, "0-1. Probability per second (at deep night) that a shooting star streaks across the sky. 0.035 is roughly one every half minute.");
		_cloudsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Clouds", "Enabled", true, "Stylized puffy clouds that drift across the sky. They tint with dawn/dusk, darken under the night moon and can throw drifting shadows onto the island.");
		_cloudCount = ((BaseUnityPlugin)this).Config.Bind<int>("Clouds", "Cloud count", 24, "1-40. Number of clouds around the camera.");
		_cloudShadows = ((BaseUnityPlugin)this).Config.Bind<bool>("Clouds", "Cast cloud shadows", true, "Clouds write the shadow map, so soft shadow patches sweep across the ground as they drift. Costs some shadow-pass GPU; turn off first if the frame rate dips.");
		_cloudSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Clouds", "Wind speed", 0.8f, "Cloud drift speed in meters per second (0-30). Asset excavation proved every cloud in the sky is generated by this mod (the baked PR_CloudBase set is deactivated), so a clearly visible drift doubles as proof: a cloud that visibly moves is ours, and they all move.");
		_cloudDirection = ((BaseUnityPlugin)this).Config.Bind<float>("Clouds", "Wind direction", 25f, "Compass direction the clouds drift toward, in degrees.");
		_cloudAltitude = ((BaseUnityPlugin)this).Config.Bind<float>("Clouds", "Altitude", 50f, "Cloud base height in world units (25-150).");
		_cloudScale = ((BaseUnityPlugin)this).Config.Bind<float>("Clouds", "Cloud scale", 1f, "0.3-3. Overall cloud size multiplier.");
		_hideVanillaClouds = ((BaseUnityPlugin)this).Config.Bind<bool>("Clouds", "Hide vanilla clouds", true, "Hides the original clouds in the main world so they do not overlap the mod's clouds. Menu clouds and nearby player weather effects are preserved.");
		_weatherEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Weather", "Enabled", true, "Enables Day and Night rain events, visuals and the game's own rain ambience audio.");
		_randomRain = ((BaseUnityPlugin)this).Config.Bind<bool>("Weather", "Random rain", true, "Starts and stops rain automatically after randomized clear/rain intervals.");
		_rainToggleKey = ((BaseUnityPlugin)this).Config.Bind<string>("Weather", "Toggle rain key", "F10", "Keyboard key that immediately starts or stops rain. F10 avoids FrameCare's F7-F9 keys.");
		_clearMinutesMin = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Clear minutes minimum", 8f, "Minimum clear-weather time before a random rain event can start.");
		_clearMinutesMax = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Clear minutes maximum", 18f, "Maximum clear-weather time before a random rain event starts.");
		_rainMinutesMin = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Rain minutes minimum", 2.5f, "Minimum duration of a random rain event.");
		_rainMinutesMax = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Rain minutes maximum", 5.5f, "Maximum duration of a random rain event.");
		_weatherTransitionSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Transition seconds", 14f, "Seconds used to build or clear the storm instead of popping instantly.");
		_rainLightMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Rain light multiplier", 0.58f, "0.2-1. Directional and ambient light multiplier under full rain cover.");
		_rainExposureDip = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Rain exposure dip", -0.18f, "Additional post exposure in EV during full rain.");
		_rainAudioVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Rain audio volume", 0.62f, "0-1. Combined volume of the game's long StormRain and Rain ambience layers.");
		_thunderChancePerMinute = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Thunder chance per minute", 0.06f, "Average per-minute chance of a brief lightning flash and the game's built-in Thunder clip.");
		_rainDropSize = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Rain drop size multiplier", 0.4f, "Visible size of raindrops (0.4-1.4). This does not change their fall speed.");
		_rainDensity = ((BaseUnityPlugin)this).Config.Bind<float>("Weather", "Rain density multiplier", 1.66f, "Amount of visible rain (0.5-2.0). Higher values may have a small performance cost.");
		_adjustSun = ((BaseUnityPlugin)this).Config.Bind<bool>("Sun", "Adjust sun", true, "The game parks its directional light at a permanent overhead noon (90 degrees, straight down) with shadow strength 0.22, which makes the world look flat. This tilts the sun to a pleasant afternoon angle and restores shadow definition. Purely visual, does not affect gameplay.");
		_sunElevation = ((BaseUnityPlugin)this).Config.Bind<float>("Sun", "Elevation", 45f, "Sun height above the horizon in degrees. 90 restores the game's original overhead angle.");
		_sunAzimuth = ((BaseUnityPlugin)this).Config.Bind<float>("Sun", "Azimuth", 330f, "Compass direction the sunlight comes from, 0-360 degrees.");
		_sunIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("Sun", "Intensity multiplier", 1f, "Multiplier on the sun light intensity.");
		_sunShadowStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Sun", "Shadow strength", 0.65f, "0-1. How dark sun shadows are. The game's original value is 0.22 (nearly invisible).");
		_shadowDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Sun", "Shadow distance", 220f, "Distance in world units within which shadows render, measured from the CAMERA. Zoomed-out views put the whole frame beyond a short distance and every shadow in view vanishes at once (the giant Circle_Hill cylinders made this obvious). Lower this first if shadow cost is too high.");
		_hardShadows = ((BaseUnityPlugin)this).Config.Bind<bool>("Sun", "Hard shadows", false, "Uses crisp shadow edges instead of the smoother default. Smooth shadows usually look better on moving characters.");
		_shadowMapResolution = ((BaseUnityPlugin)this).Config.Bind<int>("Sun", "Shadow map resolution", 4096, "Main directional-light shadow atlas resolution. 4096 gives dynamic characters and props substantially cleaner silhouettes than the game's low-cost default.");
		_shadowCascadeCount = ((BaseUnityPlugin)this).Config.Bind<int>("Sun", "Shadow cascade count", 4, "Directional shadow cascades (1-4). Four cascades preserve detail near the camera while the day/night light continues to move normally.");
		_stabilizeShadowEdges = ((BaseUnityPlugin)this).Config.Bind<bool>("Sun", "Stabilize moving shadow edges", true, "Uses high-quality spatial edge smoothing without frame-history blending. This avoids making transparent character outlines fade while the character moves.");
		_sunNeutralize = ((BaseUnityPlugin)this).Config.Bind<float>("Sun", "Neutralize warm tint", 0.25f, "0-1. Blends the sun color from the game's warm cream toward neutral white.");
		_forceShadowCasting = ((BaseUnityPlugin)this).Config.Bind<bool>("Sun", "Force shadow casting", true, "The game disables shadow casting on most environment objects (built for its shadowless overhead sun). This re-enables it so the tilted sun casts consistent shadows everywhere. Turn off if the shadow pass costs too much on your GPU.");
		_restoreTreeShadows = ((BaseUnityPlugin)this).Config.Bind<bool>("Sun", "Restore tree shadows", true, "Forces confirmed tree crowns and trunks to cast and receive directional shadows. This restores crown self-shadowing/back-side depth and lets trunks/crowns project onto the ground. Disable only if the additional moving foliage shadow casters are too expensive.");
		_dayCycleEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Day cycle", "Enabled", true, "Real-clock day/night cycle: 'Noon at minute' of every hour is high noon and one full day lasts 'Cycle minutes'. With the current defaults (0/60), a full day matches one real hour. Overrides the static sun elevation/azimuth while active.");
		_cycleMinutes = ((BaseUnityPlugin)this).Config.Bind<float>("Day cycle", "Cycle minutes", 60f, "Length of one full day-night cycle in real minutes (5-1440). 1440 follows a full real day.");
		_noonMinute = ((BaseUnityPlugin)this).Config.Bind<float>("Day cycle", "Noon at minute", 0f, "Minute of the hour that counts as high noon.");
		_maxElevation = ((BaseUnityPlugin)this).Config.Bind<float>("Day cycle", "Max sun elevation", 80f, "Sun height above the horizon at noon, in degrees (20-80). Higher noon sun keeps shadows short.");
		_nightBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Day cycle", "Night brightness", 0.58f, "0-1. Moonlight intensity relative to daylight, so nights stay cozy instead of pitch black.");
		_minimumNightLight = ((BaseUnityPlugin)this).Config.Bind<float>("Day cycle", "Minimum visible night light", 0.34f, "0-1. Main-light floor after moon phase and rain multipliers. Keeps characters, trees and paths readable during rainy new-moon nights without removing night color or lamp contrast.");
		_nightExposureDip = ((BaseUnityPlugin)this).Config.Bind<float>("Day cycle", "Night exposure dip", -0.12f, "Extra post exposure in EV applied at deep night. This darkens EVERYTHING on screen - including water, chalkboards and other glowing unlit materials that ignore the sun.");
		_lampsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Lamps", "Enabled", true, "EXPERIMENTAL: attaches warm point lights to lamp/lantern objects, lit automatically at dusk and night (needs the day cycle). Only works if the game's shaders support additional lights - check the ADDITIONAL LIGHTS log line.");
		_lampKeywords = ((BaseUnityPlugin)this).Config.Bind<string>("Lamps", "Name keywords", "lamp,lantern,streetlight,street_light,lamppost", "Comma-separated name fragments used to recognize lamp objects. The last run only found 5 lamps, so if some street lights stay dark, add a fragment of their object name here and press F4. 'lighthouse' is always excluded.");
		_lampStyle = ((BaseUnityPlugin)this).Config.Bind<string>("Lamps", "Style", "Both", "Light = real point lights that illuminate surroundings; Halo = a cartoon glow sprite on the lamp itself, matching the vanilla art style; Both = the two combined.");
		_maxLitLamps = ((BaseUnityPlugin)this).Config.Bind<int>("Lamps", "Max lit lamps", 128, "Only the N nearest local lights (lamps and hanging string bulbs) are active at once. Range: 1-256. Halos remain visible on every recognized light.");
		_haloSize = ((BaseUnityPlugin)this).Config.Bind<float>("Lamps", "Halo size", 1.3f, "Diameter of the glow sprite in world units.");
		_lampRange = ((BaseUnityPlugin)this).Config.Bind<float>("Lamps", "Range", 9f, "Point light range in world units.");
		_lampIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("Lamps", "Intensity", 3.5f, "Point light intensity at deep night.");
		_deckStringLightsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Lamps", "Colorful hanging string lights", true, "Adds point lights and visible halos to the original Tool Shop deck-light bulbs. Their colors travel smoothly through a rainbow at night.");
		_deckStringLightRange = ((BaseUnityPlugin)this).Config.Bind<float>("Lamps", "Hanging string light range", 2f, "2-12. Point-light range for each hanging bulb.");
		_deckStringLightIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("Lamps", "Hanging string light intensity", 0.2f, "0-5. Brightness for each hanging bulb before the shared local-light budget is applied.");
		_deckStringColorCycleSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Lamps", "Hanging string color cycle seconds", 18f, "4-90. Seconds for the hanging bulbs to complete one smooth rainbow cycle.");
		_deskLampRange = ((BaseUnityPlugin)this).Config.Bind<float>("Lamps", "Desk lamp range", 3f, "1-8. Range of the dedicated player-desk and library-table lamp lights.");
		_deskLampIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("Lamps", "Desk lamp intensity", 0.42f, "0-3. Brightness of the dedicated player-desk and library-table lamp lights at deep night.");
		_campfireLightsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Lamps", "Permanent campfire lights", true, "Adds real orange point lights to the two native CampFire roots. They remain on during the day at reduced intensity, reserve two slots in the shared local-light budget, and make the native Fire Red/Fire Yellow flame meshes emissive.");
		_treeLanternLightsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Lamps", "Wicker hanging lantern lights", true, "Adds warm-white light only to the small woven hanging lamps under the large tree and by the canteen. Swings and coloured string bulbs are not affected.");
		_playTowerSunLightEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Lamps", "Play Tower sun lamp", true, "Adds a warm-yellow point light to the native MD_PlayTower_PlanetSun ornament.");
		_deviceScreensGlow = ((BaseUnityPlugin)this).Config.Bind<bool>("Lamps", "Personal device screen glow", true, "Adds a subtle self-lit look to the player's phone, laptop, and handheld game-console screens.");
		_waterDaylight = ((BaseUnityPlugin)this).Config.Bind<bool>("Water", "Match water to daylight", true, "Water uses unlit materials that ignore the sun and glow at night. This drives the water material colors with the day cycle instead: dark and blue-shifted at night, untouched at noon, so sea and sky stay in the same palette.");
		_nightWaterBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Water", "Night water brightness", 0.09f, "0-1. Water body brightness at deep night relative to daytime. Rain applies an additional body-only reduction so the sea stays below its wave highlights.");
		_dayWaterPatternColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Water", "Day water pattern color", new Color(0.78f, 0.88f, 0.92f, 1f), "RGB color used by sea, fountain and waterfall patterns in full daylight. It blends smoothly with the night pattern color through dawn and dusk.");
		_nightWaterPatternColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Water", "Night water pattern color", new Color(0.25f, 0.33f, 0.42f, 1f), "RGB color used by sea, fountain and waterfall patterns at deep night. Adjust it from the F11 menu while viewing the water; changes are saved and shown immediately.");
		_waterWaveBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Water", "Wave brightness above surface", 1.1f, "Final brightness multiplier for the selected water-pattern colors. It is independent of dark water-body colors so ocean, fountain and waterfall patterns cannot turn black at night.");
		_nightWaterfallFoamBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Water", "Night waterfall foam brightness", 0.55f, "Brightness of actual fountain and waterfall spray particles at deep night. Only the particle start color is adjusted; the original particle materials remain untouched.");
		_waterReflections = ((BaseUnityPlugin)this).Config.Bind<bool>("Water", "Real water reflections", true, "Enables the water system's own planar reflection renderer for the main sea, including the sky and dawn/dusk colors. Uses a reduced reflection resolution to limit performance cost.");
		_waterShadowOverlayEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Water", "Directional shadow overlay", true, "Adds a transparent real-shadow receiver over the original horizontal water mesh. The native Stylized Water material, including waves, foam and reflections, is left unchanged.");
		_waterShadowOverlayStrength = ((BaseUnityPlugin)this).Config.Bind<float>("Water", "Directional shadow overlay strength", 0.36f, "0.02-0.60. Opacity of the additional receiver: lower is subtler, higher makes sun shadows on water easier to read.");
		_decorDimming = ((BaseUnityPlugin)this).Config.Bind<bool>("Decor", "Dim light-ignoring decor at night", true, "Ground flowers, grass tufts and some other props use materials that ignore the sun entirely (UTS light-color binding off, or unlit shaders), so they keep full daytime brightness and appear to glow in the dark. This drives their colors with the day cycle, like the water. Matched materials are listed in the log as DECOR lines.");
		_nightDecorBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Decor", "Night decor brightness", 0.55f, "0-1. Brightness of these props at deep night relative to daytime. These materials cannot receive lamp light, so anywhere near a lit lamp they read darker than their surroundings - keep this well above the water's night brightness.");
		_decorExcludeKeywords = ((BaseUnityPlugin)this).Config.Bind<string>("Decor", "Exclude keywords", "", "Comma-separated material-name fragments that should be left untouched (keep glowing at night). Check the DECOR log lines for the exact material names.");
		_toonShading = ((BaseUnityPlugin)this).Config.Bind<bool>("Shading", "Boost toon shadow contrast", true, "Improves light and shadow definition on scenery and characters while preserving their colors.");
		_shadeDarkness = ((BaseUnityPlugin)this).Config.Bind<float>("Shading", "Shade darkness", 0.66f, "Shadowed areas show the base color multiplied by this factor. Lower = darker, higher-contrast shadows. 1 restores the (invisible) vanilla look.");
		_surfaceShadeStep = ((BaseUnityPlugin)this).Config.Bind<float>("Shading", "Main island surface shade step", 0.42f, "Controls how clearly shadows appear on the main island when the sun is low.");
		_surfaceNoonShadeStep = ((BaseUnityPlugin)this).Config.Bind<float>("Shading", "Main island noon shade step", 0.8f, "Controls how clearly soft shadows appear on the main island around noon.");
		_surfaceSystemShadowLevel = ((BaseUnityPlugin)this).Config.Bind<float>("Shading", "Main island system shadow level", -0.12f, "Fine adjustment for keeping shadows consistent across grass, paths, and roads (-0.5 to 0.5).");
		_playerShadeDarkness = ((BaseUnityPlugin)this).Config.Bind<float>("Shading", "Player shade darkness", 0.83f, "0.3-1. Player-only shade brightness. Kept higher than world shadows so faces and clothing do not turn into a flat dark silhouette.");
		_playerSystemShadowLevel = ((BaseUnityPlugin)this).Config.Bind<float>("Shading", "Player system shadow level", -0.05f, "Fine adjustment for shadow visibility on characters only (-0.5 to 0.5).");
		_playerShadeStep = ((BaseUnityPlugin)this).Config.Bind<float>("Shading", "Player shade step", 0.45f, "Controls how much of a character is covered by the darker shade (0-1). Lower values keep faces brighter.");
		_ambientCoolShift = ((BaseUnityPlugin)this).Config.Bind<float>("Ambient", "Cool shift", 0.16f, "0-1. Nudges ambient light (what fills the shadows) toward a cooler blue-gray.");
		_ambientIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("Ambient", "Intensity multiplier", 1f, "Multiplier for ambient light intensity.");
		_natureAmbienceEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Nature ambience", "Enabled", true, "Plays quiet CC0 outdoor ambience that follows the Day and Night cycle. All bundled sources and license links are documented in audio/THIRD_PARTY_AUDIO.md.");
		_noonCicadaVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Nature ambience", "Noon cicada volume", 0.055f, "0-1. Stereo cicada bed near high noon. The source recording is naturally loud, so the default is deliberately low enough to sit behind work and conversation audio.");
		_nightNatureVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Nature ambience", "Night insects and frogs volume", 0.06f, "0-1. Long rural-night recording with field crickets and occasional frogs at deep night.");
		_natureFadeSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Nature ambience", "Transition seconds", 12f, "Seconds used to fade nature beds in and out. Twilight stays mostly quiet between them.");
		_rainNatureMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Nature ambience", "Rain volume multiplier", 0.18f, "0-1. Remaining nature-bed volume under full rain, keeping rain from becoming a noisy wall.");
		_configMenuEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Interface", "Enable in-game config menu", true, "Enables the in-game settings menu. Changes are saved and applied automatically.");
		_configMenuKey = ((BaseUnityPlugin)this).Config.Bind<string>("Interface", "Config menu key", "F11", "Keyboard key used to open or close the settings menu. Esc also closes it.");
		_configMenuLanguage = ((BaseUnityPlugin)this).Config.Bind<string>("Interface", "Menu language", "Auto", "Language used by the in-game settings menu: Auto, Chinese, English or Japanese.");
		EnsureChineseConfigNotes();
		RefreshWeatherConfig();
		SceneManager.sceneLoaded += OnSceneLoaded;
		RenderPipelineManager.beginCameraRendering += OnBeginCameraRendering;
		ScheduleApply(6f);
		((BaseUnityPlugin)this).Logger.LogInfo((object)string.Concat("On-Together: Day and Night 1.0.0 loaded. F4: reload config  F5: toggle sky  F6: toggle grading  ", _weatherToggleKey, ": toggle rain  ", _configMenuKeyCode, ": config menu"));
	}

	private void OnDestroy()
	{
		if (_configMenuVisible)
		{
			RestoreCursorAfterMenu();
		}
		if (_ownsConfigMenuFont && (Object)(object)_configMenuFont != (Object)null)
		{
			Object.Destroy((Object)(object)_configMenuFont);
		}
		SceneManager.sceneLoaded -= OnSceneLoaded;
		RenderPipelineManager.beginCameraRendering -= OnBeginCameraRendering;
		RestoreSky();
		RestoreAmbient();
		RestoreSun();
		RestoreShadowAntialiasing();
		RestoreShadowCasting();
		RestoreVanillaClouds();
		RestoreWaterParticles();
		RestoreWaterReflections();
		ClearWaterShadowOverlays();
		RestoreWeather();
		RestoreNatureAudio();
		ClearLamps();
		RestoreCampfireEmission();
		RestoreDeviceScreenGlow();
		RestoreWaterMaterials();
		RestoreDecorMaterials();
		RestoreToonShading();
		DestroyMoon();
		DestroySunsetGlow();
		DestroyStars();
		DestroyMeteor();
		if ((Object)(object)_starTexture != (Object)null)
		{
			Object.Destroy((Object)(object)_starTexture);
		}
		ClearClouds();
		if ((Object)(object)_cloudMaterial != (Object)null)
		{
			Object.Destroy((Object)(object)_cloudMaterial);
		}
		RestoreColorGradingMode();
		if ((Object)(object)_volumeObject != (Object)null)
		{
			Object.Destroy((Object)(object)_volumeObject);
		}
		if ((Object)(object)_profile != (Object)null)
		{
			Object.Destroy((Object)(object)_profile);
		}
	}

	private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		RestoreShadowAntialiasing();
		RestoreCameraSkyboxes();
		RestoreShadowCasting();
		RestoreVanillaClouds();
		ClearWaterShadowOverlays();
		RestoreCampfireEmission();
		RestoreDeviceScreenGlow();
		_weatherFogCaptured = false;
		_skyApplied = false;
		_skyRuntimeEnabled = false;
		_ambientCaptured = false;
		_originalSkybox = null;
		_sunCaptured = false;
		_sunLight = null;
		_playerDiagnosticsWritten = false;
		ClearLamps();
		ClearClouds();
		ClearStormClouds();
		_celestialValid = false;
		_worldSceneReady = false;
		_nextWorldProbe = 0f;
		HideCelestialVisuals();
		ScheduleApply(6f);
	}

	private void Update()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_022e: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)285))
		{
			ReloadConfigFromDisk();
		}
		if (_configMenuEnabled.Value && Input.GetKeyDown(_configMenuKeyCode))
		{
			ToggleConfigMenu();
		}
		if (_configMenuVisible && Input.GetKeyDown((KeyCode)27))
		{
			ToggleConfigMenu();
		}
		if (Input.GetKeyDown((KeyCode)286))
		{
			ToggleSky();
		}
		if (Input.GetKeyDown((KeyCode)287) && (Object)(object)_volume != (Object)null)
		{
			((Behaviour)_volume).enabled = !((Behaviour)_volume).enabled;
			((BaseUnityPlugin)this).Logger.LogInfo((object)("GRADING " + (((Behaviour)_volume).enabled ? "ON" : "OFF")));
		}
		if (_weatherEnabled.Value && Input.GetKeyDown(_weatherToggleKey))
		{
			SetRainTarget(!_rainTarget, manual: true);
		}
		if (_hotConfigDirty && Time.unscaledTime >= _hotConfigApplyAt)
		{
			_hotConfigDirty = false;
			((BaseUnityPlugin)this).Config.Save();
			EnsureChineseConfigNotes();
			RefreshWeatherConfig();
			RestoreAmbient();
			_ambientCaptured = false;
			ScheduleApply(0.05f);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"LIVE CONFIG saved and reapplied.");
		}
		UpdateWeather();
		UpdateDayCycle();
		UpdateDeviceScreenLights();
		UpdateNatureAmbience();
		UpdateMoonVisual();
		UpdateClouds();
		if (!_dayCycleEnabled.Value)
		{
			HideCelestialVisuals();
		}
		if (_lampsEnabled.Value && Time.unscaledTime >= _nextLampUpdate)
		{
			_nextLampUpdate = Time.unscaledTime + 1.5f;
			ScanForNewLamps(initialScan: false);
			if (Time.unscaledTime >= _nextSceneFeatureLampRescan)
			{
				_nextSceneFeatureLampRescan = Time.unscaledTime + 5f;
				AddSceneFeatureLights();
			}
			UpdateLampSelection();
		}
		if (_lampHalos.Count > 0 && _lampWeight > 0.01f)
		{
			Camera main = Camera.main;
			if ((Object)(object)main != (Object)null)
			{
				Quaternion rotation = ((Component)main).transform.rotation;
				for (int i = 0; i < _lampHalos.Count; i++)
				{
					if ((Object)(object)_lampHalos[i] != (Object)null)
					{
						_lampHalos[i].rotation = rotation;
					}
				}
			}
		}
		if (_adjustSun.Value && Time.unscaledTime >= _nextShadowRescan)
		{
			_nextShadowRescan = Time.unscaledTime + 60f;
			ApplyShadowCasting();
		}
		if (_hideVanillaClouds.Value && Time.unscaledTime >= _nextVanillaCloudScan)
		{
			_nextVanillaCloudScan = Time.unscaledTime + 5f;
			ApplyVanillaCloudHiding();
		}
		if (_decorDimming.Value && _worldSceneReady && Time.unscaledTime >= _nextDecorRescan)
		{
			_nextDecorRescan = Time.unscaledTime + 10f;
			ScanDecorMaterials();
		}
		if (_waterDaylight.Value && _worldSceneReady && Time.unscaledTime >= _nextWaterEffectScan)
		{
			_nextWaterEffectScan = Time.unscaledTime + 10f;
			ScanWaterParticles();
			EnsureWaterReflections();
			EnsureWaterShadowOverlays();
		}
		if (_adjustSun.Value && Time.unscaledTime >= _nextPlayerShadowRefresh)
		{
			_nextPlayerShadowRefresh = Time.unscaledTime + 2f;
			ApplyPlayerShadows();
		}
	}

	private void ReloadConfigFromDisk()
	{
		((BaseUnityPlugin)this).Config.Reload();
		EnsureChineseConfigNotes();
		RefreshWeatherConfig();
		RestoreAmbient();
		_ambientCaptured = false;
		ScheduleApply(0.1f);
		if (!_configMenuEnabled.Value && _configMenuVisible)
		{
			ToggleConfigMenu();
		}
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Config reloaded from disk, reapplying.");
	}

	private void QueueHotConfigApply()
	{
		_hotConfigDirty = true;
		_hotConfigApplyAt = Time.unscaledTime + 0.25f;
	}

	private void ApplyHotConfigNow()
	{
		_hotConfigDirty = false;
		((BaseUnityPlugin)this).Config.Save();
		EnsureChineseConfigNotes();
		RefreshWeatherConfig();
		RestoreAmbient();
		_ambientCaptured = false;
		ScheduleApply(0.05f);
		((BaseUnityPlugin)this).Logger.LogInfo((object)"LIVE CONFIG applied from menu.");
	}

	private void EnsureChineseConfigNotes()
	{
		try
		{
			string configFilePath = ((BaseUnityPlugin)this).Config.ConfigFilePath;
			if (string.IsNullOrEmpty(configFilePath) || !File.Exists(configFilePath))
			{
				return;
			}
			List<string> list = new List<string>(File.ReadAllLines(configFilePath));
			bool flag = false;
			bool flag2 = false;
			for (int i = 0; i < Mathf.Min(8, list.Count); i++)
			{
				if (list[i].StartsWith("## 中文提示", StringComparison.Ordinal))
				{
					flag2 = true;
					break;
				}
			}
			if (!flag2)
			{
				list.Insert(Mathf.Min(2, list.Count), "## 中文提示:游戏内按 F11 打开多语言实时设置;修改配置文件后按 F4 可重新读取。");
				flag = true;
			}
			for (int num = list.Count - 1; num >= 0; num--)
			{
				string text = list[num].Trim();
				if (text.Length >= 3 && text[0] == '[' && text[text.Length - 1] == ']')
				{
					string section = text.Substring(1, text.Length - 2);
					string text2 = ChineseSectionNote(section);
					if (text2 != null)
					{
						bool flag3 = false;
						for (int j = num + 1; j < Mathf.Min(list.Count, num + 5); j++)
						{
							if (list[j] == text2 || list[j].StartsWith("## 中文:", StringComparison.Ordinal))
							{
								flag3 = true;
								break;
							}
						}
						if (!flag3)
						{
							list.Insert(num + 1, text2);
							list.Insert(num + 1, "");
							flag = true;
						}
					}
				}
			}
			if (flag)
			{
				File.WriteAllLines(configFilePath, list.ToArray());
			}
		}
		catch (Exception ex)
		{
			((BaseUnityPlugin)this).Logger.LogWarning((object)("Could not add Chinese config notes: " + ex.GetType().Name));
		}
	}

	private static string ChineseSectionNote(string section)
	{
		return section switch
		{
			"Ambient" => "## 中文:环境光的冷暖与整体亮度。", 
			"Clouds" => "## 中文:模组卡通云、移动速度、尺寸、阴影与原版主世界云隐藏。", 
			"Day cycle" => "## 中文:按现实时间运行的昼夜循环、周期和日夜亮度。", 
			"Decor" => "## 中文:夜间压暗不受光照影响的花草和装饰材质。", 
			"Grading" => "## 中文:白平衡、曝光、对比度、饱和度与后处理开关。", 
			"Interface" => "## 中文:游戏内实时配置菜单与快捷键。", 
			"Lamps" => "## 中文:夜间路灯点光与卡通光晕。", 
			"Nature ambience" => "## 中文:正午蝉鸣、夜间虫蛙声及雨天音量衰减。", 
			"Shading" => "## 中文:主岛与人物的阴影清晰度和明暗层次。", 
			"Sky" => "## 中文:自定义天空、太阳、月相、暮光与星空。", 
			"Sun" => "## 中文:太阳角度、亮度、阴影距离和质量。", 
			"Water" => "## 中文:海面、波纹、瀑布水花在昼夜及雨天中的亮度。", 
			"Weather" => "## 中文:随机或手动雨天、过渡、雨滴、雨声与雷声。F10 手动切换下雨。", 
			_ => null, 
		};
	}

	private void ToggleConfigMenu()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		_configMenuVisible = !_configMenuVisible;
		if (_configMenuVisible)
		{
			_cursorLockBeforeMenu = Cursor.lockState;
			_cursorVisibleBeforeMenu = Cursor.visible;
			Cursor.lockState = (CursorLockMode)0;
			Cursor.visible = true;
		}
		else
		{
			RestoreCursorAfterMenu();
		}
		((BaseUnityPlugin)this).Logger.LogInfo((object)("CONFIG MENU " + (_configMenuVisible ? "OPEN" : "CLOSED")));
	}

	private void RestoreCursorAfterMenu()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Cursor.lockState = _cursorLockBeforeMenu;
		Cursor.visible = _cursorVisibleBeforeMenu;
	}

	private void EnsureConfigMenuStyles()
	{
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Expected O, but got Unknown
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Expected O, but got Unknown
		//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Expected O, but got Unknown
		//IL_0242: Unknown result type (might be due to invalid IL or missing references)
		if (_menuTitleStyle != null)
		{
			return;
		}
		Font[] array = Resources.FindObjectsOfTypeAll<Font>();
		foreach (Font val in array)
		{
			if ((Object)(object)val != (Object)null && val.HasCharacter('中') && val.HasCharacter('あ'))
			{
				_configMenuFont = val;
				break;
			}
		}
		if ((Object)(object)_configMenuFont == (Object)null)
		{
			try
			{
				_configMenuFont = Font.CreateDynamicFontFromOSFont(new string[4] { "Microsoft YaHei UI", "Yu Gothic UI", "Meiryo UI", "Arial Unicode MS" }, 16);
				_ownsConfigMenuFont = (Object)(object)_configMenuFont != (Object)null;
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)("Chinese config-menu font fallback failed: " + ex.GetType().Name));
			}
		}
		_menuTitleStyle = new GUIStyle(GUI.skin.label);
		_menuTitleStyle.font = _configMenuFont;
		_menuTitleStyle.fontSize = 18;
		_menuTitleStyle.fontStyle = (FontStyle)1;
		_menuTitleStyle.normal.textColor = new Color(0.94f, 0.97f, 1f, 1f);
		_menuSectionStyle = new GUIStyle(GUI.skin.label);
		_menuSectionStyle.font = _configMenuFont;
		_menuSectionStyle.fontSize = 16;
		_menuSectionStyle.fontStyle = (FontStyle)1;
		_menuSectionStyle.normal.textColor = new Color(0.72f, 0.88f, 1f, 1f);
		_menuNoteStyle = new GUIStyle(GUI.skin.label);
		_menuNoteStyle.font = _configMenuFont;
		_menuNoteStyle.fontSize = 12;
		_menuNoteStyle.wordWrap = true;
		_menuNoteStyle.normal.textColor = new Color(0.76f, 0.8f, 0.86f, 1f);
		_menuValueStyle = new GUIStyle(GUI.skin.label);
		_menuValueStyle.font = _configMenuFont;
		_menuValueStyle.alignment = (TextAnchor)5;
		_menuValueStyle.normal.textColor = Color.white;
	}

	private void OnGUI()
	{
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Expected O, but got Unknown
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		if (_configMenuVisible && _configMenuEnabled.Value)
		{
			EnsureConfigMenuStyles();
			((Rect)(ref _configMenuRect)).width = Mathf.Min(680f, Mathf.Max(420f, (float)Screen.width - 40f));
			((Rect)(ref _configMenuRect)).height = Mathf.Min(700f, Mathf.Max(360f, (float)Screen.height - 40f));
			Color backgroundColor = GUI.backgroundColor;
			Font font = GUI.skin.font;
			if ((Object)(object)_configMenuFont != (Object)null)
			{
				GUI.skin.font = _configMenuFont;
			}
			GUI.backgroundColor = new Color(0.34f, 0.43f, 0.58f, 0.98f);
			_configMenuRect = GUILayout.Window(190019, _configMenuRect, new WindowFunction(DrawConfigMenuWindow), "On-Together: Day and Night 1.0.0  " + MenuText("实时设置"), (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(((Rect)(ref _configMenuRect)).width),
				GUILayout.Height(((Rect)(ref _configMenuRect)).height)
			});
			GUI.backgroundColor = backgroundColor;
			GUI.skin.font = font;
			((Rect)(ref _configMenuRect)).x = Mathf.Clamp(((Rect)(ref _configMenuRect)).x, 0f, Mathf.Max(0f, (float)Screen.width - ((Rect)(ref _configMenuRect)).width));
			((Rect)(ref _configMenuRect)).y = Mathf.Clamp(((Rect)(ref _configMenuRect)).y, 0f, Mathf.Max(0f, (float)Screen.height - ((Rect)(ref _configMenuRect)).height));
		}
	}

	private void DrawConfigMenuWindow(int windowId)
	{
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0240: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.Label(MenuText("修改后会自动保存并立即应用;按 F11 或 Esc 关闭。"), _menuTitleStyle, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(MenuText("这里提供常用设置;更多选项仍可在配置文件中修改,并用 F4 重新读取。"), _menuNoteStyle, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Space(5f);
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(MenuText("语言"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) });
		DrawLanguageButton("Auto", MenuText("自动"));
		DrawLanguageButton("Chinese", "中文");
		DrawLanguageButton("English", "English");
		DrawLanguageButton("Japanese", "日本語");
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		DrawMenuTab(0, "常用");
		DrawMenuTab(1, "天空与光照");
		DrawMenuTab(2, "天气与云");
		DrawMenuTab(3, "画面");
		GUILayout.EndHorizontal();
		GUILayout.Space(5f);
		_configMenuScroll = GUILayout.BeginScrollView(_configMenuScroll, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(Mathf.Max(230f, ((Rect)(ref _configMenuRect)).height - 190f)) });
		if (_configMenuTab == 0)
		{
			DrawCommonConfigTab();
		}
		else if (_configMenuTab == 1)
		{
			DrawSkyConfigTab();
		}
		else if (_configMenuTab == 2)
		{
			DrawWeatherConfigTab();
		}
		else
		{
			DrawGradingConfigTab();
		}
		GUILayout.EndScrollView();
		GUILayout.Space(5f);
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (GUILayout.Button(MenuText("保存并立即应用"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
		{
			ApplyHotConfigNow();
		}
		if (GUILayout.Button(MenuText("从配置文件重新读取 (F4)"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
		{
			ReloadConfigFromDisk();
		}
		if (GUILayout.Button(MenuText("关闭"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
		{
			ToggleConfigMenu();
		}
		GUILayout.EndHorizontal();
		GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _configMenuRect)).width, 28f));
	}

	private void DrawMenuTab(int index, string label)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		bool flag = _configMenuTab == index;
		Color backgroundColor = GUI.backgroundColor;
		if (flag)
		{
			GUI.backgroundColor = new Color(0.4f, 0.68f, 0.88f, 1f);
		}
		if (GUILayout.Button(MenuText(label), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }))
		{
			_configMenuTab = index;
			_configMenuScroll = Vector2.zero;
		}
		GUI.backgroundColor = backgroundColor;
	}

	private void DrawLanguageButton(string value, string label)
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		bool flag = string.Equals(_configMenuLanguage.Value, value, StringComparison.OrdinalIgnoreCase);
		Color backgroundColor = GUI.backgroundColor;
		if (flag)
		{
			GUI.backgroundColor = new Color(0.4f, 0.68f, 0.88f, 1f);
		}
		if (GUILayout.Button(label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
		{
			_configMenuLanguage.Value = value;
			((BaseUnityPlugin)this).Config.Save();
			EnsureChineseConfigNotes();
		}
		GUI.backgroundColor = backgroundColor;
	}

	private int GetMenuLanguage()
	{
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		switch ((_configMenuLanguage.Value ?? "Auto").Trim().ToLowerInvariant())
		{
		case "english":
		case "en":
			return 1;
		case "japanese":
		case "ja":
			return 2;
		case "chinese":
		case "zh":
			return 0;
		default:
		{
			string text = ((object)Application.systemLanguage).ToString().ToLowerInvariant();
			if (text.IndexOf("japanese") >= 0)
			{
				return 2;
			}
			if (text.IndexOf("chinese") >= 0)
			{
				return 0;
			}
			return 1;
		}
		}
	}

	private string MenuText(string chinese)
	{
		int menuLanguage = GetMenuLanguage();
		if (menuLanguage == 0)
		{
			return chinese;
		}
		switch (chinese)
		{
		case "实时设置":
			if (menuLanguage != 1)
			{
				return "リアルタイム設定";
			}
			return "Live Settings";
		case "修改后会自动保存并立即应用;按 F11 或 Esc 关闭。":
			if (menuLanguage != 1)
			{
				return "変更は自動で保存・反映されます。F11 または Esc で閉じます。";
			}
			return "Changes are saved and applied automatically. Press F11 or Esc to close.";
		case "这里提供常用设置;更多选项仍可在配置文件中修改,并用 F4 重新读取。":
			if (menuLanguage != 1)
			{
				return "ここでは主な設定を変更できます。詳細設定は設定ファイルで変更し、F4 で再読み込みできます。";
			}
			return "Common settings are available here. More options remain in the config file; press F4 to reload it.";
		case "语言":
			if (menuLanguage != 1)
			{
				return "言語";
			}
			return "Language";
		case "自动":
			if (menuLanguage != 1)
			{
				return "自動";
			}
			return "Auto";
		case "常用":
			if (menuLanguage != 1)
			{
				return "基本";
			}
			return "General";
		case "天空与光照":
			if (menuLanguage != 1)
			{
				return "空と照明";
			}
			return "Sky & Lighting";
		case "天气与云":
			if (menuLanguage != 1)
			{
				return "天気と雲";
			}
			return "Weather & Clouds";
		case "画面":
			if (menuLanguage != 1)
			{
				return "画面";
			}
			return "Visuals";
		case "保存并立即应用":
			if (menuLanguage != 1)
			{
				return "保存して適用";
			}
			return "Save and Apply";
		case "从配置文件重新读取 (F4)":
			if (menuLanguage != 1)
			{
				return "設定ファイルを再読込 (F4)";
			}
			return "Reload Config File (F4)";
		case "关闭":
			if (menuLanguage != 1)
			{
				return "閉じる";
			}
			return "Close";
		case "快速调整":
			if (menuLanguage != 1)
			{
				return "クイック設定";
			}
			return "Quick Adjustments";
		case "启用昼夜天空":
			if (menuLanguage != 1)
			{
				return "昼夜の空を有効化";
			}
			return "Enable Day and Night Sky";
		case "关闭后恢复原版天空;F5 也可快速对比。":
			if (menuLanguage != 1)
			{
				return "オフにすると元の空へ戻ります。F5 でもすぐに比較できます。";
			}
			return "Turn this off to restore the original sky. F5 also provides a quick comparison.";
		case "启用色彩校正":
			if (menuLanguage != 1)
			{
				return "色調補正を有効化";
			}
			return "Enable Color Adjustments";
		case "控制白平衡、曝光、对比度和阴影色调。":
			if (menuLanguage != 1)
			{
				return "ホワイトバランス、露出、コントラスト、影の色合いを調整します。";
			}
			return "Adjusts white balance, exposure, contrast, and shadow tone.";
		case "启用真实时钟昼夜循环":
			if (menuLanguage != 1)
			{
				return "リアルタイム昼夜サイクル";
			}
			return "Use Real-Time Day Cycle";
		case "保持当前按现实时间推进的昼夜循环。":
			if (menuLanguage != 1)
			{
				return "現実の時刻に合わせて昼夜が進行します。";
			}
			return "Runs the day and night cycle using the real-world clock.";
		case "白天太阳尺寸":
			if (menuLanguage != 1)
			{
				return "昼の太陽サイズ";
			}
			return "Daytime Sun Size";
		case "默认 0.028;日出/日落与白天太阳会在低空阶段平滑交接。":
			if (menuLanguage != 1)
			{
				return "初期値は 0.028。日の出と日没でも自然な大きさを保ちます。";
			}
			return "Default: 0.028. The sun keeps a consistent size through dawn and dusk.";
		case "正午太阳高度":
			if (menuLanguage != 1)
			{
				return "正午の太陽高度";
			}
			return "Noon Sun Height";
		case "正午太阳的最高高度;数值越高,影子越短。":
			if (menuLanguage != 1)
			{
				return "正午の太陽の最高高度です。高いほど影が短くなります。";
			}
			return "Sets the sun's highest point at noon. Higher values create shorter shadows.";
		case "一轮昼夜分钟数":
			if (menuLanguage != 1)
			{
				return "1日の長さ(分)";
			}
			return "Day Length (Minutes)";
		case "现实时间中一整个昼夜循环的长度。":
			if (menuLanguage != 1)
			{
				return "昼夜が一周するまでの現実時間(分)です。";
			}
			return "Length of one full day and night cycle in real minutes.";
		case "现实时间中一整个昼夜循环的长度;1440 分钟时与现实一天同步。":
			if (menuLanguage != 1)
			{
				return "昼夜が一周するまでの現実時間です。1440分では現実の1日と同期します。";
			}
			return "Length of one full day and night cycle in real minutes. At 1440 minutes it follows the real day.";
		case "雨滴尺寸倍率":
			if (menuLanguage != 1)
			{
				return "雨粒の大きさ";
			}
			return "Raindrop Size";
		case "默认 0.72;只改变可见雨滴的尺寸。":
			if (menuLanguage != 1)
			{
				return "初期値は 0.72。落下速度を変えず、見た目の大きさだけを調整します。";
			}
			return "Default: 0.72. Changes the visible size of raindrops without changing fall speed.";
		case "雨滴密度倍率":
			if (menuLanguage != 1)
			{
				return "雨の密度";
			}
			return "Rain Density";
		case "默认 1.18;数值越高,雨量越大。":
			if (menuLanguage != 1)
			{
				return "初期値は 1.18。高くすると雨が密になり、処理負荷が増える場合があります。";
			}
			return "Default: 1.18. Higher values create heavier rain and may affect performance.";
		case "立即停止下雨":
			if (menuLanguage != 1)
			{
				return "雨をすぐ止める";
			}
			return "Stop Rain Now";
		case "立即开始下雨":
			if (menuLanguage != 1)
			{
				return "雨をすぐ降らせる";
			}
			return "Start Rain Now";
		case "天空与太阳":
			if (menuLanguage != 1)
			{
				return "空と太陽";
			}
			return "Sky and Sun";
		case "使用自定义天空":
			if (menuLanguage != 1)
			{
				return "カスタムの空を使用";
			}
			return "Use Custom Sky";
		case "启用自定义天空、太阳、月相和星空。":
			if (menuLanguage != 1)
			{
				return "カスタムの空、太陽、月の満ち欠け、星空を有効にします。";
			}
			return "Enables the custom sky, sun, moon phases, and stars.";
		case "控制白天太阳在天空中的显示大小;默认 0.028。":
			if (menuLanguage != 1)
			{
				return "昼の太陽の見た目の大きさを調整します。初期値は 0.028 です。";
			}
			return "Controls the apparent size of the daytime sun. Default: 0.028.";
		case "大气厚度":
			if (menuLanguage != 1)
			{
				return "大気の濃さ";
			}
			return "Atmosphere";
		case "越高天空越深蓝,地平线雾白也会更明显。":
			if (menuLanguage != 1)
			{
				return "高くすると空の青が深くなり、地平線の霞も明るくなります。";
			}
			return "Higher values deepen the blue sky and brighten the horizon haze.";
		case "天空曝光":
			if (menuLanguage != 1)
			{
				return "空の明るさ";
			}
			return "Sky Brightness";
		case "只影响天空盒亮度。":
			if (menuLanguage != 1)
			{
				return "空全体の明るさを調整します。";
			}
			return "Controls the overall brightness of the sky.";
		case "暮光染色强度":
			if (menuLanguage != 1)
			{
				return "朝焼け・夕焼けの色の強さ";
			}
			return "Dawn/Dusk Color Strength";
		case "日出日落时地面、建筑、人物和海面的暖色影响程度。":
			if (menuLanguage != 1)
			{
				return "日の出と日没が地面、建物、キャラクター、海を染める強さです。";
			}
			return "Controls how strongly dawn and dusk color the ground, buildings, characters, and sea.";
		case "月亮尺寸":
			if (menuLanguage != 1)
			{
				return "月の大きさ";
			}
			return "Moon Size";
		case "控制月亮在天空中的显示大小。":
			if (menuLanguage != 1)
			{
				return "空に見える月の大きさを調整します。";
			}
			return "Controls the moon's apparent size in the sky.";
		case "光照与阴影":
			if (menuLanguage != 1)
			{
				return "照明と影";
			}
			return "Lighting and Shadows";
		case "夜间月光亮度":
			if (menuLanguage != 1)
			{
				return "月明かりの明るさ";
			}
			return "Moonlight Brightness";
		case "满月相对日光的亮度。":
			if (menuLanguage != 1)
			{
				return "満月の光を昼の光と比べた明るさです。";
			}
			return "Brightness of full-moon light relative to daylight.";
		case "太阳阴影强度":
			if (menuLanguage != 1)
			{
				return "太陽の影の濃さ";
			}
			return "Sun Shadow Strength";
		case "越高,投影越深。":
			if (menuLanguage != 1)
			{
				return "高いほど影が濃くなります。";
			}
			return "Higher values create darker shadows.";
		case "正午阴影清晰度":
			if (menuLanguage != 1)
			{
				return "正午の影の見やすさ";
			}
			return "Noon Shadow Clarity";
		case "调整正午时柔和阴影的可见程度。":
			if (menuLanguage != 1)
			{
				return "正午付近の柔らかな影の見やすさを調整します。";
			}
			return "Adjusts how clearly soft shadows appear around noon.";
		case "稳定移动阴影边缘":
			if (menuLanguage != 1)
			{
				return "動く影の輪郭を安定化";
			}
			return "Stabilize Moving Shadows";
		case "让太阳保持连续移动,同时减少长阴影边缘的闪烁和波形抖动。":
			if (menuLanguage != 1)
			{
				return "太陽を滑らかに動かしたまま、長い影の輪郭のちらつきを抑えます。";
			}
			return "Keeps the sun moving continuously while reducing shimmer along long shadow edges.";
		case "水面":
			if (menuLanguage != 1)
			{
				return "水面";
			}
			return "Water";
		case "实时水面反射":
			if (menuLanguage != 1)
			{
				return "リアルタイム水面反射";
			}
			return "Real Water Reflections";
		case "让主海面真实映出天空和晨昏颜色;使用较低分辨率以控制性能开销。":
			if (menuLanguage != 1)
			{
				return "主な海面に空や朝夕の色を映します。負荷を抑えるため低めの解像度を使用します。";
			}
			return "Reflects the sky and dawn/dusk colors on the main sea at a reduced resolution.";
		case "夜间水面亮度":
			if (menuLanguage != 1)
			{
				return "夜の水面の明るさ";
			}
			return "Night Water Brightness";
		case "控制深夜海水主体的亮度。":
			if (menuLanguage != 1)
			{
				return "深夜の海面全体の明るさを調整します。";
			}
			return "Controls the main sea color at deep night.";
		case "水波纹亮度":
			if (menuLanguage != 1)
			{
				return "水面模様の明るさ";
			}
			return "Water Pattern Brightness";
		case "控制海面、喷泉和瀑布的浅色纹路;不会再跟随深色水体变黑。":
			if (menuLanguage != 1)
			{
				return "海、噴水、滝の明るい模様を調整します。暗い水面の色を引き継いで黒くなることはありません。";
			}
			return "Controls the light patterns on the sea, fountains, and waterfalls without inheriting dark water colors.";
		case "白天水波纹颜色":
			if (menuLanguage != 1)
			{
				return "昼の水面模様の色";
			}
			return "Day Water Pattern Color";
		case "夜间水波纹颜色":
			if (menuLanguage != 1)
			{
				return "夜の水面模様の色";
			}
			return "Night Water Pattern Color";
		case "白天使用的水纹颜色;昼夜交替时会自动平滑过渡。":
			if (menuLanguage != 1)
			{
				return "昼に使う水面模様の色です。朝夕は滑らかに切り替わります。";
			}
			return "Water-pattern color used in daylight. It blends smoothly during dawn and dusk.";
		case "深夜使用的水纹颜色;可一边观察水面一边实时调整。":
			if (menuLanguage != 1)
			{
				return "深夜に使う水面模様の色です。水面を見ながらリアルタイムで調整できます。";
			}
			return "Water-pattern color used at deep night. Adjust it live while viewing the water.";
		case "红":
			if (menuLanguage != 1)
			{
				return "赤";
			}
			return "Red";
		case "绿":
			if (menuLanguage != 1)
			{
				return "緑";
			}
			return "Green";
		case "蓝":
			if (menuLanguage != 1)
			{
				return "青";
			}
			return "Blue";
		case "夜间瀑布水花亮度":
			if (menuLanguage != 1)
			{
				return "夜の滝しぶきの明るさ";
			}
			return "Night Waterfall Spray";
		case "单独控制瀑布顶部和底部的水花亮度。":
			if (menuLanguage != 1)
			{
				return "滝の上部と下部にある水しぶきの明るさを個別に調整します。";
			}
			return "Separately controls spray and foam at the top and bottom of waterfalls.";
		case "降雨":
			if (menuLanguage != 1)
			{
				return "雨";
			}
			return "Rain";
		case "启用昼夜天气":
			if (menuLanguage != 1)
			{
				return "昼夜の天気を有効化";
			}
			return "Enable Day and Night Weather";
		case "总开关;关闭会平滑结束当前雨天。":
			if (menuLanguage != 1)
			{
				return "天気機能の主スイッチです。オフにすると現在の雨が自然に止みます。";
			}
			return "Master switch. Turning it off gently clears the current rain.";
		case "随机下雨":
			if (menuLanguage != 1)
			{
				return "ランダムな雨";
			}
			return "Random Rain";
		case "按配置的晴天/雨天区间自动切换。":
			if (menuLanguage != 1)
			{
				return "設定した晴天・雨天の時間に合わせて自動で切り替えます。";
			}
			return "Automatically alternates between configured clear and rainy periods.";
		case "默认 0.72;只改变雨滴大小,不改变落速。":
			if (menuLanguage != 1)
			{
				return "初期値は 0.72。落下速度を変えず、雨粒の大きさだけを調整します。";
			}
			return "Default: 0.72. Changes raindrop size without changing fall speed.";
		case "天气过渡秒数":
			if (menuLanguage != 1)
			{
				return "天気の切替時間(秒)";
			}
			return "Weather Transition (Seconds)";
		case "风暴形成与散去的渐变时间。":
			if (menuLanguage != 1)
			{
				return "雨雲が広がり、また晴れるまでの移行時間です。";
			}
			return "Time used for storms to build up and clear away.";
		case "雨天主光倍率":
			if (menuLanguage != 1)
			{
				return "雨天の明るさ";
			}
			return "Rainy-Day Light";
		case "越低,雨天越暗。":
			if (menuLanguage != 1)
			{
				return "低いほど雨天が暗くなります。";
			}
			return "Lower values make rainy weather darker.";
		case "雨声音量":
			if (menuLanguage != 1)
			{
				return "雨音の音量";
			}
			return "Rain Volume";
		case "原生雨声层的合成音量。":
			if (menuLanguage != 1)
			{
				return "ゲーム内の雨音を合わせた音量です。";
			}
			return "Controls the combined volume of the game's rain ambience.";
		case "每分钟雷声概率":
			if (menuLanguage != 1)
			{
				return "1分ごとの雷の確率";
			}
			return "Thunder Chance per Minute";
		case "短闪电与雷声的平均触发概率。":
			if (menuLanguage != 1)
			{
				return "稲光と雷鳴が発生する平均確率です。";
			}
			return "Average chance of a lightning flash and thunder sound.";
		case "云":
			if (menuLanguage != 1)
			{
				return "雲";
			}
			return "Clouds";
		case "启用昼夜云":
			if (menuLanguage != 1)
			{
				return "昼夜の雲を有効化";
			}
			return "Enable Day and Night Clouds";
		case "插件生成并随风移动的卡通云。":
			if (menuLanguage != 1)
			{
				return "風に流れる、やわらかな雰囲気の雲を追加します。";
			}
			return "Adds stylized clouds that move with the wind.";
		case "隐藏原版主世界云":
			if (menuLanguage != 1)
			{
				return "元のワールド雲を非表示";
			}
			return "Hide Original World Clouds";
		case "隐藏主世界原有的云,同时保留菜单和玩家身边的天气效果。":
			if (menuLanguage != 1)
			{
				return "ワールドに元からある雲だけを隠し、メニューやプレイヤー周辺の天気表現は残します。";
			}
			return "Hides the original world clouds while preserving menu and nearby weather effects.";
		case "云投射阴影":
			if (menuLanguage != 1)
			{
				return "雲の影";
			}
			return "Cloud Shadows";
		case "关闭可降低阴影通道开销。":
			if (menuLanguage != 1)
			{
				return "オフにすると雲の影による負荷を軽減できます。";
			}
			return "Turn this off to reduce the cost of cloud shadows.";
		case "云数量":
			if (menuLanguage != 1)
			{
				return "雲の数";
			}
			return "Cloud Count";
		case "修改后会自动重建云层。":
			if (menuLanguage != 1)
			{
				return "変更後、雲は自動で作り直されます。";
			}
			return "The cloud field is rebuilt automatically after changes.";
		case "云移动速度":
			if (menuLanguage != 1)
			{
				return "雲の移動速度";
			}
			return "Cloud Speed";
		case "单位为米/秒。":
			if (menuLanguage != 1)
			{
				return "単位はメートル毎秒です。";
			}
			return "Measured in metres per second.";
		case "云尺寸倍率":
			if (menuLanguage != 1)
			{
				return "雲の大きさ";
			}
			return "Cloud Size";
		case "所有昼夜云的整体尺寸。":
			if (menuLanguage != 1)
			{
				return "昼夜の雲全体の大きさです。";
			}
			return "Overall size of all Day and Night clouds.";
		case "色彩校正":
			if (menuLanguage != 1)
			{
				return "色調補正";
			}
			return "Color Adjustments";
		case "F6 仍可做临时 A/B 对比。":
			if (menuLanguage != 1)
			{
				return "F6 で補正前後をすぐに比較できます。";
			}
			return "F6 still provides a quick before-and-after comparison.";
		case "色温":
			if (menuLanguage != 1)
			{
				return "色温度";
			}
			return "Temperature";
		case "负值偏冷,正值偏暖。":
			if (menuLanguage != 1)
			{
				return "負の値で寒色、正の値で暖色になります。";
			}
			return "Negative values are cooler; positive values are warmer.";
		case "绿色/洋红偏移":
			if (menuLanguage != 1)
			{
				return "緑・マゼンタ補正";
			}
			return "Green / Magenta Tint";
		case "正值用于抵消草地主导的绿色偏色。":
			if (menuLanguage != 1)
			{
				return "正の値で強い緑かぶりを抑えます。";
			}
			return "Positive values reduce a strong green cast.";
		case "曝光 EV":
			if (menuLanguage != 1)
			{
				return "露出";
			}
			return "Exposure";
		case "0 保留当前高光与太阳亮度。":
			if (menuLanguage != 1)
			{
				return "0 では現在のハイライトと太陽の明るさを保ちます。";
			}
			return "Zero preserves the current highlights and sun brightness.";
		case "对比度":
			if (menuLanguage != 1)
			{
				return "コントラスト";
			}
			return "Contrast";
		case "正值增强明暗层次。":
			if (menuLanguage != 1)
			{
				return "正の値で明暗差が強くなります。";
			}
			return "Positive values increase light and dark separation.";
		case "饱和度":
			if (menuLanguage != 1)
			{
				return "彩度";
			}
			return "Saturation";
		case "0 不改变原始饱和度。":
			if (menuLanguage != 1)
			{
				return "0 では元の彩度を保ちます。";
			}
			return "Zero preserves the original saturation.";
		case "卡通阴影与环境光":
			if (menuLanguage != 1)
			{
				return "影の表現と環境光";
			}
			return "Stylized Shadows and Ambient Light";
		case "增强卡通阴影层次":
			if (menuLanguage != 1)
			{
				return "影の立体感を強調";
			}
			return "Improve Shadow Definition";
		case "增强场景和人物的明暗层次。":
			if (menuLanguage != 1)
			{
				return "風景とキャラクターの明暗を見やすくします。";
			}
			return "Improves light and shadow definition on scenery and characters.";
		case "场景阴影亮度":
			if (menuLanguage != 1)
			{
				return "風景の影の明るさ";
			}
			return "World Shadow Brightness";
		case "越低越暗;1 接近原版不明显的阴影。":
			if (menuLanguage != 1)
			{
				return "低いほど影が暗くなり、1 で元の見た目に近づきます。";
			}
			return "Lower values make shadows darker; 1 is close to the original appearance.";
		case "人物阴影亮度":
			if (menuLanguage != 1)
			{
				return "キャラクターの影の明るさ";
			}
			return "Character Shadow Brightness";
		case "单独控制人物,避免面部变成黑块。":
			if (menuLanguage != 1)
			{
				return "顔が暗くなりすぎないよう、キャラクターだけを個別に調整します。";
			}
			return "Controls characters separately to keep faces readable.";
		case "环境光冷色偏移":
			if (menuLanguage != 1)
			{
				return "環境光の寒色補正";
			}
			return "Cooler Ambient Light";
		case "让阴影区域略偏蓝灰。":
			if (menuLanguage != 1)
			{
				return "影の部分をわずかに青灰色へ寄せます。";
			}
			return "Gives shaded areas a subtle blue-grey tone.";
		case "环境光强度":
			if (menuLanguage != 1)
			{
				return "環境光の強さ";
			}
			return "Ambient Light Strength";
		case "控制填充阴影的整体环境光。":
			if (menuLanguage != 1)
			{
				return "影を照らす環境光全体の強さを調整します。";
			}
			return "Controls the ambient light that fills shaded areas.";
		case "控制阴影在水面上的可见程度;不会影响水波、泡沫或反射。其余水面细节沿用推荐值。 ":
			if (menuLanguage != 1)
			{
				return "波、泡、反射を変えず、水面上の影の見え方だけを調整します。その他の水面設定は推奨値を使います。";
			}
			return "Controls how visible shadows are on water without changing waves, foam, or reflections. Other water details use the recommended values.";
		case "水面接收太阳阴影":
			if (menuLanguage != 1)
			{
				return "水面に太陽の影を表示";
			}
			return "Water Receives Sun Shadows";
		case "在原水面上加一层透明的真实主光阴影接收层;不会改动波纹、泡沫或反射材质。":
			if (menuLanguage != 1)
			{
				return "元の波、泡、反射マテリアルを変えずに、太陽の影だけを受ける透明レイヤーを水面に追加します。";
			}
			return "Adds a transparent layer that receives real sun shadows without changing the original waves, foam, or reflection material.";
		case "水面阴影强度":
			if (menuLanguage != 1)
			{
				return "水面の影の濃さ";
			}
			return "Water Shadow Strength";
		case "启用场景灯光":
			if (menuLanguage != 1)
			{
				return "シーン照明を有効化";
			}
			return "Enable Scene Lights";
		case "启用路灯、灯笼和吊灯串的夜间局部照明。":
			if (menuLanguage != 1)
			{
				return "街灯、吊りランプ、電球の飾りに夜間の局所照明を追加します。";
			}
			return "Enables local nighttime lighting for street lamps, hanging lamps, and string lights.";
		case "同时点亮的局部光源":
			if (menuLanguage != 1)
			{
				return "同時に点灯する局所ライト";
			}
			return "Simultaneous Local Lights";
		case "距离镜头最近的这些灯会实际照亮场景;其余灯仍保留光晕。":
			if (menuLanguage != 1)
			{
				return "カメラに近いライトだけが実際に周囲を照らし、残りは見た目の光だけを保ちます。";
			}
			return "The closest lights illuminate the scene; the rest keep their visible glow.";
		case "彩色吊灯串":
			if (menuLanguage != 1)
			{
				return "色がゆっくり変わる電球飾り";
			}
			return "Color-Changing String Lights";
		case "给工具店甲板的原版吊灯串添加彩色渐变照明和光晕。":
			if (menuLanguage != 1)
			{
				return "工具店デッキにある元の電球飾りへ、ゆっくり色が変わる照明と光を追加します。";
			}
			return "Adds softly changing colored light and glow to the original string bulbs on the tool-shop deck.";
		case "篝火全天照明":
			if (menuLanguage != 1)
			{
				return "焚き火を一日中照らす";
			}
			return "Campfire Lighting All Day";
		case "篝火白天保持低亮度,夜间自动增强;火焰本体也会自发光,并始终占用两个本地光源名额。":
			if (menuLanguage != 1)
			{
				return "昼は控えめ、夜は明るく焚き火を照らします。炎も光り、近くのライト枠を常に2つ確保します。";
			}
			return "Keeps campfires faintly lit by day and brighter at night. The flame also glows, and two nearby-light slots are always reserved.";
		case "游乐塔太阳灯":
			if (menuLanguage != 1)
			{
				return "遊具タワーの太陽ランプ";
			}
			return "Play-Tower Sun Lamp";
		case "为原版太阳挂饰添加暖黄色夜间照明。":
			if (menuLanguage != 1)
			{
				return "元の太陽の飾りに、暖かな黄色の夜間照明を追加します。";
			}
			return "Adds warm yellow nighttime lighting to the original sun ornament.";
		case "路灯照明范围":
			if (menuLanguage != 1)
			{
				return "街灯の照明範囲";
			}
			return "Street-Light Range";
		case "普通路灯与场景灯的影响半径。较大的数值会明显增加光照范围。":
			if (menuLanguage != 1)
			{
				return "通常の街灯とシーンライトが届く半径です。大きいほど照らす範囲が広がります。";
			}
			return "The radius of ordinary street and scene lights. Larger values noticeably widen their coverage.";
		case "路灯照明亮度":
			if (menuLanguage != 1)
			{
				return "街灯の明るさ";
			}
			return "Street-Light Brightness";
		case "普通路灯与场景灯在深夜的亮度。":
			if (menuLanguage != 1)
			{
				return "通常の街灯とシーンライトの深夜の明るさです。";
			}
			return "Brightness of ordinary street and scene lights at deep night.";
		case "彩灯照明范围":
			if (menuLanguage != 1)
			{
				return "電球飾りの照明範囲";
			}
			return "String-Light Range";
		case "每个彩灯灯泡的影响半径。":
			if (menuLanguage != 1)
			{
				return "各色付き電球が届く半径です。";
			}
			return "The radius of each colored string-light bulb.";
		case "彩灯照明亮度":
			if (menuLanguage != 1)
			{
				return "電球飾りの明るさ";
			}
			return "String-Light Brightness";
		case "每个彩灯灯泡在深夜的亮度。":
			if (menuLanguage != 1)
			{
				return "各色付き電球の深夜の明るさです。";
			}
			return "Brightness of each colored string-light bulb at deep night.";
		case "彩灯变色周期":
			if (menuLanguage != 1)
			{
				return "電球飾りの色変化周期";
			}
			return "String-Light Color Cycle";
		case "彩灯完成一次平滑变色所需的秒数。":
			if (menuLanguage != 1)
			{
				return "電球飾りが一周分、滑らかに色を変えるまでの秒数です。";
			}
			return "Seconds the string lights take to complete one smooth color change.";
		case "书桌台灯照明范围":
			if (menuLanguage != 1)
			{
				return "デスクライトの照明範囲";
			}
			return "Desk-Lamp Range";
		case "玩家书桌和图书馆桌面台灯的影响半径。":
			if (menuLanguage != 1)
			{
				return "プレイヤーの机と図書館のテーブルライトが届く半径です。";
			}
			return "The radius of the player-desk and library-table lamps.";
		case "书桌台灯照明亮度":
			if (menuLanguage != 1)
			{
				return "デスクライトの明るさ";
			}
			return "Desk-Lamp Brightness";
		case "玩家书桌和图书馆桌面台灯在深夜的亮度。":
			if (menuLanguage != 1)
			{
				return "プレイヤーの机と図書館のテーブルライトの深夜の明るさです。";
			}
			return "Brightness of the player-desk and library-table lamps at deep night.";
		case "夜间灯光":
			if (menuLanguage != 1)
			{
				return "夜の照明";
			}
			return "Night Lighting";
		case "藤编挂灯暖白照明":
			if (menuLanguage != 1)
			{
				return "編み込み吊りランプの暖色照明";
			}
			return "Warm Woven Hanging Lamps";
		case "照亮大树下和餐厅旁的藤编小挂灯;不会影响秋千、座椅或彩灯串。":
			if (menuLanguage != 1)
			{
				return "大きな木の下と食堂横の小さな編み込み吊りランプだけを照らします。ブランコ、座席、電球の飾りは変わりません。";
			}
			return "Lights the small woven lamps below the large tree and beside the canteen; swings, seats, and string bulbs are untouched.";
		case "手机、笔记本与游戏机屏幕微光":
			if (menuLanguage != 1)
			{
				return "端末画面の微光";
			}
			return "Device Screen Glow";
		case "让手机、笔记本和手持游戏机的屏幕保持轻微可见;游戏机画面会缓慢变色并偶尔跳变。":
			if (menuLanguage != 1)
			{
				return "スマホ、ノートPC、携帯ゲーム機の画面をほのかに見せます。ゲーム機の画面はゆっくり色が変わり、ときどきゲームらしく切り替わります。";
			}
			return "Keeps phone, laptop, and handheld-console screens faintly visible; the console shifts colour with occasional game-like jumps.";
		case "环境音":
			if (menuLanguage != 1)
			{
				return "自然環境音";
			}
			return "Nature Ambience";
		case "启用自然环境音":
			if (menuLanguage != 1)
			{
				return "自然環境音を有効化";
			}
			return "Enable Nature Ambience";
		case "让蝉鸣和夜间虫鸣随昼夜平滑出现;下雨时会自动降低。 ":
			if (menuLanguage != 1)
			{
				return "蝉と夜の虫の音を昼夜に合わせて自然に切り替え、雨では自動的に小さくします。";
			}
			return "Fades cicadas and night insects in with the day cycle, then lowers them automatically in rain.";
		case "正午蝉鸣音量":
			if (menuLanguage != 1)
			{
				return "正午の蝉の音量";
			}
			return "Noon Cicada Volume";
		case "仅在接近正午时渐入,避免持续干扰。 ":
			if (menuLanguage != 1)
			{
				return "正午付近だけで徐々に聞こえるため、常に鳴り続けません。";
			}
			return "Fades in only near noon so it does not play constantly.";
		case "夜间虫鸣音量":
			if (menuLanguage != 1)
			{
				return "夜の虫の音量";
			}
			return "Night Insect Volume";
		case "夜深后渐入;与蝉鸣独立控制。 ":
			if (menuLanguage != 1)
			{
				return "夜が深くなると徐々に聞こえ、蝉とは別に調整できます。";
			}
			return "Fades in after nightfall and is controlled independently from cicadas.";
		default:
			return chinese;
		}
	}

	private void DrawCommonConfigTab()
	{
		MenuSection("快速调整");
		MenuToggle(_replaceSkybox, "启用昼夜天空", "关闭后恢复原版天空;F5 也可快速对比。");
		MenuToggle(_gradingEnabled, "启用色彩校正", "控制白平衡、曝光、对比度和阴影色调。");
		MenuToggle(_dayCycleEnabled, "启用真实时钟昼夜循环", "保持当前按现实时间推进的昼夜循环。");
		MenuSlider(_cycleMinutes, "一轮昼夜分钟数", 5f, 1440f, 0, "现实时间中一整个昼夜循环的长度;1440 分钟时与现实一天同步。");
		GUILayout.Space(8f);
		if (GUILayout.Button(MenuText(_rainTarget ? "立即停止下雨" : "立即开始下雨"), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) }))
		{
			SetRainTarget(!_rainTarget, manual: true);
		}
	}

	private void DrawSkyConfigTab()
	{
		MenuSection("天空与太阳");
		MenuToggle(_replaceSkybox, "使用自定义天空", "启用自定义天空、太阳、月相和星空。");
		MenuSlider(_sunSize, "白天太阳尺寸", 0.01f, 0.08f, 3, "控制白天太阳在天空中的显示大小;默认 0.028。");
		MenuSlider(_atmosphereThickness, "大气厚度", 0.3f, 2f, 2, "越高天空越深蓝,地平线雾白也会更明显。");
		MenuSlider(_skyExposure, "天空曝光", 0.3f, 3f, 2, "只影响天空盒亮度。");
		MenuSlider(_twilightWorldTint, "暮光染色强度", 0f, 1f, 2, "日出日落时地面、建筑、人物和海面的暖色影响程度。");
		MenuSlider(_moonSize, "月亮尺寸", 0.025f, 0.14f, 3, "控制月亮在天空中的显示大小。");
		MenuSection("光照与阴影");
		MenuSlider(_maxElevation, "正午太阳高度", 20f, 80f, 0, "正午太阳的最高高度;数值越高,影子越短。");
		MenuSlider(_nightBrightness, "夜间月光亮度", 0f, 1f, 2, "满月相对日光的亮度。");
		MenuSlider(_sunShadowStrength, "太阳阴影强度", 0f, 1f, 2, "越高,投影越深。");
		MenuSlider(_surfaceNoonShadeStep, "正午阴影清晰度", 0.3f, 1f, 2, "调整正午时柔和阴影的可见程度。");
		MenuToggle(_stabilizeShadowEdges, "稳定移动阴影边缘", "让太阳保持连续移动,同时减少长阴影边缘的闪烁和波形抖动。");
		MenuSection("水面");
		MenuToggle(_waterReflections, "实时水面反射", "让主海面真实映出天空和晨昏颜色;使用较低分辨率以控制性能开销。");
		MenuToggle(_waterShadowOverlayEnabled, "水面接收太阳阴影", "在原水面上加一层透明的真实主光阴影接收层;不会改动波纹、泡沫或反射材质。");
		MenuSlider(_waterShadowOverlayStrength, "水面阴影强度", 0.02f, 0.6f, 2, "控制阴影在水面上的可见程度;不会影响水波、泡沫或反射。其余水面细节沿用推荐值。 ");
		MenuSection("夜间灯光");
		MenuToggle(_lampsEnabled, "启用场景灯光", "启用路灯、灯笼和吊灯串的夜间局部照明。");
		MenuIntSlider(_maxLitLamps, "同时点亮的局部光源", 1, 256, "距离镜头最近的这些灯会实际照亮场景;其余灯仍保留光晕。");
		MenuSlider(_lampRange, "路灯照明范围", 2f, 25f, 1, "普通路灯与场景灯的影响半径。较大的数值会明显增加光照范围。");
		MenuSlider(_lampIntensity, "路灯照明亮度", 0f, 8f, 2, "普通路灯与场景灯在深夜的亮度。");
		MenuToggle(_deckStringLightsEnabled, "彩色吊灯串", "给工具店甲板的原版吊灯串添加彩色渐变照明和光晕。");
		MenuSlider(_deckStringLightRange, "彩灯照明范围", 2f, 12f, 1, "每个彩灯灯泡的影响半径。");
		MenuSlider(_deckStringLightIntensity, "彩灯照明亮度", 0f, 5f, 2, "每个彩灯灯泡在深夜的亮度。");
		MenuSlider(_deckStringColorCycleSeconds, "彩灯变色周期", 4f, 90f, 0, "彩灯完成一次平滑变色所需的秒数。");
		MenuSlider(_deskLampRange, "书桌台灯照明范围", 1f, 8f, 1, "玩家书桌和图书馆桌面台灯的影响半径。");
		MenuSlider(_deskLampIntensity, "书桌台灯照明亮度", 0f, 3f, 2, "玩家书桌和图书馆桌面台灯在深夜的亮度。");
		MenuToggle(_campfireLightsEnabled, "篝火全天照明", "篝火白天保持低亮度,夜间自动增强;火焰本体也会自发光,并始终占用两个本地光源名额。");
		MenuToggle(_tre