Decompiled source of Cult of QoL Collection v2.2.7

plugins/CultOfQoL.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CultOfQoL.Patches;
using CultOfQoL.Routines;
using DG.Tweening;
using DG.Tweening.Core;
using HarmonyLib;
using JetBrains.Annotations;
using Lamb.UI;
using Lamb.UI.FollowerInteractionWheel;
using Lamb.UI.FollowerSelect;
using Lamb.UI.MainMenu;
using Lamb.UI.PauseMenu;
using LeTai.Asset.TranslucentImage;
using MMTools;
using Map;
using Microsoft.CodeAnalysis;
using MonoMod.Utils;
using Newtonsoft.Json;
using Shared;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using src.UI;
using src.UI.Menus;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyCompany("p1xel8ted")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("CultOfQoL")]
[assembly: AssemblyFileVersion("2.2.7")]
[assembly: AssemblyInformationalVersion("2.2.7+ae5bbc4b6afd6df9de7d6d1f6247e13eb7d72329")]
[assembly: AssemblyProduct("CultOfQoL")]
[assembly: AssemblyTitle("CultOfQoL")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.2.7.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 Shared
{
	internal sealed class ConfigurationManagerAttributes
	{
		public delegate void CustomHotkeyDrawerFunc(ConfigEntryBase setting, ref bool isCurrentlyAcceptingInput);

		public bool? ShowRangeAsPercent;

		public Action<ConfigEntryBase> CustomDrawer;

		public CustomHotkeyDrawerFunc CustomHotkeyDrawer;

		public bool? Browsable;

		public string Category;

		public object DefaultValue;

		public bool? HideDefaultButton;

		public bool? HideSettingName;

		public string Description;

		public string DispName;

		public int? Order;

		public bool? ReadOnly;

		public bool? IsAdvanced;

		public Func<object, string> ObjToStr;

		public Func<string, object> StrToObj;
	}
	public static class Extensions
	{
		public static void AddRange<T>(this SortedSet<T> set, IEnumerable<T> elements)
		{
			foreach (T element in elements)
			{
				set.Add(element);
			}
		}

		public static string GetPath(this GameObject obj)
		{
			if (!((Object)(object)obj.transform.parent == (Object)null))
			{
				return ((Component)obj.transform.parent).gameObject.GetPath() + "/" + ((Object)obj).name;
			}
			return ((Object)obj).name;
		}

		public static bool Contains(this string source, string toCheck, StringComparison comparison)
		{
			if (source == null)
			{
				throw new ArgumentNullException("source");
			}
			if (toCheck == null)
			{
				throw new ArgumentNullException("toCheck");
			}
			return source.IndexOf(toCheck, comparison) >= 0;
		}
	}
	public static class Helpers
	{
		internal static List<Follower> AllFollowers => FollowerManager.Followers.SelectMany((KeyValuePair<FollowerLocation, List<Follower>> followerList) => followerList.Value).ToList();

		internal static FollowerTask_ClearRubble GetRubbleTask()
		{
			SortedList<float, FollowerTask> sortedList = new SortedList<float, FollowerTask>();
			List<Structures_Rubble> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_Rubble>();
			foreach (Structures_Rubble item in allStructuresOfType)
			{
				item.GetAvailableTasks((ScheduledActivity)0, sortedList);
			}
			FollowerTask? obj = sortedList.Values.FirstOrDefault();
			return (FollowerTask_ClearRubble)(object)((obj is FollowerTask_ClearRubble) ? obj : null);
		}

		internal static FollowerTask_Janitor GetJanitorTask()
		{
			SortedList<float, FollowerTask> sortedList = new SortedList<float, FollowerTask>();
			List<Structures_JanitorStation> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_JanitorStation>();
			foreach (Structures_JanitorStation item in allStructuresOfType)
			{
				item.GetAvailableTasks((ScheduledActivity)0, sortedList);
			}
			FollowerTask? obj = sortedList.Values.FirstOrDefault();
			return (FollowerTask_Janitor)(object)((obj is FollowerTask_Janitor) ? obj : null);
		}

		internal static FollowerTask_Refinery GetRefineryTask()
		{
			SortedList<float, FollowerTask> sortedList = new SortedList<float, FollowerTask>();
			List<Structures_Refinery> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_Refinery>();
			foreach (Structures_Refinery item in allStructuresOfType)
			{
				item.GetAvailableTasks((ScheduledActivity)0, sortedList);
			}
			FollowerTask? obj = sortedList.Values.FirstOrDefault();
			return (FollowerTask_Refinery)(object)((obj is FollowerTask_Refinery) ? obj : null);
		}

		internal static FollowerTask_Undertaker GetMorgueTask()
		{
			SortedList<float, FollowerTask> sortedList = new SortedList<float, FollowerTask>();
			List<Structures_Morgue> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_Morgue>();
			foreach (Structures_Morgue item in allStructuresOfType)
			{
				item.GetAvailableTasks((ScheduledActivity)0, sortedList);
			}
			FollowerTask? obj = sortedList.Values.FirstOrDefault();
			return (FollowerTask_Undertaker)(object)((obj is FollowerTask_Undertaker) ? obj : null);
		}

		internal static void StartTask(FollowerBrain brain, FollowerTask task)
		{
			brain.CompleteCurrentTask();
			brain.HardSwapToTask(task);
		}

		private static void StartTaskFromCommand(FollowerBrain brain, FollowerCommands command)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Invalid comparison between Unknown and I4
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Invalid comparison between Unknown and I4
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected I4, but got Unknown
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Invalid comparison between Unknown and I4
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Invalid comparison between Unknown and I4
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Invalid comparison between Unknown and I4
			//IL_00e5: 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_0035: Invalid comparison between Unknown and I4
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Invalid comparison between Unknown and I4
			if ((int)command <= 47)
			{
				if ((int)command <= 17)
				{
					if ((int)command == 14)
					{
						StartTask(brain, (FollowerTask)new FollowerTask_ChopTrees());
						return;
					}
					if ((int)command == 17)
					{
						StartTask(brain, (FollowerTask)(object)GetRubbleTask());
						return;
					}
				}
				else
				{
					switch (command - 27)
					{
					default:
						if ((int)command != 47)
						{
							break;
						}
						StartTask(brain, (FollowerTask)(object)GetFarmTask());
						return;
					case 0:
						StartTask(brain, (FollowerTask)(object)GetPrayTask());
						return;
					case 1:
						StartTask(brain, (FollowerTask)(object)GetBuildTask());
						return;
					case 3:
						StartTask(brain, (FollowerTask)(object)GetKitchenTask());
						return;
					case 2:
						break;
					}
				}
			}
			else if ((int)command <= 64)
			{
				if ((int)command == 58)
				{
					StartTask(brain, (FollowerTask)(object)GetJanitorTask());
					return;
				}
				if ((int)command == 64)
				{
					StartTask(brain, (FollowerTask)(object)GetRefineryTask());
					return;
				}
			}
			else
			{
				if ((int)command == 81)
				{
					StartTask(brain, (FollowerTask)(object)GetMorgueTask());
					return;
				}
				if ((int)command == 88)
				{
					StartTask(brain, (FollowerTask)(object)GetBrewTask());
					return;
				}
			}
			StartTask(brain, GetRandomTask(brain));
			throw new ArgumentOutOfRangeException("command", command, null);
		}

		internal static FollowerTask_Cook GetKitchenTask()
		{
			SortedList<float, FollowerTask> sortedList = new SortedList<float, FollowerTask>();
			List<Structures_Kitchen> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_Kitchen>();
			foreach (Structures_Kitchen item in allStructuresOfType)
			{
				((Structures_CookingFire)item).GetAvailableTasks((ScheduledActivity)0, sortedList);
			}
			FollowerTask? obj = sortedList.Values.FirstOrDefault();
			return (FollowerTask_Cook)(object)((obj is FollowerTask_Cook) ? obj : null);
		}

		internal static FollowerTask GetRandomTask(FollowerBrain brain)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			List<FollowerTask> desiredTask_Work = FollowerBrain.GetDesiredTask_Work(brain.Location);
			return desiredTask_Work.FirstOrDefault();
		}

		internal static FollowerTask_Brew GetBrewTask()
		{
			SortedList<float, FollowerTask> sortedList = new SortedList<float, FollowerTask>();
			List<Structures_Pub> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_Pub>();
			foreach (Structures_Pub item in allStructuresOfType)
			{
				item.GetAvailableTasks((ScheduledActivity)0, sortedList);
			}
			FollowerTask? obj = sortedList.Values.FirstOrDefault();
			return (FollowerTask_Brew)(object)((obj is FollowerTask_Brew) ? obj : null);
		}

		internal static FollowerTask_Farm GetFarmTask()
		{
			SortedList<float, FollowerTask> sortedList = new SortedList<float, FollowerTask>();
			List<Structures_FarmerStation> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_FarmerStation>();
			foreach (Structures_FarmerStation item in allStructuresOfType)
			{
				item.GetAvailableTasks((ScheduledActivity)0, sortedList);
			}
			FollowerTask? obj = sortedList.Values.FirstOrDefault();
			return (FollowerTask_Farm)(object)((obj is FollowerTask_Farm) ? obj : null);
		}

		internal static FollowerTask_Pray GetPrayTask()
		{
			SortedList<float, FollowerTask> sortedList = new SortedList<float, FollowerTask>();
			List<Structures_Shrine> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_Shrine>();
			foreach (Structures_Shrine item in allStructuresOfType)
			{
				item.GetAvailableTasks((ScheduledActivity)0, sortedList);
			}
			FollowerTask? obj = sortedList.Values.FirstOrDefault();
			return (FollowerTask_Pray)(object)((obj is FollowerTask_Pray) ? obj : null);
		}

		internal static FollowerTask_Build GetBuildTask()
		{
			SortedList<float, FollowerTask> sortedList = new SortedList<float, FollowerTask>();
			List<Structures_BuildSite> allStructuresOfType = StructureManager.GetAllStructuresOfType<Structures_BuildSite>();
			foreach (Structures_BuildSite item in allStructuresOfType)
			{
				item.GetAvailableTasks((ScheduledActivity)0, sortedList);
			}
			FollowerTask? obj = sortedList.Values.FirstOrDefault();
			return (FollowerTask_Build)(object)((obj is FollowerTask_Build) ? obj : null);
		}

		public static IEnumerator FilterEnumerator(IEnumerator original, Type[] typesToRemove)
		{
			while (original.MoveNext())
			{
				object current = original.Current;
				if (current != null && !ArrayExtensions.Contains<Type>(typesToRemove, current.GetType()))
				{
					yield return current;
				}
			}
		}
	}
}
namespace CultOfQoL
{
	[BepInPlugin("p1xel8ted.cotl.CultOfQoLCollection", "The Cult of QoL Collection", "2.2.7")]
	[BepInDependency("com.bepis.bepinex.configurationmanager", "18.3")]
	public class Plugin : BaseUnityPlugin
	{
		private const string PluginGuid = "p1xel8ted.cotl.CultOfQoLCollection";

		internal const string PluginName = "The Cult of QoL Collection";

		private const string PluginVer = "2.2.7";

		private const string RestartGameMessage = "You must restart the game for these changes to take effect, as in totally exit to desktop and restart the game.\n\n** indicates a restart is required if the setting is changed.";

		private const string GeneralSection = "01. General";

		private const string MenuCleanupSection = "02. Menu Cleanup";

		private const string GameMechanicsSection = "03. Game Mechanics";

		private const string PlayerDamageSection = "05. Player Damage";

		private const string PlayerSpeedSection = "06. Player Speed";

		private const string SavesSection = "07. Saves";

		private const string WeatherSection = "09. Weather";

		private const string NotificationsSection = "10. Notifications";

		private const string FollowersSection = "11. Followers";

		private const string GameSpeedSection = "13. Game Speed";

		private const string CapacitySection = "14. Capacities";

		private const string AutoInteractSection = "15. Auto-Interact (Chests)";

		private const string MinesSection = "17. Mines";

		private const string MassSection = "18. Mass Actions";

		private const string StructureSection = "04. Structures";

		private const string TraitsSection = "19. Traits";

		private const string LootSection = "20. Loot";

		private const string PostProcessingSection = "21. Post Processing";

		private const string RitualSection = "22. Rituals";

		private static ConfigEntry<bool> EnableLogging { get; set; }

		private static ConfigEntry<bool> EnableQuickSaveShortcut { get; set; }

		private static ConfigEntry<KeyboardShortcut> SaveKeyboardShortcut { get; set; }

		internal static ConfigEntry<bool> SaveOnQuitToDesktop { get; private set; }

		internal static ConfigEntry<bool> SaveOnQuitToMenu { get; private set; }

		internal static ConfigEntry<bool> DirectLoadSave { get; private set; }

		internal static ConfigEntry<int> SaveSlotToLoad { get; private set; }

		private static ConfigEntry<KeyboardShortcut> DirectLoadSkipKey { get; set; }

		private static ConfigEntry<bool> DisableAds { get; set; }

		internal static ConfigEntry<bool> HideNewGameButtons { get; private set; }

		internal static ConfigEntry<bool> SkipDevIntros { get; private set; }

		internal static ConfigEntry<bool> SkipCrownVideo { get; private set; }

		internal static ConfigEntry<bool> EasyFishing { get; private set; }

		internal static ConfigEntry<bool> FastCollecting { get; private set; }

		internal static ConfigEntry<bool> RemoveMenuClutter { get; private set; }

		internal static ConfigEntry<bool> RemoveTwitchButton { get; private set; }

		internal static ConfigEntry<bool> AllLootMagnets { get; private set; }

		internal static ConfigEntry<bool> DoubleMagnetRange { get; private set; }

		internal static ConfigEntry<bool> TripleMagnetRange { get; private set; }

		internal static ConfigEntry<bool> UseCustomMagnetRange { get; private set; }

		internal static ConfigEntry<int> CustomMagnetRange { get; private set; }

		private static ConfigEntry<bool> MainMenuGlitch { get; set; }

		internal static ConfigEntry<bool> ReverseGoldenFleeceDamageChange { get; private set; }

		internal static ConfigEntry<bool> IncreaseGoldenFleeceDamageRate { get; private set; }

		internal static ConfigEntry<bool> AdjustRefineryRequirements { get; private set; }

		internal static ConfigEntry<bool> NoNegativeTraits { get; private set; }

		internal static ConfigEntry<bool> UseUnlockedTraitsOnly { get; private set; }

		internal static ConfigEntry<bool> IncludeImmortal { get; private set; }

		internal static ConfigEntry<bool> IncludeDisciple { get; private set; }

		internal static ConfigEntry<bool> ShowNotificationsWhenRemovingTraits { get; private set; }

		internal static ConfigEntry<bool> ShowNotificationsWhenAddingTraits { get; private set; }

		internal static ConfigEntry<bool> CleanseIllnessAndExhaustionOnLevelUp { get; private set; }

		internal static ConfigEntry<bool> UnlockTwitchItems { get; private set; }

		internal static ConfigEntry<bool> LumberAndMiningStationsDontAge { get; private set; }

		internal static ConfigEntry<bool> CollectTitheFromOldFollowers { get; private set; }

		internal static ConfigEntry<bool> IntimidateOldFollowers { get; private set; }

		internal static ConfigEntry<bool> EnableGameSpeedManipulation { get; private set; }

		internal static ConfigEntry<bool> DoubleSoulCapacity { get; private set; }

		internal static ConfigEntry<bool> ShortenGameSpeedIncrements { get; private set; }

		internal static ConfigEntry<bool> SlowDownTime { get; private set; }

		internal static ConfigEntry<float> SlowDownTimeMultiplier { get; private set; }

		internal static ConfigEntry<bool> DoubleLifespanInstead { get; private set; }

		internal static ConfigEntry<bool> DisableGameOver { get; private set; }

		internal static ConfigEntry<bool> FastRitualSermons { get; private set; }

		internal static ConfigEntry<bool> TurnOffSpeakersAtNight { get; private set; }

		internal static ConfigEntry<bool> ThriceMultiplyTarotCardLuck { get; private set; }

		internal static ConfigEntry<bool> RareTarotCardsOnly { get; private set; }

		internal static ConfigEntry<bool> FiftyPercentIncreaseToLifespanInstead { get; private set; }

		internal static ConfigEntry<bool> EnableAutoCollect { get; private set; }

		internal static ConfigEntry<int> TriggerAmount { get; private set; }

		internal static ConfigEntry<bool> IncreaseAutoCollectRange { get; private set; }

		internal static ConfigEntry<bool> UseCustomAutoInteractRange { get; private set; }

		internal static ConfigEntry<float> CustomAutoInteractRangeMulti { get; private set; }

		internal static ConfigEntry<bool> AutoCollectFromFarmStationChests { get; private set; }

		internal static ConfigEntry<bool> AddExhaustedToHealingBay { get; private set; }

		internal static ConfigEntry<bool> NotifyOfScarecrowTraps { get; private set; }

		internal static ConfigEntry<bool> NotifyOfNoFuel { get; private set; }

		internal static ConfigEntry<bool> NotifyOfBedCollapse { get; private set; }

		internal static ConfigEntry<bool> GiveFollowersNewNecklaces { get; private set; }

		internal static ConfigEntry<bool> RandomWeatherChangeWhenExitingArea { get; private set; }

		internal static ConfigEntry<bool> ChangeWeatherOnPhaseChange { get; private set; }

		internal static ConfigEntry<bool> ShowPhaseNotifications { get; private set; }

		internal static ConfigEntry<bool> ShowWeatherChangeNotifications { get; private set; }

		internal static ConfigEntry<float> CustomSoulCapacityMulti { get; private set; }

		internal static ConfigEntry<float> CustomSiloCapacityMulti { get; private set; }

		internal static ConfigEntry<bool> DoubleSiloCapacity { get; private set; }

		internal static ConfigEntry<bool> UseCustomSoulCapacity { get; private set; }

		internal static ConfigEntry<bool> UseCustomSiloCapacity { get; private set; }

		internal static ConfigEntry<bool> UseMultiplesOf32 { get; private set; }

		internal static ConfigEntry<bool> EnableBaseDamageMultiplier { get; private set; }

		internal static ConfigEntry<float> BaseDamageMultiplier { get; private set; }

		internal static ConfigEntry<float> CustomDamageMulti { get; private set; }

		internal static ConfigEntry<bool> DisableRunSpeedInDungeons { get; private set; }

		internal static ConfigEntry<bool> DisableRunSpeedInCombat { get; private set; }

		internal static ConfigEntry<bool> RemoveHelpButtonInPauseMenu { get; private set; }

		internal static ConfigEntry<bool> RemoveTwitchButtonInPauseMenu { get; private set; }

		internal static ConfigEntry<bool> RemovePhotoModeButtonInPauseMenu { get; private set; }

		internal static ConfigEntry<bool> EnableRunSpeedMulti { get; private set; }

		internal static ConfigEntry<bool> EnableDodgeSpeedMulti { get; private set; }

		internal static ConfigEntry<bool> EnableLungeSpeedMulti { get; private set; }

		internal static ConfigEntry<float> RunSpeedMulti { get; private set; }

		internal static ConfigEntry<float> DodgeSpeedMulti { get; private set; }

		internal static ConfigEntry<float> LungeSpeedMulti { get; private set; }

		internal static ConfigEntry<bool> OnlyShowDissenters { get; private set; }

		internal static ConfigEntry<bool> DisablePropagandaSpeakerAudio { get; private set; }

		internal static ConfigEntry<bool> UseCustomDamageValue { get; private set; }

		internal static ConfigEntry<bool> RemoveLevelLimit { get; private set; }

		internal static ConfigEntry<bool> MassBribe { get; private set; }

		internal static ConfigEntry<bool> MassFertilize { get; private set; }

		internal static ConfigEntry<bool> MassBless { get; private set; }

		internal static ConfigEntry<bool> MassRomance { get; private set; }

		internal static ConfigEntry<bool> MassBully { get; private set; }

		internal static ConfigEntry<bool> MassReassure { get; private set; }

		internal static ConfigEntry<bool> MassReeducate { get; private set; }

		internal static ConfigEntry<bool> MassExtort { get; private set; }

		internal static ConfigEntry<bool> MassPetDog { get; private set; }

		internal static ConfigEntry<bool> MassIntimidate { get; private set; }

		internal static ConfigEntry<bool> MassInspire { get; private set; }

		internal static ConfigEntry<bool> MassWater { get; private set; }

		internal static ConfigEntry<bool> MakeOldFollowersWork { get; private set; }

		internal static ConfigEntry<bool> MassCollectFromBeds { get; private set; }

		internal static ConfigEntry<bool> MassCollectFromOuthouses { get; private set; }

		internal static ConfigEntry<bool> MassCollectFromOfferingShrines { get; private set; }

		internal static ConfigEntry<bool> MassCollectFromPassiveShrines { get; private set; }

		internal static ConfigEntry<bool> MassCollectFromCompost { get; private set; }

		internal static ConfigEntry<bool> MassCollectFromHarvestTotems { get; private set; }

		internal static WriteOnce<float> RunSpeed { get; } = new WriteOnce<float>();


		internal static WriteOnce<float> DodgeSpeed { get; } = new WriteOnce<float>();


		internal static UIMainMenuController UIMainMenuController { get; set; }

		public static ConfigEntry<bool> VignetteEffect { get; private set; }

		public static ConfigEntry<bool> ReverseEnrichmentNerf { get; private set; }

		internal static ManualLogSource Log { get; private set; }

		internal static PopupManager PopupManager { get; private set; }

		private void Awake()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Expected O, but got Unknown
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Expected O, but got Unknown
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Expected O, but got Unknown
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Expected O, but got Unknown
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Expected O, but got Unknown
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Expected O, but got Unknown
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Expected O, but got Unknown
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Expected O, but got Unknown
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Expected O, but got Unknown
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Expected O, but got Unknown
			//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Expected O, but got Unknown
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Expected O, but got Unknown
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Expected O, but got Unknown
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d1: Expected O, but got Unknown
			//IL_0530: Unknown result type (might be due to invalid IL or missing references)
			//IL_053a: Expected O, but got Unknown
			//IL_0582: Unknown result type (might be due to invalid IL or missing references)
			//IL_058c: Expected O, but got Unknown
			//IL_05eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f5: Expected O, but got Unknown
			//IL_062b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Expected O, but got Unknown
			//IL_066b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0675: Expected O, but got Unknown
			//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c7: Expected O, but got Unknown
			//IL_0726: Unknown result type (might be due to invalid IL or missing references)
			//IL_0730: Expected O, but got Unknown
			//IL_0778: Unknown result type (might be due to invalid IL or missing references)
			//IL_0782: Expected O, but got Unknown
			//IL_07e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07eb: Expected O, but got Unknown
			//IL_0821: Unknown result type (might be due to invalid IL or missing references)
			//IL_082b: Expected O, but got Unknown
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_086b: Expected O, but got Unknown
			//IL_08a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ab: Expected O, but got Unknown
			//IL_08ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f9: Expected O, but got Unknown
			//IL_092f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0939: Expected O, but got Unknown
			//IL_0958: Unknown result type (might be due to invalid IL or missing references)
			//IL_097d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0987: Expected O, but got Unknown
			//IL_09d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09dc: Expected O, but got Unknown
			//IL_0a3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a45: Expected O, but got Unknown
			//IL_0a7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a85: Expected O, but got Unknown
			//IL_0ac6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad0: Expected O, but got Unknown
			//IL_0b2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b39: Expected O, but got Unknown
			//IL_0b6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b79: Expected O, but got Unknown
			//IL_0baf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb9: Expected O, but got Unknown
			//IL_0bef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf9: Expected O, but got Unknown
			//IL_0c58: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c62: Expected O, but got Unknown
			//IL_0cc1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccb: Expected O, but got Unknown
			//IL_0d2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d34: Expected O, but got Unknown
			//IL_0d6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d74: Expected O, but got Unknown
			//IL_0daa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db4: Expected O, but got Unknown
			//IL_0dea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df4: Expected O, but got Unknown
			//IL_0e2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e34: Expected O, but got Unknown
			//IL_0e6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e74: Expected O, but got Unknown
			//IL_0eaa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eb4: Expected O, but got Unknown
			//IL_0ef5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eff: Expected O, but got Unknown
			//IL_0f5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f68: Expected O, but got Unknown
			//IL_0fb0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fba: Expected O, but got Unknown
			//IL_1019: Unknown result type (might be due to invalid IL or missing references)
			//IL_1023: Expected O, but got Unknown
			//IL_108d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1097: Expected O, but got Unknown
			//IL_10f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1100: Expected O, but got Unknown
			//IL_1149: Unknown result type (might be due to invalid IL or missing references)
			//IL_1153: Expected O, but got Unknown
			//IL_1189: Unknown result type (might be due to invalid IL or missing references)
			//IL_1193: Expected O, but got Unknown
			//IL_11c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_11d3: Expected O, but got Unknown
			//IL_121b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1225: Expected O, but got Unknown
			//IL_1284: Unknown result type (might be due to invalid IL or missing references)
			//IL_128e: Expected O, but got Unknown
			//IL_12c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_12ce: Expected O, but got Unknown
			//IL_1304: Unknown result type (might be due to invalid IL or missing references)
			//IL_130e: Expected O, but got Unknown
			//IL_1356: Unknown result type (might be due to invalid IL or missing references)
			//IL_1360: Expected O, but got Unknown
			//IL_13bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_13c9: Expected O, but got Unknown
			//IL_13ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_1409: Expected O, but got Unknown
			//IL_1451: Unknown result type (might be due to invalid IL or missing references)
			//IL_145b: Expected O, but got Unknown
			//IL_14ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_14c4: Expected O, but got Unknown
			//IL_14fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_1504: Expected O, but got Unknown
			//IL_153a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1544: Expected O, but got Unknown
			//IL_157a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1584: Expected O, but got Unknown
			//IL_15ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_15c4: Expected O, but got Unknown
			//IL_15fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_1604: Expected O, but got Unknown
			//IL_163a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1644: Expected O, but got Unknown
			//IL_167a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1684: Expected O, but got Unknown
			//IL_16ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_16c4: Expected O, but got Unknown
			//IL_16fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_1704: Expected O, but got Unknown
			//IL_1745: Unknown result type (might be due to invalid IL or missing references)
			//IL_174f: Expected O, but got Unknown
			//IL_17ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_17b8: Expected O, but got Unknown
			//IL_1817: Unknown result type (might be due to invalid IL or missing references)
			//IL_1821: Expected O, but got Unknown
			//IL_1880: Unknown result type (might be due to invalid IL or missing references)
			//IL_188a: Expected O, but got Unknown
			//IL_18e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_18f3: Expected O, but got Unknown
			//IL_1952: Unknown result type (might be due to invalid IL or missing references)
			//IL_195c: Expected O, but got Unknown
			//IL_1992: Unknown result type (might be due to invalid IL or missing references)
			//IL_199c: Expected O, but got Unknown
			//IL_19d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_19dd: Expected O, but got Unknown
			//IL_1a14: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a1e: Expected O, but got Unknown
			//IL_1a60: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a6a: Expected O, but got Unknown
			//IL_1ad5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1adf: Expected O, but got Unknown
			//IL_1b4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b54: Expected O, but got Unknown
			//IL_1bbf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bc9: Expected O, but got Unknown
			//IL_1c34: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c3e: Expected O, but got Unknown
			//IL_1ca9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cb3: Expected O, but got Unknown
			//IL_1d13: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d1d: Expected O, but got Unknown
			//IL_1d53: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d5d: Expected O, but got Unknown
			//IL_1d93: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d9d: Expected O, but got Unknown
			//IL_1dd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ddd: Expected O, but got Unknown
			//IL_1e13: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e1d: Expected O, but got Unknown
			//IL_1e53: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e5d: Expected O, but got Unknown
			//IL_1e9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ea8: Expected O, but got Unknown
			//IL_1f12: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f1c: Expected O, but got Unknown
			//IL_1f86: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f90: Expected O, but got Unknown
			//IL_1ffa: Unknown result type (might be due to invalid IL or missing references)
			//IL_2004: Expected O, but got Unknown
			//IL_2063: Unknown result type (might be due to invalid IL or missing references)
			//IL_206d: Expected O, but got Unknown
			//IL_20cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_20d6: Expected O, but got Unknown
			//IL_2135: Unknown result type (might be due to invalid IL or missing references)
			//IL_213f: Expected O, but got Unknown
			//IL_219e: Unknown result type (might be due to invalid IL or missing references)
			//IL_21a8: Expected O, but got Unknown
			//IL_220e: Unknown result type (might be due to invalid IL or missing references)
			//IL_2218: Expected O, but got Unknown
			//IL_2277: Unknown result type (might be due to invalid IL or missing references)
			//IL_2281: Expected O, but got Unknown
			//IL_22e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_22ea: Expected O, but got Unknown
			//IL_235d: Unknown result type (might be due to invalid IL or missing references)
			HideBepInEx();
			Log = ((BaseUnityPlugin)this).Logger;
			PopupManager = ((Component)this).gameObject.AddComponent<PopupManager>();
			EnableLogging = ((BaseUnityPlugin)this).Config.Bind<bool>("01. General", "Enable Logging", false, new ConfigDescription("Enable/disable logging.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			SkipDevIntros = ((BaseUnityPlugin)this).Config.Bind<bool>("01. General", "Skip Intros", true, new ConfigDescription("Skip splash screens.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			SkipCrownVideo = ((BaseUnityPlugin)this).Config.Bind<bool>("01. General", "Skip Crown Video", true, new ConfigDescription("Skips the video when the lamb gets given the crown.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			UnlockTwitchItems = ((BaseUnityPlugin)this).Config.Bind<bool>("01. General", "Unlock Twitch Items", true, new ConfigDescription("Unlock pre-order DLC, Twitch plush, and Twitch drops. Paid DLC is excluded on purpose.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			RemoveMenuClutter = ((BaseUnityPlugin)this).Config.Bind<bool>("02. Menu Cleanup", "Remove Extra Menu Buttons", true, new ConfigDescription("Removes credits/road-map/discord buttons from the menus.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			RemoveTwitchButton = ((BaseUnityPlugin)this).Config.Bind<bool>("02. Menu Cleanup", "Remove Twitch Buttons", true, new ConfigDescription("Removes twitch buttons from the menus.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			DisableAds = ((BaseUnityPlugin)this).Config.Bind<bool>("02. Menu Cleanup", "Disable Ads", true, new ConfigDescription("Disables the new ad 'feature'.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			RemoveHelpButtonInPauseMenu = ((BaseUnityPlugin)this).Config.Bind<bool>("02. Menu Cleanup", "Remove Help Button In Pause Menu", true, new ConfigDescription("Removes the help button in the pause menu.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			RemoveTwitchButtonInPauseMenu = ((BaseUnityPlugin)this).Config.Bind<bool>("02. Menu Cleanup", "Remove Twitch Button In Pause Menu", true, new ConfigDescription("Removes the twitch button in the pause menu.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			RemovePhotoModeButtonInPauseMenu = ((BaseUnityPlugin)this).Config.Bind<bool>("02. Menu Cleanup", "Remove Photo Mode Button In Pause Menu", true, new ConfigDescription("Removes the photo mode button in the pause menu.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			MainMenuGlitch = ((BaseUnityPlugin)this).Config.Bind<bool>("02. Menu Cleanup", "Main Menu Glitch", false, new ConfigDescription("Disables the sudden dark-mode switch effect.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			MainMenuGlitch.SettingChanged += delegate
			{
				UpdateMenuGlitch();
			};
			EnableBaseDamageMultiplier = ((BaseUnityPlugin)this).Config.Bind<bool>("05. Player Damage", "Enable Base Damage Multiplier", false, new ConfigDescription("Enable/disable the base damage multiplier.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			BaseDamageMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("05. Player Damage", "Base Damage Multiplier", 1.5f, new ConfigDescription("The base damage multiplier to use.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.25f, 100f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			BaseDamageMultiplier.SettingChanged += delegate
			{
				BaseDamageMultiplier.Value = Mathf.Round(BaseDamageMultiplier.Value * 4f) / 4f;
			};
			ReverseGoldenFleeceDamageChange = ((BaseUnityPlugin)this).Config.Bind<bool>("03. Game Mechanics", "Reverse Golden Fleece Change", true, new ConfigDescription("Reverts the default damage increase to 10% instead of 5%.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			IncreaseGoldenFleeceDamageRate = ((BaseUnityPlugin)this).Config.Bind<bool>("03. Game Mechanics", "Increase Golden Fleece Rate", true, new ConfigDescription("Doubles the damage increase.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			UseCustomDamageValue = ((BaseUnityPlugin)this).Config.Bind<bool>("03. Game Mechanics", "Use Custom Damage Value", false, new ConfigDescription("Use a custom damage value instead of the default 10%.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			CustomDamageMulti = ((BaseUnityPlugin)this).Config.Bind<float>("03. Game Mechanics", "Custom Damage Multiplier", 2f, new ConfigDescription("The custom damage multiplier to use. Based off the games default 5%.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.25f, 100f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			CustomDamageMulti.SettingChanged += delegate
			{
				CustomDamageMulti.Value = Mathf.Round(CustomDamageMulti.Value * 4f) / 4f;
			};
			EnableRunSpeedMulti = ((BaseUnityPlugin)this).Config.Bind<bool>("06. Player Speed", "Enable Run Speed Multiplier", true, new ConfigDescription("Enable/disable the run speed multiplier.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 8
				}
			}));
			RunSpeedMulti = ((BaseUnityPlugin)this).Config.Bind<float>("06. Player Speed", "Run Speed Multiplier", 1.5f, new ConfigDescription("How much faster the player runs.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.25f, 100f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 7
				}
			}));
			RunSpeedMulti.SettingChanged += delegate
			{
				RunSpeedMulti.Value = Mathf.Round(RunSpeedMulti.Value * 4f) / 4f;
			};
			DisableRunSpeedInDungeons = ((BaseUnityPlugin)this).Config.Bind<bool>("06. Player Speed", "Disable Run Speed In Dungeons", true, new ConfigDescription("Disables the run speed multiplier in dungeons.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			DisableRunSpeedInCombat = ((BaseUnityPlugin)this).Config.Bind<bool>("06. Player Speed", "Disable Run Speed In Combat", true, new ConfigDescription("Disables the run speed multiplier in combat.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			EnableDodgeSpeedMulti = ((BaseUnityPlugin)this).Config.Bind<bool>("06. Player Speed", "Enable Dodge Speed Multiplier", true, new ConfigDescription("Enable/disable the dodge speed multiplier.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			DodgeSpeedMulti = ((BaseUnityPlugin)this).Config.Bind<float>("06. Player Speed", "Dodge Speed Multiplier", 1.5f, new ConfigDescription("How much faster the player dodges.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.25f, 100f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			DodgeSpeedMulti.SettingChanged += delegate
			{
				DodgeSpeedMulti.Value = Mathf.Round(DodgeSpeedMulti.Value * 4f) / 4f;
			};
			EnableLungeSpeedMulti = ((BaseUnityPlugin)this).Config.Bind<bool>("06. Player Speed", "Enable Lunge Speed Multiplier", true, new ConfigDescription("Enable/disable the lunge speed multiplier.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			LungeSpeedMulti = ((BaseUnityPlugin)this).Config.Bind<float>("06. Player Speed", "Lunge Speed Multiplier", 1.5f, new ConfigDescription("How much faster the player lunges.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.25f, 100f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			LungeSpeedMulti.SettingChanged += delegate
			{
				LungeSpeedMulti.Value = Mathf.Round(LungeSpeedMulti.Value * 4f) / 4f;
			};
			SaveOnQuitToDesktop = ((BaseUnityPlugin)this).Config.Bind<bool>("07. Saves", "Save On Quit To Desktop", true, new ConfigDescription("Modify the confirmation dialog to save the game when you quit to desktop.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 8
				}
			}));
			SaveOnQuitToMenu = ((BaseUnityPlugin)this).Config.Bind<bool>("07. Saves", "Save On Quit To Menu", true, new ConfigDescription("Modify the confirmation dialog to save the game when you quit to menu.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 7
				}
			}));
			HideNewGameButtons = ((BaseUnityPlugin)this).Config.Bind<bool>("07. Saves", "Hide New Game Button (s)", true, new ConfigDescription("Hides the new game button if you have at least one save game.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			EnableQuickSaveShortcut = ((BaseUnityPlugin)this).Config.Bind<bool>("07. Saves", "Enable Quick Save Shortcut", true, new ConfigDescription("Enable/disable the quick save keyboard shortcut.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			SaveKeyboardShortcut = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("07. Saves", "Save Keyboard Shortcut", new KeyboardShortcut((KeyCode)286, Array.Empty<KeyCode>()), new ConfigDescription("The keyboard shortcut to save the game.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			DirectLoadSave = ((BaseUnityPlugin)this).Config.Bind<bool>("07. Saves", "Direct Load Save", false, new ConfigDescription("Directly load the specified save game instead of showing the save menu.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			DirectLoadSkipKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("07. Saves", "Direct Load Skip Key", new KeyboardShortcut((KeyCode)304, Array.Empty<KeyCode>()), new ConfigDescription("The keyboard shortcut to skip the auto-load when loading the game.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			SaveSlotToLoad = ((BaseUnityPlugin)this).Config.Bind<int>("07. Saves", "Save Slot To Load", 1, new ConfigDescription("The save slot to load.", (AcceptableValueBase)(object)new AcceptableValueList<int>(new int[3] { 1, 2, 3 }), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			SaveSlotToLoad.SettingChanged += delegate
			{
				if (!SaveAndLoad.SaveExist(SaveSlotToLoad.Value))
				{
					L("The slot you have select doesn't contain a save game.");
				}
				else
				{
					L($"Save slot to load changed to {SaveSlotToLoad.Value}");
				}
			};
			ChangeWeatherOnPhaseChange = ((BaseUnityPlugin)this).Config.Bind<bool>("09. Weather", "Change Weather On Phase Change", true, new ConfigDescription("By default, the game changes weather when you exit a structure, or on a new day. Enabling this makes the weather change on each phase i.e. morning, noon, evening, night.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			RandomWeatherChangeWhenExitingArea = ((BaseUnityPlugin)this).Config.Bind<bool>("09. Weather", "Random Weather Change When Exiting Area", true, new ConfigDescription("When exiting a building/area, the weather will change to a random weather type instead of the previous weather.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			EasyFishing = ((BaseUnityPlugin)this).Config.Bind<bool>("03. Game Mechanics", "Disable Fishing Mini-Game", true, new ConfigDescription("Fishing mini-game cheese. Just cast and let the mod do the rest.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Disable Fishing Mini-Game**",
					Order = 3
				}
			}));
			EasyFishing.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			DisableGameOver = ((BaseUnityPlugin)this).Config.Bind<bool>("03. Game Mechanics", "No More Game-Over", false, new ConfigDescription("Disables the game over function when you have 0 followers for consecutive days.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			ThriceMultiplyTarotCardLuck = ((BaseUnityPlugin)this).Config.Bind<bool>("03. Game Mechanics", "3x Tarot Luck", true, new ConfigDescription("Luck changes with game difficulty, this will multiply your luck multiplier by 3 for drawing rarer tarot cards.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			RareTarotCardsOnly = ((BaseUnityPlugin)this).Config.Bind<bool>("03. Game Mechanics", "Rare Tarot Cards Only", true, new ConfigDescription("Only draw rare tarot cards.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			LumberAndMiningStationsDontAge = ((BaseUnityPlugin)this).Config.Bind<bool>("17. Mines", "Infinite Lumber & Mining Stations", false, new ConfigDescription("Lumber and mining stations should never run out and collapse. Takes 1st priority.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			LumberAndMiningStationsDontAge.SettingChanged += delegate
			{
				if (LumberAndMiningStationsDontAge.Value)
				{
					DoubleLifespanInstead.Value = false;
					FiftyPercentIncreaseToLifespanInstead.Value = false;
				}
			};
			DoubleLifespanInstead = ((BaseUnityPlugin)this).Config.Bind<bool>("17. Mines", "Double Life Span Instead", false, new ConfigDescription("Doubles the life span of lumber/mining stations. Takes 2nd priority.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			DoubleLifespanInstead.SettingChanged += delegate
			{
				if (DoubleLifespanInstead.Value)
				{
					LumberAndMiningStationsDontAge.Value = false;
					FiftyPercentIncreaseToLifespanInstead.Value = false;
				}
			};
			FiftyPercentIncreaseToLifespanInstead = ((BaseUnityPlugin)this).Config.Bind<bool>("17. Mines", "Add 50% to Life Span Instead", true, new ConfigDescription("For when double is too long for your tastes. This will extend their life by 50% instead of 100%. Takes 3rd priority.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			FiftyPercentIncreaseToLifespanInstead.SettingChanged += delegate
			{
				if (FiftyPercentIncreaseToLifespanInstead.Value)
				{
					LumberAndMiningStationsDontAge.Value = false;
					DoubleLifespanInstead.Value = false;
				}
			};
			TurnOffSpeakersAtNight = ((BaseUnityPlugin)this).Config.Bind<bool>("04. Structures", "Turn Off Speakers At Night", true, new ConfigDescription("Turns the speakers off, and stops fuel consumption at night time.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			DisablePropagandaSpeakerAudio = ((BaseUnityPlugin)this).Config.Bind<bool>("04. Structures", "Disable Propaganda Speaker Audio", true, new ConfigDescription("Disables the audio from propaganda speakers.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			AddExhaustedToHealingBay = ((BaseUnityPlugin)this).Config.Bind<bool>("04. Structures", "Add Exhausted To Healing Bay", true, new ConfigDescription("Allows you to select exhausted followers for rest and relaxation in the healing bays.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			OnlyShowDissenters = ((BaseUnityPlugin)this).Config.Bind<bool>("04. Structures", "Only Show Dissenters In Prison Menu", true, new ConfigDescription("Only show dissenting followers when interacting with the prison.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			AdjustRefineryRequirements = ((BaseUnityPlugin)this).Config.Bind<bool>("04. Structures", "Adjust Refinery Requirements", true, new ConfigDescription("Where possible, halves the materials needed to convert items in the refinery. Rounds up.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			EnableGameSpeedManipulation = ((BaseUnityPlugin)this).Config.Bind<bool>("13. Game Speed", "Enable Game Speed Manipulation", true, new ConfigDescription("Use left/right arrows keys to increase/decrease game speed in 0.25 increments. Up arrow to reset to default.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			ShortenGameSpeedIncrements = ((BaseUnityPlugin)this).Config.Bind<bool>("13. Game Speed", "Shorten Game Speed Increments", false, new ConfigDescription("Increments in steps of 1, instead of 0.25.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			FastCollecting = ((BaseUnityPlugin)this).Config.Bind<bool>("13. Game Speed", "Speed Up Collection", true, new ConfigDescription("Increases the rate you can collect from the shrines, and other structures.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Speed Up Collection**",
					Order = 3
				}
			}));
			FastCollecting.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			SlowDownTime = ((BaseUnityPlugin)this).Config.Bind<bool>("13. Game Speed", "Slow Down Time", false, new ConfigDescription("Enables the ability to slow down time. This is different to the increase speed implementation. This will make the days longer, but not slow down animations.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			SlowDownTimeMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("13. Game Speed", "Slow Down Time Multiplier", 2f, new ConfigDescription("The multiplier to use for slow down time. For example, the default value of 2 is making the day twice as long.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.25f, 100f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			SlowDownTimeMultiplier.SettingChanged += delegate
			{
				SlowDownTimeMultiplier.Value = Mathf.Round(SlowDownTimeMultiplier.Value * 4f) / 4f;
			};
			FastRitualSermons = ((BaseUnityPlugin)this).Config.Bind<bool>("13. Game Speed", "Fast Rituals & Sermons", true, new ConfigDescription("Speeds up rituals and sermons.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			FastRitualSermons.SettingChanged += delegate
			{
				if (!FastRitualSermons.Value)
				{
					RitualSermonSpeed.RitualRunning = false;
					GameManager.SetTimeScale(1f);
				}
			};
			EnableAutoCollect = ((BaseUnityPlugin)this).Config.Bind<bool>("15. Auto-Interact (Chests)", "Enable Auto Collect", true, new ConfigDescription("Makes chests automatically send you the resources when you're nearby.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5,
					DispName = "Enable Auto Collect**"
				}
			}));
			EnableAutoCollect.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			AutoCollectFromFarmStationChests = ((BaseUnityPlugin)this).Config.Bind<bool>("15. Auto-Interact (Chests)", "Auto Collect From Farm Station Chests", true, new ConfigDescription("Automatically collect from farm station chests.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			TriggerAmount = ((BaseUnityPlugin)this).Config.Bind<int>("15. Auto-Interact (Chests)", "Trigger Amount", 5, new ConfigDescription("The amount of resources needed to trigger the auto-interact.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4,
					ShowRangeAsPercent = false
				}
			}));
			IncreaseAutoCollectRange = ((BaseUnityPlugin)this).Config.Bind<bool>("15. Auto-Interact (Chests)", "Double Activation Range", true, new ConfigDescription("The default range is 5. This will increase it to 10.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			UseCustomAutoInteractRange = ((BaseUnityPlugin)this).Config.Bind<bool>("15. Auto-Interact (Chests)", "Use Custom Range", false, new ConfigDescription("Use a custom range instead of the default or increased range.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			CustomAutoInteractRangeMulti = ((BaseUnityPlugin)this).Config.Bind<float>("15. Auto-Interact (Chests)", "Custom Range Multiplier", 2f, new ConfigDescription("Enter a multiplier to use for auto-collect range when using custom range.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.25f, 100f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			CustomAutoInteractRangeMulti.SettingChanged += delegate
			{
				CustomAutoInteractRangeMulti.Value = Mathf.Round(CustomAutoInteractRangeMulti.Value * 4f) / 4f;
			};
			UseMultiplesOf32 = ((BaseUnityPlugin)this).Config.Bind<bool>("14. Capacities", "Use Multiples of 32", true, new ConfigDescription("Use multiples of 32 for silo capacity.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 7
				}
			}));
			DoubleSiloCapacity = ((BaseUnityPlugin)this).Config.Bind<bool>("14. Capacities", "Double Silo Capacity", true, new ConfigDescription("Doubles the silo capacity of applicable structures.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			UseCustomSiloCapacity = ((BaseUnityPlugin)this).Config.Bind<bool>("14. Capacities", "Use Custom Silo Capacity", false, new ConfigDescription("Use a custom silo capacity instead of the default or increased capacity.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			CustomSiloCapacityMulti = ((BaseUnityPlugin)this).Config.Bind<float>("14. Capacities", "Custom Silo Capacity Multiplier", 2f, new ConfigDescription("Enter a multiplier to use for silo capacity when using custom capacity.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.25f, 1000f), new object[2]
			{
				null,
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			CustomSiloCapacityMulti.SettingChanged += delegate
			{
				CustomSiloCapacityMulti.Value = Mathf.Round(CustomSiloCapacityMulti.Value * 4f) / 4f;
			};
			DoubleSoulCapacity = ((BaseUnityPlugin)this).Config.Bind<bool>("14. Capacities", "Double Soul Capacity", true, new ConfigDescription("Doubles the soul capacity of applicable structures.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			UseCustomSoulCapacity = ((BaseUnityPlugin)this).Config.Bind<bool>("14. Capacities", "Use Custom Soul Capacity", false, new ConfigDescription("Use a custom soul capacity instead of the default or doubled capacity.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			CustomSoulCapacityMulti = ((BaseUnityPlugin)this).Config.Bind<float>("14. Capacities", "Custom Soul Capacity Multiplier", 2f, new ConfigDescription("Enter a multiplier to use for soul capacity when using custom capacity.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1.25f, 1000f), new object[2]
			{
				null,
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			CustomSoulCapacityMulti.SettingChanged += delegate
			{
				CustomSoulCapacityMulti.Value = Mathf.Round(CustomSoulCapacityMulti.Value * 4f) / 4f;
			};
			NotifyOfScarecrowTraps = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Notifications", "Notify of Scarecrow Traps", true, new ConfigDescription("Display a notification when the farm scarecrows have caught a trap!", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			NotifyOfNoFuel = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Notifications", "Notify of No Fuel", true, new ConfigDescription("Display a notification when a structure has run out of fuel.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			NotifyOfBedCollapse = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Notifications", "Notify of Bed Collapse", true, new ConfigDescription("Display a notification when a bed has collapsed.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			ShowPhaseNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Notifications", "Phase Notifications", true, new ConfigDescription("Show a notification when the time of day changes.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			ShowWeatherChangeNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("10. Notifications", "Weather Change Notifications", true, new ConfigDescription("Show a notification when the weather changes.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			GiveFollowersNewNecklaces = ((BaseUnityPlugin)this).Config.Bind<bool>("11. Followers", "Give Followers New Necklaces", true, new ConfigDescription("Followers will be able to receive new necklaces, with the old one being returned to you.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			CleanseIllnessAndExhaustionOnLevelUp = ((BaseUnityPlugin)this).Config.Bind<bool>("11. Followers", "Cleanse Illness and Exhaustion", true, new ConfigDescription("When a follower 'levels up', if they are sick or exhausted, the status is cleansed.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			CollectTitheFromOldFollowers = ((BaseUnityPlugin)this).Config.Bind<bool>("11. Followers", "Collect Tithe From Old Followers", true, new ConfigDescription("Enable collecting tithe from the elderly.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			IntimidateOldFollowers = ((BaseUnityPlugin)this).Config.Bind<bool>("11. Followers", "Intimidate Old Followers", true, new ConfigDescription("Enable intimidating the elderly.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			RemoveLevelLimit = ((BaseUnityPlugin)this).Config.Bind<bool>("11. Followers", "Remove Level Limit", true, new ConfigDescription("Removes the level limit for followers. They can now level up infinitely.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			MakeOldFollowersWork = ((BaseUnityPlugin)this).Config.Bind<bool>("11. Followers", "Make Old Followers Work", true, new ConfigDescription("Enable the elderly to work.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Make Old Followers Work**",
					Order = 0
				}
			}));
			MakeOldFollowersWork.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			NoNegativeTraits = ((BaseUnityPlugin)this).Config.Bind<bool>("19. Traits", "No Negative Traits", true, new ConfigDescription("Negative traits will be replaced based on the configuration here.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			NoNegativeTraits.SettingChanged += delegate
			{
				UpdateNoNegativeTraits();
			};
			UseUnlockedTraitsOnly = ((BaseUnityPlugin)this).Config.Bind<bool>("19. Traits", "Use Unlocked Traits Only", true, new ConfigDescription("Only use unlocked traits when replacing negative traits.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			UseUnlockedTraitsOnly.SettingChanged += delegate
			{
				GenerateAvailableTraits();
			};
			IncludeImmortal = ((BaseUnityPlugin)this).Config.Bind<bool>("19. Traits", "Include Immortal", false, new ConfigDescription("Include the Immortal trait when replacing negative traits.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			IncludeImmortal.SettingChanged += delegate
			{
				GenerateAvailableTraits();
			};
			IncludeDisciple = ((BaseUnityPlugin)this).Config.Bind<bool>("19. Traits", "Include Disciple", false, new ConfigDescription("Include the Disciple trait when replacing negative traits.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			IncludeDisciple.SettingChanged += delegate
			{
				GenerateAvailableTraits();
			};
			ShowNotificationsWhenRemovingTraits = ((BaseUnityPlugin)this).Config.Bind<bool>("19. Traits", "Show Notifications When Removing Traits", false, new ConfigDescription("Show notifications when removing negative traits.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			ShowNotificationsWhenAddingTraits = ((BaseUnityPlugin)this).Config.Bind<bool>("19. Traits", "Show Notifications When Adding Traits", false, new ConfigDescription("Show notifications when adding positive traits.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			MassFertilize = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Fertilize", true, new ConfigDescription("When fertilizing a plot, all farm plots are fertilized at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 17
				}
			}));
			MassWater = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Water", true, new ConfigDescription("When watering a plot, all farm plots are watered at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 16
				}
			}));
			MassBribe = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Bribe", true, new ConfigDescription("When bribing a follower, all followers are bribed at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Bribe**",
					Order = 15
				}
			}));
			MassBribe.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			MassBless = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Bless", true, new ConfigDescription("When blessing a follower, all followers are blessed at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Bless**",
					Order = 14
				}
			}));
			MassBless.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			MassExtort = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Extort", true, new ConfigDescription("When extorting a follower, all followers are extorted at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Extort**",
					Order = 13
				}
			}));
			MassExtort.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			MassPetDog = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Pet Dog", true, new ConfigDescription("When petting a a follower, all followers are petted at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Pet Dog**",
					Order = 12
				}
			}));
			MassPetDog.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			MassIntimidate = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Intimidate", true, new ConfigDescription("When intimidating a follower, all followers are intimidated at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Intimidate**",
					Order = 11
				}
			}));
			MassIntimidate.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			MassInspire = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Inspire", true, new ConfigDescription("When inspiring a follower, all followers are inspired at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Inspire**",
					Order = 10
				}
			}));
			MassInspire.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			MassCollectFromBeds = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Collect From Beds", true, new ConfigDescription("When collecting resources from a bed, all beds are collected from at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 9
				}
			}));
			MassCollectFromOuthouses = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Collect From Outhouses", true, new ConfigDescription("When collecting resources from an outhouse, all outhouses are collected from at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 8
				}
			}));
			MassCollectFromOfferingShrines = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Collect From Offering Shrines", true, new ConfigDescription("When collecting resources from an offering shrine, all offering shrines are collected from at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 7
				}
			}));
			MassCollectFromPassiveShrines = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Collect From Passive Shrines", true, new ConfigDescription("When collecting resources from a passive shrine, all passive shrines are collected from at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			MassCollectFromCompost = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Collect From Compost", true, new ConfigDescription("When collecting resources from a compost, all composts are collected from at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			MassCollectFromHarvestTotems = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Collect From Harvest Totems", true, new ConfigDescription("When collecting resources from a harvest totem, all harvest totems are collected from at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			MassRomance = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Romance", true, new ConfigDescription("When romancing a follower, all followers are romanced at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Romance**",
					Order = 3
				}
			}));
			MassRomance.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			MassBully = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Bully", true, new ConfigDescription("When bullying a follower, all followers are bullied at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Bully**",
					Order = 2
				}
			}));
			MassBully.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			MassReassure = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Reassure", true, new ConfigDescription("When reassuring a follower, all followers are reassured at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Reassure**",
					Order = 1
				}
			}));
			MassReassure.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			MassReeducate = ((BaseUnityPlugin)this).Config.Bind<bool>("18. Mass Actions", "Mass Reeducate", true, new ConfigDescription("When reeducating a follower, all followers are reeducated at once.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					DispName = "Mass Reeducate**",
					Order = 0
				}
			}));
			MassReeducate.SettingChanged += delegate
			{
				ShowRestartMessage();
			};
			AllLootMagnets = ((BaseUnityPlugin)this).Config.Bind<bool>("20. Loot", "All Loot Magnets", true, new ConfigDescription("All loot is magnetized to you.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			AllLootMagnets.SettingChanged += delegate
			{
				UpdateAllMagnets();
			};
			DoubleMagnetRange = ((BaseUnityPlugin)this).Config.Bind<bool>("20. Loot", "Double Magnet Range", true, new ConfigDescription("Doubles the magnet range.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			DoubleMagnetRange.SettingChanged += delegate
			{
				UpdateDoubleMagnet();
			};
			TripleMagnetRange = ((BaseUnityPlugin)this).Config.Bind<bool>("20. Loot", "Triple Magnet Range", false, new ConfigDescription("Triples the magnet range.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			TripleMagnetRange.SettingChanged += delegate
			{
				UpdateTripleMagnet();
			};
			UseCustomMagnetRange = ((BaseUnityPlugin)this).Config.Bind<bool>("20. Loot", "Use Custom Magnet Range", false, new ConfigDescription("Use a custom magnet range instead of the default or increased range.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			UseCustomMagnetRange.SettingChanged += delegate
			{
				UpdatePickups();
			};
			CustomMagnetRange = ((BaseUnityPlugin)this).Config.Bind<int>("20. Loot", "Custom Magnet Range", 7, new ConfigDescription("Quadruples the magnet range.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(7, 50), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			CustomMagnetRange.SettingChanged += delegate
			{
				UpdateCustomMagnet();
			};
			VignetteEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("21. Post Processing", "Vignette Effect", true, new ConfigDescription("Enable/disable the vignette effect.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			VignetteEffect.SettingChanged += delegate
			{
				PostProcessing.ToggleVignette();
			};
			ReverseEnrichmentNerf = ((BaseUnityPlugin)this).Config.Bind<bool>("22. Rituals", "Reverse Enrichment Nerf", true, new ConfigDescription("Reverts the nerf to the Ritual of Enrichment. Enabling this will automatically enable remove follower level cap.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 0
				}
			}));
			ReverseEnrichmentNerf.SettingChanged += delegate
			{
				if (ReverseEnrichmentNerf.Value && !RemoveLevelLimit.Value)
				{
					Log.LogInfo((object)"Enabling 'Remove Level Limit' as it is required for 'Reverse Enrichment Nerf'.");
					RemoveLevelLimit.Value = true;
				}
			};
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "p1xel8ted.cotl.CultOfQoLCollection");
			SceneManager.sceneLoaded += OnSceneLoaded;
			((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("Plugin {0} is loaded! Running game version {1} on {2}.", "The Cult of QoL Collection", Application.version, PlatformHelper.Current));
		}

		private static void UpdateNoNegativeTraits()
		{
			if (IsNoNegativePresent())
			{
				NoNegativeTraits.Value = false;
			}
			else if (NoNegativeTraits.Value)
			{
				CultOfQoL.Patches.NoNegativeTraits.UpdateAllFollowerTraits();
			}
			else
			{
				CultOfQoL.Patches.NoNegativeTraits.RestoreOriginalTraits();
			}
		}

		private static void GenerateAvailableTraits()
		{
			if (!IsNoNegativePresent())
			{
				CultOfQoL.Patches.NoNegativeTraits.GenerateAvailableTraits();
			}
		}

		private static void UpdateNavigationMode()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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)
			MMButton[] array = Resources.FindObjectsOfTypeAll<MMButton>();
			MMButton[] array2 = array;
			foreach (MMButton val in array2)
			{
				Selectable selectable = val.Selectable;
				Navigation navigation = val.Selectable.navigation;
				((Navigation)(ref navigation)).mode = (Mode)3;
				selectable.navigation = navigation;
			}
		}

		private static void UpdateAllMagnets()
		{
			if (AllLootMagnets.Value)
			{
				PickUps.UpdateAllPickUps();
			}
			else
			{
				PickUps.RestoreMagnets();
			}
		}

		private static void UpdateDoubleMagnet()
		{
			if (!DoubleMagnetRange.Value && !TripleMagnetRange.Value && !UseCustomMagnetRange.Value)
			{
				PickUps.RestoreMagnetRange();
			}
			if (DoubleMagnetRange.Value)
			{
				PickUps.UpdateAllPickUps();
				TripleMagnetRange.Value = false;
				UseCustomMagnetRange.Value = false;
			}
		}

		private static void UpdateTripleMagnet()
		{
			if (!DoubleMagnetRange.Value && !TripleMagnetRange.Value && !UseCustomMagnetRange.Value)
			{
				PickUps.RestoreMagnetRange();
			}
			if (TripleMagnetRange.Value)
			{
				PickUps.UpdateAllPickUps();
				DoubleMagnetRange.Value = false;
				UseCustomMagnetRange.Value = false;
			}
		}

		private static void UpdateCustomMagnet()
		{
			if (UseCustomMagnetRange.Value)
			{
				UseCustomMagnetRange.Value = true;
				DoubleMagnetRange.Value = false;
				TripleMagnetRange.Value = false;
				PickUps.UpdateAllPickUps();
			}
		}

		private static void UpdatePickups()
		{
			if (!DoubleMagnetRange.Value && !TripleMagnetRange.Value && !UseCustomMagnetRange.Value)
			{
				PickUps.RestoreMagnetRange();
			}
			if (UseCustomMagnetRange.Value)
			{
				PickUps.UpdateAllPickUps();
				DoubleMagnetRange.Value = false;
				TripleMagnetRange.Value = false;
			}
		}

		private static void OnSceneLoaded(Scene arg0, LoadSceneMode arg1)
		{
			UpdateMenuGlitch();
			UpdateNavigationMode();
			UpdateAllMagnets();
		}

		private static void UpdateMenuGlitch()
		{
			MainMenuController val = Object.FindObjectOfType<MainMenuController>();
			if (Object.op_Implicit((Object)(object)val))
			{
				val.doIntroGlitch = MainMenuGlitch.Value;
			}
		}

		public static void L(string message)
		{
			if (EnableLogging.Value)
			{
				Log.LogInfo((object)message);
			}
		}

		private static void ShowRestartMessage()
		{
			if (!PopupManager.showPopup)
			{
				PopupManager.ShowPopup("You must restart the game for these changes to take effect, as in totally exit to desktop and restart the game.\n\n** indicates a restart is required if the setting is changed.", showCloseAndDontShowAgain: true);
			}
		}

		private static bool IsNoNegativePresent()
		{
			if (!CultOfQoL.Patches.NoNegativeTraits.IsNothingNegativePresent())
			{
				return false;
			}
			PopupManager.ShowPopup("You have the 'Nothing Negative' mod by voidptr installed. Please remove it to use Cult of QoL's No Negative Traits feature.", showCloseAndDontShowAgain: false);
			return true;
		}

		private static void HideBepInEx()
		{
			((Object)Chainloader.ManagerObject).hideFlags = (HideFlags)61;
			((Object)((Component)ThreadingHelper.Instance).gameObject).hideFlags = (HideFlags)61;
			Object.DontDestroyOnLoad((Object)(object)Chainloader.ManagerObject);
			Object.DontDestroyOnLoad((Object)(object)((Component)ThreadingHelper.Instance).gameObject);
		}

		private void Update()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			KeyboardShortcut value;
			if (DirectLoadSave.Value)
			{
				value = DirectLoadSkipKey.Value;
				if (((KeyboardShortcut)(ref value)).IsPressed())
				{
					goto IL_0048;
				}
			}
			value = DirectLoadSkipKey.Value;
			if (!((KeyboardShortcut)(ref value)).IsUp())
			{
				value = DirectLoadSkipKey.Value;
				if (!((KeyboardShortcut)(ref value)).IsDown())
				{
					goto IL_0089;
				}
			}
			goto IL_0048;
			IL_0048:
			if (!MenuCleanupPatches.SkipAutoLoad)
			{
				ManualLogSource log = Log;
				value = DirectLoadSkipKey.Value;
				KeyCode mainKey = ((KeyboardShortcut)(ref value)).MainKey;
				log.LogWarning((object)(((object)(KeyCode)(ref mainKey)).ToString() + " pressed; skipping auto-load."));
			}
			MenuCleanupPatches.SkipAutoLoad = true;
			goto IL_0089;
			IL_0089:
			if (EnableQuickSaveShortcut.Value)
			{
				value = SaveKeyboardShortcut.Value;
				if (((KeyboardShortcut)(ref value)).IsUp())
				{
					SaveAndLoad.Save();
					NotificationCentre.Instance.PlayGenericNotification("Game Saved!", (Flair)0);
				}
			}
			if (DisableAds.Value && Object.op_Implicit((Object)(object)UIMainMenuController))
			{
				Component[] components = ((Component)UIMainMenuController.ad).GetComponents<Component>();
				foreach (Component val in components)
				{
					val.gameObject.SetActive(false);
				}
				((Component)UIMainMenuController.ad).gameObject.SetActive(false);
			}
		}
	}
	internal class PopupManager : MonoBehaviour
	{
		internal bool showPopup;

		private string popupMessage = "";

		private Rect popupRect = new Rect((float)Screen.width / 2f - 150f, (float)Screen.height / 2f - 75f, 500f, 300f);

		private GUIStyle messageStyle;

		private GUIStyle windowStyle;

		private GUIStyle titleStyle;

		private bool dontShowAgainThisSession;

		private bool ignoreDontShow;

		private void Start()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_007e: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00a7: Expected O, but got Unknown
			GUIStyle val = new GUIStyle
			{
				alignment = (TextAnchor)4,
				wordWrap = true,
				fontSize = 22
			};
			val.normal.textColor = Color.black;
			titleStyle = val;
			GUIStyle val2 = new GUIStyle
			{
				alignment = (TextAnchor)4,
				wordWrap = true,
				fontSize = 20
			};
			val2.normal.textColor = Color.black;
			messageStyle = val2;
			GUIStyle val3 = new GUIStyle();
			val3.normal.background = Texture2D.whiteTexture;
			val3.normal.textColor = Color.black;
			val3.richText = true;
			val3.padding = new RectOffset(10, 10, 10, 10);
			windowStyle = val3;
		}

		private void OnGUI()
		{
			//IL_000b: 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)
			//IL_002c: Expected O, but got Unknown
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if (showPopup)
			{
				popupRect = GUI.ModalWindow(0, popupRect, new WindowFunction(DrawPopup), string.Empty, windowStyle);
			}
		}

		private void DrawPopup(int windowID)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.FlexibleSpace();
			GUI.Label(new Rect(10f, 10f, ((Rect)(ref popupRect)).width - 20f, 30f), "The Cult of QoL Collection", titleStyle);
			GUILayout.FlexibleSpace();
			GUILayout.Label(popupMessage, messageStyle, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("OK", (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(100f),
				GUILayout.Height(40f)
			}))
			{
				showPopup = false;
			}
			if (!ignoreDontShow && GUILayout.Button("Close & Don't Show Again This Session", (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(250f),
				GUILayout.Height(40f)
			}))
			{
				dontShowAgainThisSession = true;
				showPopup = false;
			}
			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();
			GUILayout.FlexibleSpace();
		}

		public void ShowPopup(string message, bool showCloseAndDontShowAgain)
		{
			ignoreDontShow = !showCloseAndDontShowAgain;
			if (!(dontShowAgainThisSession && showCloseAndDontShowAgain))
			{
				popupMessage = message;
				showPopup = true;
			}
		}
	}
	public static class ReflectionHelper
	{
		public static string GetCallingClassName(int framesToSkip = 2)
		{
			StackTrace stackTrace = new StackTrace();
			StackFrame frame = stackTrace.GetFrame(framesToSkip);
			if (frame == null)
			{
				return "Unknown";
			}
			MethodBase method = frame.GetMethod();
			if (method == null)
			{
				return "Unknown";
			}
			if (!(method.DeclaringType != null))
			{
				return "Unknown";
			}
			return method.DeclaringType.FullName;
		}
	}
	public sealed class WriteOnce<T>
	{
		private T _value;

		private bool _hasValue;

		public T Value
		{
			get
			{
				if (_hasValue)
				{
					return _value;
				}
				return default(T);
			}
			set
			{
				if (!_hasValue)
				{
					_value = value;
					_hasValue = true;
				}
			}
		}

		public override string ToString()
		{
			if (!_hasValue)
			{
				return "";
			}
			return Convert.ToString(_value);
		}

		public static implicit operator T(WriteOnce<T> value)
		{
			return value.Value;
		}
	}
}
namespace CultOfQoL.Routines
{
	[Harmony]
	public static class RoutinesTranspilers
	{
		private const string IntimidateRoutine = "IntimidateRoutine";

		private const string BribeRoutine = "BribeRoutine";

		private const string BullyRoutine = "BullyRoutine";

		private const string ReassureRoutine = "ReassureRoutine";

		private const string ReeducateRoutine = "ReeducateRoutine";

		private const string BlessRoutine = "BlessRoutine";

		private const string DanceRoutine = "DanceRoutine";

		private const string PetDogRoutine = "PetDogRoutine";

		private const string RomanceRoutine = "RomanceRoutine";

		private const string ExtortMoneyRoutine = "ExtortMoneyRoutine";

		private static readonly MethodInfo GetInstance = AccessTools.Method(typeof(GameManager), "GetInstance", (Type[])null, (Type[])null);

		private static readonly MethodInfo OnConversationNext = AccessTools.Method(typeof(GameManager), "OnConversationNext", (Type[])null, (Type[])null);

		private static readonly MethodInfo OnConversationNew = AccessTools.Method(typeof(GameManager), "OnConversationNew", new Type[3]
		{
			typeof(bool),
			typeof(bool),
			typeof(PlayerFarming)
		}, (Type[])null);

		private static readonly MethodInfo AddPlayerToCamera = AccessTools.Method(typeof(GameManager), "AddPlayerToCamera", (Type[])null, (Type[])null);

		private static readonly MethodInfo CameraSetOffset = AccessTools.Method(typeof(GameManager), "CameraSetOffset", (Type[])null, (Type[])null);

		private static readonly MethodInfo HudManagerHide = AccessTools.Method(typeof(HUD_Manager), "Hide", (Type[])null, (Type[])null);

		private static readonly FieldInfo HudManagerInstance = AccessTools.Field(typeof(HUD_Manager), "Instance");

		private static readonly FieldInfo BiomeConstantsInstance = AccessTools.Field(typeof(BiomeConstants), "Instance");

		private static readonly MethodInfo DepthOfFieldTween = AccessTools.Method(typeof(BiomeConstants), "DepthOfFieldTween", (Type[])null, (Type[])null);

		private static readonly List<string> AlreadyLogged = new List<string>();

		private static readonly Dictionary<string, Func<ConfigEntry<bool>>> routineChecks = new Dictionary<string, Func<ConfigEntry<bool>>>
		{
			["BribeRoutine"] = () => Plugin.MassBribe,
			["IntimidateRoutine"] = () => Plugin.MassIntimidate,
			["BullyRoutine"] = () => Plugin.MassBully,
			["ReassureRoutine"] = () => Plugin.MassReassure,
			["ReeducateRoutine"] = () => Plugin.MassReeducate,
			["BlessRoutine"] = () => Plugin.MassBless,
			["DanceRoutine"] = () => Plugin.MassInspire,
			["PetDogRoutine"] = () => Plugin.MassPetDog,
			["RomanceRoutine"] = () => Plugin.MassRomance,
			["ExtortMoneyRoutine"] = () => Plugin.MassExtort
		};

		internal static bool AnyMassActionsEnabled => routineChecks.Any((KeyValuePair<string, Func<ConfigEntry<bool>>> pair) => pair.Value().Value);

		private static bool RunThisTranspiler => routineChecks.Any((KeyValuePair<string, Func<ConfigEntry<bool>>> pair) => pair.Value().Value);

		[HarmonyTranspiler]
		[HarmonyPatch(typeof(interaction_FollowerInteraction), "OnInteract")]
		private static IEnumerable<CodeInstruction> interaction_FollowerInteraction_OnInteract(IEnumerable<CodeInstruction> instructions, MethodBase original)
		{
			if (!RunThisTranspiler)
			{
				return instructions;
			}
			if (original.DeclaringType != null)
			{
				string text = original.DeclaringType.ToString();
				LogOnce(text, "Patching " + text + ":" + original.Name);
			}
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				TryReplaceWithNop(list, i, CodeInstructionExtensions.LoadsField(list[i], BiomeConstantsInstance, false) && CodeInstructionExtensions.Calls(list[i + 6], DepthOfFieldTween), 7);
			}
			return list.AsEnumerable();
		}

		[HarmonyTranspiler]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static IEnumerable<CodeInstruction> interaction_FollowerInteraction_Transpiler(IEnumerable<CodeInstruction> instructions, MethodBase original)
		{
			if (original.DeclaringType != null)
			{
				string declaringType = original.DeclaringType.ToString();
				List<KeyValuePair<string, Func<ConfigEntry<bool>>>> list = routineChecks.Where((KeyValuePair<string, Func<ConfigEntry<bool>>> pair) => Extensions.Contains(declaringType, pair.Key, StringComparison.OrdinalIgnoreCase) && !pair.Value().Value).ToList();
				using (List<KeyValuePair<string, Func<ConfigEntry<bool>>>>.Enumerator enumerator = list.GetEnumerator())
				{
					if (enumerator.MoveNext())
					{
						KeyValuePair<string, Func<ConfigEntry<bool>>> current = enumerator.Current;
						Plugin.Log.LogWarning((object)("Not patching " + declaringType + ":" + original.Name + " as " + ((ConfigEntryBase)current.Value()).Definition.Key + " is false!"));
						return instructions;
					}
				}
				LogOnce(declaringType, "Patching " + declaringType + ":" + original.Name);
			}
			List<CodeInstruction> list2 = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list2.Count; i++)
			{
				TryReplaceWithNop(list2, i, CodeInstructionExtensions.LoadsField(list2[i], HudManagerInstance, false) && CodeInstructionExtensions.Calls(list2[i + 4], HudManagerHide), 5);
				TryReplaceWithNop(list2, i, CodeInstructionExtensions.Calls(list2[i], GetInstance) && CodeInstructionExtensions.Calls(list2[i + 3], OnConversationNew) && CodeInstructionExtensions.Calls(list2[i + 4], GetInstance) && CodeInstructionExtensions.Calls(list2[i + 8], OnConversationNext), 9);
				TryReplaceWithNop(list2, i, CodeInstructionExtensions.Calls(list2[i], GetInstance) && CodeInstructionExtensions.Calls(list2[i + 4], OnConversationNext) && CodeInstructionExtensions.Calls(list2[i + 6], AddPlayerToCamera) && CodeInstructionExtensions.Calls(list2[i + 9], CameraSetOffset), 10);
			}
			return list2.AsEnumerable();
		}

		private static void LogOnce(string declaringType, string message)
		{
			if (!AlreadyLogged.Contains(declaringType))
			{
				AlreadyLogged.Add(declaringType);
				Plugin.L("[Mass Actions] -> " + message);
			}
		}

		private static void TryReplaceWithNop(IReadOnlyList<CodeInstruction> codes, int index, bool condition, int count)
		{
			if (condition)
			{
				for (int i = 0; i < count; i++)
				{
					codes[index + i].opcode = OpCodes.Nop;
				}
			}
		}
	}
}
namespace CultOfQoL.Patches
{
	[HarmonyPatch]
	public static class FastCollectingPatches
	{
		private static GameManager GI => GameManager.GetInstance();

		private static bool CollectBedsRunning { get; set; }

		private static bool CollectAllBuildingShrinesRunning { get; set; }

		private static bool CollectAllShrinesRunning { get; set; }

		private static bool CollectAllOuthouseRunning { get; set; }

		private static bool CompostBinDeadBodyRunning { get; set; }

		private static bool CollectAllHarvestTotemsRunning { get; set; }

		[HarmonyPostfix]
		[HarmonyPatch(typeof(BuildingShrine), "Update")]
		public static void BuildingShrine_Update(ref float ___ReduceDelay, ref float ___Delay)
		{
			if (Plugin.FastCollecting.Value)
			{
				___ReduceDelay = 0f;
				___Delay = 0f;
			}
		}

		[HarmonyPrefix]
		[HarmonyPostfix]
		[HarmonyPatch(typeof(BuildingShrinePassive), "Update")]
		public static void BuildingShrinePassive_Update(ref float ___Delay)
		{
			if (Plugin.FastCollecting.Value)
			{
				___Delay = 0f;
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Interaction_Bed), "OnSecondaryInteract")]
		public static void Interaction_Bed_OnSecondaryInteract(ref Interaction_Bed __instance)
		{
			if (Plugin.MassCollectFromBeds.Value && !CollectBedsRunning)
			{
				((MonoBehaviour)GI).StartCoroutine(CollectBeds(__instance));
			}
		}

		private static IEnumerator CollectBeds(Interaction_Bed bedInteraction)
		{
			CollectBedsRunning = true;
			List<Interaction_Bed> source = Interaction.interactions.OfType<Interaction_Bed>().ToList();
			foreach (Interaction_Bed item in source.Where(delegate(Interaction_Bed a)
			{
				if (Object.op_Implicit((Object)(object)a))
				{
					Structures_Bed structureBrain = a.StructureBrain;
					if (structureBrain == null)
					{
						return false;
					}
					return ((StructureBrain)structureBrain).SoulCount > 0;
				}
				return false;
			}))
			{
				if (Object.op_Implicit((Object)(object)item) && !((Object)(object)item == (Object)(object)bedInteraction))
				{
					((MonoBehaviour)item).StartCoroutine(item.GiveReward());
				}
			}
			yield return (object)new WaitForSeconds(0.1f);
			CollectBedsRunning = false;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(BuildingShrinePassive), "OnInteract", new Type[] { typeof(StateMachine) })]
		public static void BuildingShrinePassive_OnInteract(ref BuildingShrinePassive __instance, ref StateMachine state)
		{
			if (Plugin.MassCollectFromPassiveShrines.Value && !CollectAllBuildingShrinesRunning)
			{
				((MonoBehaviour)GI).StartCoroutine(CollectAllBuildingShrines(__instance, state));
			}
		}

		private static IEnumerator CollectAllBuildingShrines(BuildingShrinePassive __instance, StateMachine state)
		{
			CollectAllBuildingShrinesRunning = true;
			yield return (object)new WaitForEndOfFrame();
			List<BuildingShrinePassive> source = Interaction.interactions.OfType<BuildingShrinePassive>().ToList();
			foreach (BuildingShrinePassive item in source.Where(delegate(BuildingShrinePassive a)
			{
				Structures_Shrine_Passive structureBrain = a.StructureBrain;
				return structureBrain != null && ((StructureBrain)structureBrain).SoulCount > 0;
			}))
			{
				if (Object.op_Implicit((Object)(object)item) && !((Object)(object)item == (Object)(object)__instance))
				{
					((Interaction)item).OnInteract(state);
					yield return (object)new WaitForSeconds(0.1f);
				}
			}
			CollectAllBuildingShrinesRunning = false;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Interaction_Outhouse), "OnInteract", new Type[] { typeof(StateMachine) })]
		public static void Interaction_Outhouse_OnInteract(ref Interaction_Outhouse __instance, ref StateMachine state)
		{
			if (Plugin.MassCollectFromOuthouses.Value