Decompiled source of LighthouseFlashlight v1.0.1

BepInEx/plugins/LighthouseFlashlight/LighthouseFlashlight.dll

Decompiled an hour ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LighthouseFlashlight")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1+060ccfbe565ca052e42d57da9d9d21437637c278")]
[assembly: AssemblyProduct("LighthouseFlashlight")]
[assembly: AssemblyTitle("LighthouseFlashlight")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LighthouseFlashlight
{
	internal sealed class LighthouseMarker : MonoBehaviour
	{
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal static class HelmetLightPatch
	{
		private sealed class LightSnapshot
		{
			public Color Color;

			public float Intensity;

			public float Range;

			public float SpotAngle;

			public float InnerSpotAngle;

			public bool HasHd;

			public float HdIntensity;

			public float VolumetricDimmer;

			public bool AffectsVolumetric;

			public float InnerSpotPercent;
		}

		private static readonly ConditionalWeakTable<Light, LightSnapshot> VanillaSnapshots = new ConditionalWeakTable<Light, LightSnapshot>();

		[HarmonyPatch("ChangeHelmetLight")]
		[HarmonyPostfix]
		private static void OnChangeHelmetLight(PlayerControllerB __instance, int lightNumber, bool enable)
		{
			if (lightNumber == 0 && !((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.helmetLight == (Object)null))
			{
				Light helmetLight = __instance.helmetLight;
				LightSnapshot value = VanillaSnapshots.GetValue(helmetLight, CaptureSnapshot);
				bool flag = IsLighthouseFlashlight(__instance.pocketedFlashlight) || IsLighthouseFlashlight(__instance.currentlyHeldObjectServer);
				if (enable && flag)
				{
					LighthouseSetup.ApplyBeamSettings(helmetLight, Plugin.ModConfig);
				}
				else
				{
					RestoreSnapshot(helmetLight, value);
				}
			}
		}

		private static bool IsLighthouseFlashlight(GrabbableObject? item)
		{
			if ((Object)(object)item != (Object)null)
			{
				return (Object)(object)((Component)item).GetComponent<LighthouseMarker>() != (Object)null;
			}
			return false;
		}

		private static LightSnapshot CaptureSnapshot(Light light)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			LightSnapshot lightSnapshot = new LightSnapshot
			{
				Color = light.color,
				Intensity = light.intensity,
				Range = light.range,
				SpotAngle = light.spotAngle,
				InnerSpotAngle = light.innerSpotAngle
			};
			HDAdditionalLightData component = ((Component)light).GetComponent<HDAdditionalLightData>();
			if ((Object)(object)component != (Object)null)
			{
				lightSnapshot.HasHd = true;
				lightSnapshot.HdIntensity = component.intensity;
				lightSnapshot.VolumetricDimmer = component.volumetricDimmer;
				lightSnapshot.AffectsVolumetric = component.affectsVolumetric;
				lightSnapshot.InnerSpotPercent = component.innerSpotPercent;
			}
			return lightSnapshot;
		}

		private static void RestoreSnapshot(Light light, LightSnapshot snap)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			light.color = snap.Color;
			light.intensity = snap.Intensity;
			light.range = snap.Range;
			light.spotAngle = snap.SpotAngle;
			light.innerSpotAngle = snap.InnerSpotAngle;
			HDAdditionalLightData component = ((Component)light).GetComponent<HDAdditionalLightData>();
			if ((Object)(object)component != (Object)null && snap.HasHd)
			{
				component.intensity = snap.HdIntensity;
				component.volumetricDimmer = snap.VolumetricDimmer;
				component.affectsVolumetric = snap.AffectsVolumetric;
				component.innerSpotPercent = snap.InnerSpotPercent;
			}
		}
	}
	[HarmonyPatch(typeof(GameNetworkManager))]
	internal static class LighthouseSetup
	{
		private const string PrefabName = "LighthouseFlashlightPrefab";

		private static bool _registered;

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OnGameNetworkManagerStart()
		{
			if (_registered)
			{
				return;
			}
			try
			{
				GameObject val = FindProFlashlightPrefab();
				if ((Object)(object)val == (Object)null)
				{
					Plugin.Log.LogError((object)"Could not find the vanilla Pro-flashlight network prefab.");
					return;
				}
				RegisterLighthouseFlashlight(val);
				_registered = true;
			}
			catch (Exception arg)
			{
				Plugin.Log.LogError((object)$"Failed to register Lighthouse Flashlight: {arg}");
			}
		}

		private static GameObject? FindProFlashlightPrefab()
		{
			NetworkManager singleton = NetworkManager.Singleton;
			if (!((Object)(object)singleton == (Object)null))
			{
				NetworkConfig networkConfig = singleton.NetworkConfig;
				object obj;
				if (networkConfig == null)
				{
					obj = null;
				}
				else
				{
					NetworkPrefabs prefabs = networkConfig.Prefabs;
					obj = ((prefabs != null) ? prefabs.Prefabs : null);
				}
				if (obj != null)
				{
					foreach (NetworkPrefab prefab in singleton.NetworkConfig.Prefabs.Prefabs)
					{
						GameObject val = prefab?.Prefab;
						if (!((Object)(object)val == (Object)null))
						{
							FlashlightItem component = val.GetComponent<FlashlightItem>();
							if (!((Object)(object)component == (Object)null) && !((Object)(object)((GrabbableObject)component).itemProperties == (Object)null) && (component.flashlightTypeID == 0 || string.Equals(((GrabbableObject)component).itemProperties.itemName, "Pro-flashlight", StringComparison.OrdinalIgnoreCase)))
							{
								return val;
							}
						}
					}
					return null;
				}
			}
			return null;
		}

		private static void RegisterLighthouseFlashlight(GameObject proPrefab)
		{
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			ModConfig modConfig = Plugin.ModConfig;
			GameObject val = NetworkPrefabs.CloneNetworkPrefab(proPrefab, "LighthouseFlashlightPrefab");
			if ((Object)(object)NetworkManager.Singleton != (Object)null && !NetworkManager.Singleton.NetworkConfig.Prefabs.Contains(val))
			{
				NetworkManager.Singleton.AddNetworkPrefab(val);
			}
			FlashlightItem component = val.GetComponent<FlashlightItem>();
			Item itemProperties = ((GrabbableObject)component).itemProperties;
			Item val2 = Object.Instantiate<Item>(itemProperties);
			((Object)val2).name = "LighthouseFlashlightItem";
			val2.itemName = modConfig.ItemName.Value;
			val2.creditsWorth = Mathf.Max(0, modConfig.Price.Value);
			val2.weight = 1f + Mathf.Max(0f, modConfig.WeightLbs.Value) / 105f;
			val2.requiresBattery = true;
			val2.batteryUsage = Mathf.Max(1f, modConfig.BatteryDurationMinutes.Value * 60f);
			val2.spawnPrefab = val;
			Color val3 = ParseHexColor(modConfig.BodyColorHex.Value, new Color(1f, 0.72f, 0.84f, 1f));
			Color lightColor = ParseHexColor(modConfig.LightColorHex.Value, Color.white);
			if ((Object)(object)itemProperties.itemIcon != (Object)null)
			{
				val2.itemIcon = CreateTintedSprite(itemProperties.itemIcon, val3) ?? itemProperties.itemIcon;
			}
			((GrabbableObject)component).itemProperties = val2;
			component.flashlightTypeID = 0;
			if ((Object)(object)val.GetComponent<LighthouseMarker>() == (Object)null)
			{
				val.AddComponent<LighthouseMarker>();
			}
			ConfigureLights(component, lightColor, modConfig);
			ApplyBodyTint(component, val3);
			TerminalNode val4 = ScriptableObject.CreateInstance<TerminalNode>();
			((Object)val4).name = "LighthouseFlashlightInfo";
			val4.clearPreviousText = true;
			val4.displayText = modConfig.ItemName.Value + "\n\nHigh-output warm-rosy beam built for wide, long-range visibility.\n" + $"Battery life: {modConfig.BatteryDurationMinutes.Value:0.#} minutes.\n" + $"Weight: {modConfig.WeightLbs.Value:0.#} lbs.\n\n";
			Items.RegisterShopItem(val2, (TerminalNode)null, (TerminalNode)null, val4, val2.creditsWorth);
			Plugin.Log.LogInfo((object)($"Registered '{val2.itemName}' (Price: {val2.creditsWorth}, " + $"Weight: {modConfig.WeightLbs.Value:0.#} lbs, Battery: {modConfig.BatteryDurationMinutes.Value:0.#} min, " + $"Intensity: {modConfig.LightIntensity.Value}, Range: {modConfig.LightRange.Value}m)."));
		}

		internal static void ApplyBeamSettings(Light bulb, ModConfig cfg)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			Color color = ParseHexColor(cfg.LightColorHex.Value, new Color(1f, 0.894f, 0.925f, 1f));
			bulb.color = color;
			bulb.intensity = Mathf.Max(1f, cfg.LightIntensity.Value);
			bulb.range = Mathf.Max(1f, cfg.LightRange.Value);
			bulb.spotAngle = Mathf.Clamp(cfg.LightSpotAngle.Value, 10f, 170f);
			bulb.innerSpotAngle = Mathf.Clamp(cfg.LightInnerSpotAngle.Value, 5f, bulb.spotAngle);
			HDAdditionalLightData component = ((Component)bulb).GetComponent<HDAdditionalLightData>();
			if ((Object)(object)component != (Object)null)
			{
				component.intensity = bulb.intensity;
				component.volumetricDimmer = Mathf.Clamp(cfg.VolumetricDimmer.Value, 0f, 2f);
				component.affectsVolumetric = cfg.VolumetricDimmer.Value > 0.001f;
				component.innerSpotPercent = Mathf.Clamp(bulb.innerSpotAngle / bulb.spotAngle * 100f, 0f, 100f);
			}
		}

		private static void ConfigureLights(FlashlightItem flashlight, Color lightColor, ModConfig cfg)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)flashlight.flashlightBulb != (Object)null)
			{
				ApplyBeamSettings(flashlight.flashlightBulb, cfg);
			}
			if ((Object)(object)flashlight.flashlightBulbGlow != (Object)null)
			{
				Light flashlightBulbGlow = flashlight.flashlightBulbGlow;
				flashlightBulbGlow.color = lightColor;
				flashlightBulbGlow.intensity = Mathf.Max(0f, cfg.GlowIntensity.Value);
				flashlightBulbGlow.range = Mathf.Max(0.5f, cfg.GlowRange.Value);
				HDAdditionalLightData component = ((Component)flashlightBulbGlow).GetComponent<HDAdditionalLightData>();
				if ((Object)(object)component != (Object)null)
				{
					component.affectsVolumetric = false;
					component.volumetricDimmer = 0f;
				}
			}
		}

		private static void ApplyBodyTint(FlashlightItem flashlight, Color bodyColor)
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			MeshRenderer[] componentsInChildren = ((Component)flashlight).GetComponentsInChildren<MeshRenderer>(true);
			foreach (MeshRenderer val in componentsInChildren)
			{
				Material[] sharedMaterials = ((Renderer)val).sharedMaterials;
				bool flag = false;
				for (int j = 0; j < sharedMaterials.Length; j++)
				{
					Material val2 = sharedMaterials[j];
					if ((Object)(object)val2 == (Object)null || (Object)(object)val2 == (Object)(object)flashlight.bulbLight || (Object)(object)val2 == (Object)(object)flashlight.bulbDark)
					{
						continue;
					}
					Material val3 = new Material(val2);
					((Object)val3).name = ((Object)val2).name + "_LighthousePink";
					if (val3.HasProperty("_BaseColorMap"))
					{
						Texture texture = val3.GetTexture("_BaseColorMap");
						Texture2D val4 = (Texture2D)(object)((texture is Texture2D) ? texture : null);
						if (val4 != null)
						{
							Texture2D val5 = CreateDesaturatedTexture(val4);
							if ((Object)(object)val5 != (Object)null)
							{
								val3.SetTexture("_BaseColorMap", (Texture)(object)val5);
							}
							goto IL_00f3;
						}
					}
					Texture mainTexture = val3.mainTexture;
					Texture2D val6 = (Texture2D)(object)((mainTexture is Texture2D) ? mainTexture : null);
					if (val6 != null)
					{
						Texture2D val7 = CreateDesaturatedTexture(val6);
						if ((Object)(object)val7 != (Object)null)
						{
							val3.mainTexture = (Texture)(object)val7;
						}
					}
					goto IL_00f3;
					IL_00f3:
					if (val3.HasProperty("_BaseColor"))
					{
						val3.SetColor("_BaseColor", bodyColor);
					}
					if (val3.HasProperty("_Color"))
					{
						val3.SetColor("_Color", bodyColor);
					}
					sharedMaterials[j] = val3;
					flag = true;
				}
				if (flag)
				{
					((Renderer)val).sharedMaterials = sharedMaterials;
				}
			}
		}

		private static Texture2D? CreateDesaturatedTexture(Texture2D source)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Texture2D val = CopyTextureReadable(source);
				Color[] pixels = val.GetPixels();
				for (int i = 0; i < pixels.Length; i++)
				{
					Color val2 = pixels[i];
					float num = Mathf.Clamp01((0.299f * val2.r + 0.587f * val2.g + 0.114f * val2.b) * 1.15f);
					pixels[i] = new Color(num, num, num, val2.a);
				}
				val.SetPixels(pixels);
				val.Apply(true, true);
				return val;
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("Could not desaturate flashlight texture: " + ex.Message));
				return null;
			}
		}

		private static Sprite? CreateTintedSprite(Sprite source, Color tint)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Texture2D texture = source.texture;
				if ((Object)(object)texture == (Object)null)
				{
					return null;
				}
				Texture2D val = CopyTextureReadable(texture);
				Color[] pixels = val.GetPixels();
				for (int i = 0; i < pixels.Length; i++)
				{
					Color val2 = pixels[i];
					float num = Mathf.Clamp01((0.299f * val2.r + 0.587f * val2.g + 0.114f * val2.b) * 1.15f);
					pixels[i] = new Color(num * tint.r, num * tint.g, num * tint.b, val2.a);
				}
				val.SetPixels(pixels);
				val.Apply();
				return Sprite.Create(val, source.rect, new Vector2(0.5f, 0.5f), source.pixelsPerUnit);
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("Could not tint item icon, using Pro-flashlight icon instead: " + ex.Message));
				return null;
			}
		}

		private static Texture2D CopyTextureReadable(Texture2D source)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			RenderTexture temporary = RenderTexture.GetTemporary(((Texture)source).width, ((Texture)source).height, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)2);
			RenderTexture active = RenderTexture.active;
			Graphics.Blit((Texture)(object)source, temporary);
			RenderTexture.active = temporary;
			Texture2D val = new Texture2D(((Texture)source).width, ((Texture)source).height, (TextureFormat)4, true);
			val.ReadPixels(new Rect(0f, 0f, (float)((Texture)temporary).width, (float)((Texture)temporary).height), 0, 0);
			RenderTexture.active = active;
			RenderTexture.ReleaseTemporary(temporary);
			return val;
		}

		private static Color ParseHexColor(string hex, Color fallback)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			Color result = default(Color);
			if (!string.IsNullOrWhiteSpace(hex) && ColorUtility.TryParseHtmlString(hex.Trim(), ref result))
			{
				return result;
			}
			return fallback;
		}
	}
	public sealed class ModConfig
	{
		public ConfigEntry<string> ItemName { get; }

		public ConfigEntry<int> Price { get; }

		public ConfigEntry<float> WeightLbs { get; }

		public ConfigEntry<float> BatteryDurationMinutes { get; }

		public ConfigEntry<float> LightIntensity { get; }

		public ConfigEntry<float> LightRange { get; }

		public ConfigEntry<float> LightSpotAngle { get; }

		public ConfigEntry<float> LightInnerSpotAngle { get; }

		public ConfigEntry<string> LightColorHex { get; }

		public ConfigEntry<float> VolumetricDimmer { get; }

		public ConfigEntry<float> GlowIntensity { get; }

		public ConfigEntry<float> GlowRange { get; }

		public ConfigEntry<string> BodyColorHex { get; }

		public ModConfig(ConfigFile config)
		{
			ItemName = config.Bind<string>("Shop", "ItemName", "Lighthouse Flashlight", "Display name of the flashlight in the store and inventory.");
			Price = config.Bind<int>("Shop", "Price", 30, "Store price in credits.");
			WeightLbs = config.Bind<float>("General", "WeightLbs", 5f, "Weight in lbs (same as Pro-flashlight).");
			BatteryDurationMinutes = config.Bind<float>("General", "BatteryDurationMinutes", 20f, "Battery duration in minutes. Pro-flashlight is 5 min, Elite is 8 min.");
			LightIntensity = config.Bind<float>("Lighting", "Intensity", 3800f, "Main spotlight intensity in HDRP lumens (wide angles spread lumens over a much larger area, so higher values keep walls bright across the whole cone).");
			LightRange = config.Bind<float>("Lighting", "Range", 220f, "Main spotlight range in meters (Pro-flashlight is ~52).");
			LightSpotAngle = config.Bind<float>("Lighting", "SpotAngle", 155f, "Outer cone angle in degrees (Pro-flashlight is ~73). 155 covers almost the full field of view.");
			LightInnerSpotAngle = config.Bind<float>("Lighting", "InnerSpotAngle", 115f, "Inner bright core angle in degrees. Higher values keep illumination strong all the way to the edges.");
			LightColorHex = config.Bind<string>("Lighting", "ColorHex", "#FFE4EC", "Light beam color in hex format (#RRGGBB). Default is a warm white with a subtle rosy-pink tint.");
			VolumetricDimmer = config.Bind<float>("Lighting", "VolumetricDimmer", 0.08f, "Controls fog/air beam glare (0 = no fog glare, 1 = full HDRP fog glare). Kept low so high lumen output stays comfortable on the eyes.");
			GlowIntensity = config.Bind<float>("Lighting", "GlowIntensity", 35f, "Near-lens ambient fill intensity (does not cause fog glare).");
			GlowRange = config.Bind<float>("Lighting", "GlowRange", 12f, "Near-lens ambient fill range in meters.");
			BodyColorHex = config.Bind<string>("Appearance", "BodyColorHex", "#FFB8D6", "Tint color applied to the flashlight body and icon (#RRGGBB). Default is a light pink.");
		}
	}
	[BepInPlugin("Muowl.LighthouseFlashlight", "Lighthouse Flashlight", "1.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public sealed class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "Muowl.LighthouseFlashlight";

		public const string PluginName = "Lighthouse Flashlight";

		public const string PluginVersion = "1.0.1";

		private Harmony? _harmony;

		internal static ManualLogSource Log { get; private set; }

		internal static ModConfig ModConfig { get; private set; }

		private void Awake()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			ModConfig = new ModConfig(((BaseUnityPlugin)this).Config);
			_harmony = new Harmony("Muowl.LighthouseFlashlight");
			_harmony.PatchAll(typeof(LighthouseSetup));
			_harmony.PatchAll(typeof(HelmetLightPatch));
			Log.LogInfo((object)"Lighthouse Flashlight v1.0.1 loaded.");
		}
	}
}