Decompiled source of ButterscotchandRosesBaseMod v0.3.0

butterscotchnroses.dll

Decompiled 11 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using AllyNames;
using BNR;
using BNR.items;
using BNR.patches;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CoolerEclipse;
using EntityStates;
using EntityStates.JunkCube;
using GoldenCoastPlusRevived.Modules;
using HG;
using HG.Reflection;
using HarmonyLib;
using Inferno.Stat_AI;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On;
using On.EntityStates.JunkCube;
using On.RoR2;
using On.RoR2.Hologram;
using On.RoR2.UI;
using On.RoR2.UI.SkinControllers;
using R2API;
using R2API.Utils;
using Rewired;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Hologram;
using RoR2.Items;
using RoR2.Skills;
using RoR2.UI;
using RoR2.UI.SkinControllers;
using RoR2BepInExPack.GameAssetPaths.Version_1_35_0;
using RoR2BepInExPack.GameAssetPaths.Version_1_39_0;
using RoR2BepInExPack.GameAssetPathsBetter;
using SS2;
using ShaderSwapper;
using Skillsmas.Skills.Merc;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using butterscotchnroses;
using butterscotchnroses.artifacts;
using butterscotchnroses.skills;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("butterscotchnroses")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+6a32b4f7f5044d6a6f2b4ff2393f919205a66213")]
[assembly: AssemblyProduct("butterscotchnroses")]
[assembly: AssemblyTitle("butterscotchnroses")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ProdzModpackUtils
{
	public class ProdzUtils
	{
		public static Color TRANSPARENT = new Color(0f, 0f, 0f, 0f);

		public static Sprite GetComposite(Texture2D bg, Texture2D fg)
		{
			//IL_0034: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor((float)Mathf.Max(((Texture)bg).width, ((Texture)fg).width), (float)Mathf.Max(((Texture)bg).height, ((Texture)fg).height));
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(Mathf.Floor(((float)((Texture)bg).width - val.x) / 2f), Mathf.Floor(((float)((Texture)bg).width - val.y) / 2f));
			Vector2 val3 = default(Vector2);
			((Vector2)(ref val3))..ctor(Mathf.Floor(((float)((Texture)fg).width - val.x) / 2f), Mathf.Floor(((float)((Texture)fg).width - val.y) / 2f));
			Texture2D val4 = new Texture2D((int)val.x, (int)val.y);
			for (int i = 0; (float)i < val.x; i++)
			{
				for (int j = 0; (float)j < val.y; j++)
				{
					val4.SetPixel(i, j, Over(Pixel(bg, (float)i + val2.x, (float)j + val2.y), Pixel(fg, (float)i + val3.x, (float)j + val3.y)));
				}
			}
			return Sprite.Create(val4, new Rect(0f, 0f, val.x, val.y), new Vector2(0.5f, 0.5f), 3f);
		}

		public static Color Pixel(Texture2D img, float x, float y)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (0f > x || x >= (float)((Texture)img).width || 0f > y || y >= (float)((Texture)img).height)
			{
				return TRANSPARENT;
			}
			return img.GetPixel((int)x, (int)y);
		}

		public static Color Over(Color bg, Color fg)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			float num = bg.a * (1f - fg.a) + fg.a;
			return Color.op_Implicit((Color.op_Implicit(fg) * fg.a + Color.op_Implicit(bg) * bg.a * (1f - fg.a)) / num);
		}

		public static Sprite Load(params string[] path)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			Size dimensions = ImageHelper.GetDimensions(Path.Combine(path));
			byte[] array = File.ReadAllBytes(Path.Combine(path));
			Texture2D val = new Texture2D(dimensions.Width, dimensions.Height, (TextureFormat)3, false)
			{
				filterMode = (FilterMode)2
			};
			ImageConversion.LoadImage(val, array);
			return Sprite.Create(val, new Rect(0f, 0f, (float)dimensions.Width, (float)dimensions.Height), new Vector2(0.5f, 0.5f), 3f);
		}
	}
	public static class ImageHelper
	{
		private const string errorMessage = "Could not recognize image format.";

		private static Dictionary<byte[], Func<BinaryReader, Size>> imageFormatDecoders = new Dictionary<byte[], Func<BinaryReader, Size>>
		{
			{
				new byte[2] { 66, 77 },
				DecodeBitmap
			},
			{
				new byte[6] { 71, 73, 70, 56, 55, 97 },
				DecodeGif
			},
			{
				new byte[6] { 71, 73, 70, 56, 57, 97 },
				DecodeGif
			},
			{
				new byte[8] { 137, 80, 78, 71, 13, 10, 26, 10 },
				DecodePng
			},
			{
				new byte[2] { 255, 216 },
				DecodeJfif
			}
		};

		public static Size GetDimensions(string path)
		{
			using BinaryReader binaryReader = new BinaryReader(File.OpenRead(path));
			try
			{
				return GetDimensions(binaryReader);
			}
			catch (ArgumentException ex)
			{
				if (ex.Message.StartsWith("Could not recognize image format."))
				{
					throw new ArgumentException("Could not recognize image format.", "path", ex);
				}
				throw ex;
			}
		}

		public static Size GetDimensions(BinaryReader binaryReader)
		{
			int num = imageFormatDecoders.Keys.OrderByDescending((byte[] x) => x.Length).First().Length;
			byte[] array = new byte[num];
			for (int num2 = 0; num2 < num; num2++)
			{
				array[num2] = binaryReader.ReadByte();
				foreach (KeyValuePair<byte[], Func<BinaryReader, Size>> imageFormatDecoder in imageFormatDecoders)
				{
					if (array.StartsWith(imageFormatDecoder.Key))
					{
						return imageFormatDecoder.Value(binaryReader);
					}
				}
			}
			throw new ArgumentException("Could not recognize image format.", "binaryReader");
		}

		private static bool StartsWith(this byte[] thisBytes, byte[] thatBytes)
		{
			for (int i = 0; i < thatBytes.Length; i++)
			{
				if (thisBytes[i] != thatBytes[i])
				{
					return false;
				}
			}
			return true;
		}

		private static short ReadLittleEndianInt16(this BinaryReader binaryReader)
		{
			byte[] array = new byte[2];
			for (int i = 0; i < 2; i++)
			{
				array[1 - i] = binaryReader.ReadByte();
			}
			return BitConverter.ToInt16(array, 0);
		}

		private static int ReadLittleEndianInt32(this BinaryReader binaryReader)
		{
			byte[] array = new byte[4];
			for (int i = 0; i < 4; i++)
			{
				array[3 - i] = binaryReader.ReadByte();
			}
			return BitConverter.ToInt32(array, 0);
		}

		private static Size DecodeBitmap(BinaryReader binaryReader)
		{
			binaryReader.ReadBytes(16);
			int width = binaryReader.ReadInt32();
			int height = binaryReader.ReadInt32();
			return new Size(width, height);
		}

		private static Size DecodeGif(BinaryReader binaryReader)
		{
			short width = binaryReader.ReadInt16();
			int height = binaryReader.ReadInt16();
			return new Size(width, height);
		}

		private static Size DecodePng(BinaryReader binaryReader)
		{
			binaryReader.ReadBytes(8);
			int width = binaryReader.ReadLittleEndianInt32();
			int height = binaryReader.ReadLittleEndianInt32();
			return new Size(width, height);
		}

		private static Size DecodeJfif(BinaryReader binaryReader)
		{
			while (binaryReader.ReadByte() == byte.MaxValue)
			{
				byte num = binaryReader.ReadByte();
				short num2 = binaryReader.ReadLittleEndianInt16();
				if (num == 192)
				{
					binaryReader.ReadByte();
					int height = binaryReader.ReadLittleEndianInt16();
					return new Size(binaryReader.ReadLittleEndianInt16(), height);
				}
				binaryReader.ReadBytes(num2 - 2);
			}
			throw new ArgumentException("Could not recognize image format.");
		}
	}
}
namespace butterscotchnroses
{
	public class oldconfigs
	{
		private static ConfigEntry<bool> replaceOldConfigs;

		public static void fixOldConfigs()
		{
			replaceOldConfigs = ((BaseUnityPlugin)BNR.butterscotchnroses.instance).Config.Bind<bool>("!!!Config Replacement!!!", "whether or not to replace/fix old default configs ,..,", true, "basically uhh replace default configs if enabled.,,.");
			if (replaceOldConfigs.Value)
			{
				string text = "golemplains,golemplains2";
				if (coolereclipse.whitelistStages.Value == text)
				{
					coolereclipse.whitelistStages.Value = (string)((ConfigEntryBase)coolereclipse.whitelistStages).DefaultValue;
				}
				string text2 = "skinCommandoAlt,CommandoBody,100,0,0,Test Skin;;skinCommandoAlt,CommandoBody,200,0,0,Test Skin 2;;skinCommandoDefault,CommandoBody,290,-40,-10,Awesome Skin !!!!";
				if (skinrecolors.skinRecolors.Value == text2)
				{
					skinrecolors.skinRecolors.Value = (string)((ConfigEntryBase)skinrecolors.skinRecolors).DefaultValue;
				}
				string text3 = "goldshores,bazaar,solutionalhaunt,ss2_voidshop,goldshores";
				if (coolereclipse.blacklistStages.Value == text3)
				{
					coolereclipse.blacklistStages.Value = (string)((ConfigEntryBase)coolereclipse.blacklistStages).DefaultValue;
				}
				string text4 = "BombardmentDrone,Bombardment Drone,Default;Drones,Tsar Bomba;Fat Man;Little Boy|JunkDrone,Junk Drone,Default;Drones|RechargeDrone,Barrier Drone,Default;Drones|JailerDrone,Jailer Drone,Default;Drones|CleanupDrone,Cleanup Drone,Default;Drones,Roomba|CopycatDrone,Freeze Drone,Default;Drones,Frozone|HaulerDrone,Transport Drone,Default;Drones|DTGunnerDroneBody,CROSSHAIRS,Default;Drones,Ruxin|DTHealingDroneBody,DOC,Default;Drones,Bunny|DTHaulerDroneBody,CHIRP,Default;Drones,Moose|FriendUnitBody,Best Buddy,Default,Friend Inside Me;Stupid Baby;Son|DroneBomber,Lt. Droneboy,Default,Lt. Beep Boop";
				if (allynames.bodyNames.Value == text4)
				{
					allynames.bodyNames.Value = (string)((ConfigEntryBase)allynames.bodyNames).DefaultValue;
				}
			}
		}
	}
}
namespace butterscotchnroses.skills
{
	public abstract class SkillBase<T> : SkillBase where T : SkillBase<T>
	{
		public static T Instance { get; private set; }

		public SkillBase()
		{
			if (Instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting SkillBase was instantiated twice");
			}
			Instance = this as T;
		}
	}
	public abstract class SkillBase
	{
		public SkillDef SkillDef;

		public static EventHandler PostCreationEvent;

		public abstract SerializableEntityStateType ActivationState { get; }

		public abstract float Cooldown { get; }

		public virtual int StockToConsume { get; } = 1;

		public abstract string Machine { get; }

		public abstract int MaxStock { get; }

		public abstract string LangToken { get; }

		public abstract string Name { get; }

		public virtual string Survivor { get; }

		public virtual SkillSlot Slot { get; } = (SkillSlot)(-1);

		public abstract string Description { get; }

		public virtual bool IsCombat { get; } = true;

		public virtual bool Agile { get; }

		public virtual bool DelayCooldown { get; }

		public virtual List<string> Keywords { get; } = new List<string>();

		public abstract Sprite SkillIcon { get; }

		public virtual UnlockableDef Unlock { get; }

		public virtual bool AutoApply { get; } = true;

		public virtual bool MustKeyPress { get; }

		public virtual bool AgileAddKeyword { get; } = true;

		public virtual bool SprintCancelable { get; } = true;

		public virtual bool ResetStockOnOverride { get; }

		public virtual bool Passive { get; }

		public virtual bool Configurable { get; } = true;

		public virtual bool ForceOff { get; }

		public virtual InterruptPriority Priority { get; } = (InterruptPriority)1;

		public virtual int StockToRecharge { get; } = 1;

		public void Init()
		{
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e9: Expected I4, but got Unknown
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0558: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_0591: Expected O, but got Unknown
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: Expected O, but got Unknown
			//IL_03db: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_042c: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0484: Unknown result type (might be due to invalid IL or missing references)
			//IL_048e: Expected O, but got Unknown
			//IL_048e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0490: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Expected O, but got Unknown
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			if (ForceOff || (Configurable && !((BaseUnityPlugin)BNR.butterscotchnroses.instance).Config.Bind<bool>("Skills", Name, true, "Enable this skill?").Value))
			{
				return;
			}
			SkillDef = GetSkillDef();
			SkillDef.skillNameToken = "SKILL_" + LangToken.ToUpper() + "_NAME";
			SkillDef.skillDescriptionToken = "SKILL_" + LangToken.ToUpper() + "_DESC";
			SkillDef.skillName = LangToken.ToUpper();
			SkillDef.baseRechargeInterval = Cooldown;
			SkillDef.baseMaxStock = MaxStock;
			SkillDef.activationState = ActivationState;
			SkillDef.cancelSprintingOnActivation = !Passive && !Agile;
			SkillDef.icon = SkillIcon;
			SkillDef.interruptPriority = Priority;
			if (!SprintCancelable)
			{
				SkillDef.canceledFromSprinting = false;
			}
			else
			{
				SkillDef.canceledFromSprinting = !Agile;
			}
			SkillDef.isCombatSkill = IsCombat;
			SkillDef.activationStateMachineName = Machine;
			SkillDef.beginSkillCooldownOnSkillEnd = DelayCooldown;
			SkillDef.stockToConsume = StockToConsume;
			SkillDef.requiredStock = ((!Passive) ? 1 : 321);
			SkillDef.mustKeyPress = MustKeyPress;
			SkillDef.fullRestockOnAssign = ResetStockOnOverride;
			SkillDef.rechargeStock = StockToRecharge;
			((Object)SkillDef).name = LangToken.ToUpper();
			List<string> keywords = Keywords;
			if (Agile && AgileAddKeyword)
			{
				keywords.Add(butterscotchnroses.skills.Keywords.Agile);
			}
			if (keywords.Count >= 1)
			{
				SkillDef.keywordTokens = keywords.ToArray();
			}
			Variant val3;
			if (AutoApply && Passive)
			{
				GameObject val = Addressables.LoadAssetAsync<GameObject>((object)Survivor).WaitForCompletion();
				bool flag = false;
				GenericSkill[] components = val.GetComponents<GenericSkill>();
				foreach (GenericSkill val2 in components)
				{
					if ((val2.skillName != null && val2.skillName.ToLower().Contains("passive")) || (((Object)val2.skillFamily).name != null && ((Object)val2.skillFamily).name.ToLower().Contains("passive")))
					{
						SkillFamily skillFamily = val2.skillFamily;
						Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
						Variant[] variants = skillFamily.variants;
						int num = skillFamily.variants.Length - 1;
						val3 = new Variant
						{
							skillDef = SkillDef,
							unlockableDef = Unlock
						};
						((Variant)(ref val3)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
						variants[num] = val3;
						flag = true;
						break;
					}
				}
				if (!flag)
				{
					GenericSkill obj = val.AddComponent<GenericSkill>();
					SkillLocator component = val.GetComponent<SkillLocator>();
					SkillFamily val4 = ScriptableObject.CreateInstance<SkillFamily>();
					obj.skillName = ((Object)val).name + "Passive";
					((Object)val4).name = ((Object)val).name + "Passive";
					val4.variants = (Variant[])(object)new Variant[2];
					Variant[] variants2 = val4.variants;
					val3 = new Variant
					{
						skillDef = SkillDef,
						unlockableDef = Unlock
					};
					((Variant)(ref val3)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
					variants2[1] = val3;
					SkillDef val5 = ScriptableObject.CreateInstance<SkillDef>();
					val5.skillNameToken = component.passiveSkill.skillNameToken;
					val5.skillDescriptionToken = component.passiveSkill.skillDescriptionToken;
					val5.activationStateMachineName = "TheAmongUs";
					val5.activationState = new SerializableEntityStateType(typeof(Idle));
					val5.icon = component.passiveSkill.icon;
					ContentAddition.AddSkillDef(val5);
					component.passiveSkill.enabled = false;
					obj.hideInCharacterSelect = true;
					Variant[] variants3 = val4.variants;
					val3 = new Variant
					{
						skillDef = val5
					};
					((Variant)(ref val3)).viewableNode = new Node(val5.skillNameToken, false, (Node)null);
					variants3[0] = val3;
					obj._skillFamily = val4;
				}
			}
			else if (AutoApply)
			{
				SkillLocator component2 = Addressables.LoadAssetAsync<GameObject>((object)Survivor).WaitForCompletion().GetComponent<SkillLocator>();
				SkillFamily val6 = null;
				SkillSlot slot = Slot;
				switch ((int)slot)
				{
				case 0:
					val6 = component2.primary.skillFamily;
					break;
				case 1:
					val6 = component2.secondary.skillFamily;
					break;
				case 2:
					val6 = component2.utility.skillFamily;
					break;
				case 3:
					val6 = component2.special.skillFamily;
					break;
				}
				if ((Object)(object)val6 != (Object)null)
				{
					Array.Resize(ref val6.variants, val6.variants.Length + 1);
					Variant[] variants4 = val6.variants;
					int num2 = variants4.Length - 1;
					val3 = new Variant
					{
						skillDef = SkillDef,
						unlockableDef = Unlock
					};
					((Variant)(ref val3)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
					variants4[num2] = val3;
				}
			}
			LanguageAPI.Add(SkillDef.skillNameToken, Name);
			string text = Description;
			if (Agile && AgileAddKeyword)
			{
				text = "<style=cIsUtility>Agile.</style> " + text;
			}
			LanguageAPI.Add(SkillDef.skillDescriptionToken, text);
			ContentAddition.AddSkillDef(SkillDef);
			PostCreation();
		}

		public virtual SkillDef GetSkillDef()
		{
			return ScriptableObject.CreateInstance<SkillDef>();
		}

		public virtual void PostCreation()
		{
			PostCreationEvent?.Invoke(this, new EventArgs());
		}

		public EntityStateMachine AddEntityStateMachine<T>(GameObject obj, string name) where T : EntityState
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			EntityStateMachine obj2 = obj.AddComponent<EntityStateMachine>();
			obj2.customName = name;
			obj2.initialStateType = new SerializableEntityStateType(typeof(T));
			obj2.mainStateType = new SerializableEntityStateType(typeof(T));
			List<EntityStateMachine> list = obj.GetComponents<EntityStateMachine>().ToList();
			obj.GetComponent<NetworkStateMachine>().stateMachines = list.ToArray();
			return obj2;
		}

		public GameObject GetSurvivor()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			return Addressables.LoadAssetAsync<GameObject>((object)Survivor).WaitForCompletion();
		}
	}
	public static class Keywords
	{
		public static string Poison = "KEYWORD_POISON";

		public static string Regenerative = "KEYWORD_RAPID_REGEN";

		public static string Agile = "KEYWORD_AGILE";

		public static string HealthCost = "KEYWORD_PERCENT_HP";

		public static string Disperse = "KEYWORD_SONIC_BOOM";

		public static string Weak = "KEYWORD_WEAK";

		public static string Heavy = "KEYWORD_HEAVY";

		public static string Freeze = "KEYWORD_FREEZING";

		public static string Stun = "KEYWORD_STUNNING";

		public static string Expose = "KEYWORD_EXPOSE";

		public static string Shock = "KEYWORD_SHOCKING";

		public static string Slayer = "KEYWORD_SLAYER";

		public static string Hemorrhage = "KEYWORD_SUPERBLEED";

		public static string Ignite = "KEYWORD_IGNITE";

		public static string Weakpoint = "KEYWORD_WEAKPOINT";

		public static string ActiveReload = "KEYWORD_ACTIVERELOAD";

		public static string VoidCorruption = "KEYWORD_VOIDCORRUPTION";
	}
}
namespace butterscotchnroses.artifacts
{
	public abstract class ArtifactBase<T> : ArtifactBase where T : ArtifactBase<T>
	{
		public static T instance { get; private set; }

		public ArtifactBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ArtifactBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class ArtifactBase
	{
		public ArtifactDef ArtifactDef;

		public abstract string ArtifactName { get; }

		public abstract string ArtifactLangTokenName { get; }

		public abstract string ArtifactDescription { get; }

		public abstract Sprite ArtifactEnabledIcon { get; }

		public abstract Sprite ArtifactDisabledIcon { get; }

		public bool ArtifactEnabled => RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef);

		public abstract void Init(ConfigFile config);

		protected void CreateLang()
		{
			LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_NAME", ArtifactName);
			LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION", ArtifactDescription);
		}

		protected void CreateArtifact()
		{
			ArtifactDef = ScriptableObject.CreateInstance<ArtifactDef>();
			ArtifactDef.cachedName = "ARTIFACT_" + ArtifactLangTokenName;
			ArtifactDef.nameToken = "ARTIFACT_" + ArtifactLangTokenName + "_NAME";
			ArtifactDef.descriptionToken = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION";
			ArtifactDef.smallIconSelectedSprite = ArtifactEnabledIcon;
			ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon;
			ContentAddition.AddArtifactDef(ArtifactDef);
		}

		public abstract void Hooks();
	}
	internal class evil : ArtifactBase<evil>
	{
		public static ConfigEntry<int> TimesToPrintMessageOnStart;

		public override string ArtifactName => "Artifact of Example";

		public override string ArtifactLangTokenName => "ARTIFACT_OF_EXAMPLE";

		public override string ArtifactDescription => "When enabled, print a message to the chat at the start of the run.";

		public override Sprite ArtifactEnabledIcon => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion();

		public override Sprite ArtifactDisabledIcon => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion();

		public override void Init(ConfigFile config)
		{
		}

		private void CreateConfig(ConfigFile config)
		{
			TimesToPrintMessageOnStart = config.Bind<int>("Artifact: " + ArtifactName, "Times to Print Message in Chat", 5, "How many times should a message be printed to the chat on run start?");
		}

		public override void Hooks()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			Run.onRunStartGlobal += PrintMessageToChat;
			GenericNotification.SetItem += new hook_SetItem(GenericNotificationOnSetItem);
			ItemIcon.SetItemIndex_ItemIndex_int_float += new hook_SetItemIndex_ItemIndex_int_float(ItemIconOnSetItemIndex_ItemIndex_int_float);
		}

		private void ItemIconOnSetItemIndex_ItemIndex_int_float(orig_SetItemIndex_ItemIndex_int_float orig, ItemIcon self, ItemIndex newitemindex, int newitemcount, float newdurationpercent)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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_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)
			orig.Invoke(self, newitemindex, newitemcount, newdurationpercent);
			if (base.ArtifactEnabled)
			{
				self.image.texture = (Texture)(object)Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion().texture;
				self.tooltipProvider.titleToken = "???";
				self.tooltipProvider.bodyToken = "???";
				self.tooltipProvider.titleColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)1));
			}
		}

		private void GenericNotificationOnSetItem(orig_SetItem orig, GenericNotification self, ItemDef itemdef)
		{
			//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)
			orig.Invoke(self, itemdef);
			if (base.ArtifactEnabled)
			{
				self.iconImage.texture = (Texture)(object)Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion().texture;
				self.titleText.token = "???";
				self.descriptionText.token = "???";
			}
		}

		private void PrintMessageToChat(Run run)
		{
			if (NetworkServer.active && base.ArtifactEnabled)
			{
				for (int i = 0; i < TimesToPrintMessageOnStart.Value; i++)
				{
					Chat.AddMessage("Example Artifact has been Enabled.");
				}
			}
		}
	}
}
namespace BNR
{
	[BepInPlugin("zzzicebro.BNR", "BNR", "0.3.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class butterscotchnroses : BaseUnityPlugin
	{
		private const string PluginGUID = "zzzicebro.BNR";

		private const string PluginAuthor = "icebro";

		private const string PluginName = "BNR";

		private const string PluginVersion = "0.3.0";

		public static AssetBundle carvingKitBundle;

		public static AssetBundle redmanBundle;

		public static AssetBundle bnrBundle;

		public static butterscotchnroses instance;

		public static List<PatchBase> patchBases = new List<PatchBase>();

		public static Harmony harmony;

		public static ConfigEntry<bool> clientSide;

		public void Awake()
		{
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			((BaseUnityPlugin)this).Logger.LogDebug((object)"loading mod !!");
			clientSide = ((BaseUnityPlugin)this).Config.Bind<bool>("BNR", "client side", false, "whether the mod should run in clientside mode or not .,,. disables content/changed behavior that would otherwise cause desyncs automatically !!!");
			carvingKitBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "carvingkit_assets"));
			((MonoBehaviour)this).StartCoroutine(ShaderSwapper.UpgradeStubbedShadersAsync(carvingKitBundle));
			bnrBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "bnrbundle"));
			harmony = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
			foreach (Type item in from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(PatchBase))
				select type)
			{
				try
				{
					PatchBase patchBase = (PatchBase)Activator.CreateInstance(item);
					patchBase.Config(((BaseUnityPlugin)this).Config);
					patchBase.PreInit();
					patchBases.Add(patchBase);
				}
				catch (Exception data)
				{
					Log.Warning("failed to patch something ! probably fine if you dont have whatever mod that was attempted to be patched enabled ,..,,.");
					Log.Warning(data);
				}
			}
			if (!clientSide.Value)
			{
				foreach (Type item2 in from type in Assembly.GetExecutingAssembly().GetTypes()
					where !type.IsAbstract && type.IsSubclassOf(typeof(BuffBase))
					select type)
				{
					((BuffBase)Activator.CreateInstance(item2)).AddBuff();
				}
				foreach (Type item3 in from type in Assembly.GetExecutingAssembly().GetTypes()
					where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
					select type)
				{
					((ItemBase)Activator.CreateInstance(item3)).Init(((BaseUnityPlugin)this).Config);
				}
				foreach (Type item4 in from x in Assembly.GetExecutingAssembly().GetTypes()
					where !x.IsAbstract && x.IsSubclassOf(typeof(SkillBase))
					select x)
				{
					((SkillBase)Activator.CreateInstance(item4)).Init();
				}
				foreach (Type item5 in from x in Assembly.GetExecutingAssembly().GetTypes()
					where !x.IsAbstract && x.IsSubclassOf(typeof(ArtifactBase))
					select x)
				{
					((ArtifactBase)Activator.CreateInstance(item5)).Init(((BaseUnityPlugin)this).Config);
				}
			}
			oldconfigs.fixOldConfigs();
		}

		private void Update()
		{
			foreach (PatchBase patchBasis in patchBases)
			{
				patchBasis.Update();
			}
		}

		private void FixedUpdate()
		{
			foreach (PatchBase patchBasis in patchBases)
			{
				patchBasis.FixedUpdate();
			}
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data, [CallerLineNumber] int line = -1)
		{
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	public class buttonrecolors : PatchBase<buttonrecolors>
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__ButtonSkinControllerOnAwake;

			public static hook_Awake <1>__PanelSkinControllerOnAwake;
		}

		private ConfigEntry<bool> enabled;

		private static ConfigEntry<bool> colorButtons;

		private static ConfigEntry<Color> buttonNorm;

		private static ConfigEntry<Color> buttonHigh;

		private static ConfigEntry<Color> buttonPress;

		private static ConfigEntry<Color> buttonSelect;

		public override void Init()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			if (enabled.Value)
			{
				object obj = <>O.<0>__ButtonSkinControllerOnAwake;
				if (obj == null)
				{
					hook_Awake val = ButtonSkinControllerOnAwake;
					<>O.<0>__ButtonSkinControllerOnAwake = val;
					obj = (object)val;
				}
				ButtonSkinController.Awake += (hook_Awake)obj;
				object obj2 = <>O.<1>__PanelSkinControllerOnAwake;
				if (obj2 == null)
				{
					hook_Awake val2 = PanelSkinControllerOnAwake;
					<>O.<1>__PanelSkinControllerOnAwake = val2;
					obj2 = (object)val2;
				}
				PanelSkinController.Awake += (hook_Awake)obj2;
			}
		}

		private static void PanelSkinControllerOnAwake(orig_Awake orig, PanelSkinController self)
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (colorButtons.Value && !((Object)((Component)self).gameObject).name.Contains("ObjectivePanel") && !((Object)((Component)self).gameObject).name.Contains("NakedButton (Quit)"))
			{
				Image component = ((Component)self).gameObject.GetComponent<Image>();
				if (!((Object)((Component)component).gameObject).name.Contains("RuleBook"))
				{
					((Graphic)component).color = Utils.Color255(buttonNorm.Value.r, buttonNorm.Value.g, buttonNorm.Value.b, ((Graphic)component).color.a);
				}
			}
		}

		private static void ButtonSkinControllerOnAwake(orig_Awake orig, ButtonSkinController self)
		{
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!colorButtons.Value)
			{
				return;
			}
			HGButton component = ((Component)self).gameObject.GetComponent<HGButton>();
			if (Object.op_Implicit((Object)(object)component) && !((Object)component).name.Contains("SurvivorIcon") && !((Object)((Component)component).gameObject).name.Contains("Choice") && !((Object)((Component)component).gameObject).name.Contains("Loadout") && !((Object)((Component)component).gameObject).name.Contains("ObjectivePanel") && !((Object)((Component)component).gameObject).name.Contains("NakedButton (Quit)"))
			{
				if (((Object)((Component)component).gameObject).name.Contains("Music&More"))
				{
					((Component)component).gameObject.SetActive(false);
				}
				ColorBlock colors = ((Selectable)component).colors;
				((ColorBlock)(ref colors)).normalColor = buttonNorm.Value;
				((ColorBlock)(ref colors)).highlightedColor = buttonHigh.Value;
				((ColorBlock)(ref colors)).pressedColor = buttonPress.Value;
				((ColorBlock)(ref colors)).selectedColor = buttonSelect.Value;
				((Selectable)component).colors = colors;
			}
		}

		public override void Config(ConfigFile config)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			//IL_007f: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Expected O, but got Unknown
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Expected O, but got Unknown
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Expected O, but got Unknown
			enabled = config.Bind<bool>("BNR - UI", "enable patches for button recolors", true, "");
			Utils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Expected O, but got Unknown
				//IL_001d: 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_0028: Expected O, but got Unknown
				//IL_007e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Unknown result type (might be due to invalid IL or missing references)
				//IL_0089: Expected O, but got Unknown
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Expected O, but got Unknown
				if (enabled.Value)
				{
					object obj = <>O.<0>__ButtonSkinControllerOnAwake;
					if (obj == null)
					{
						hook_Awake val = ButtonSkinControllerOnAwake;
						<>O.<0>__ButtonSkinControllerOnAwake = val;
						obj = (object)val;
					}
					ButtonSkinController.Awake += (hook_Awake)obj;
					object obj2 = <>O.<1>__PanelSkinControllerOnAwake;
					if (obj2 == null)
					{
						hook_Awake val2 = PanelSkinControllerOnAwake;
						<>O.<1>__PanelSkinControllerOnAwake = val2;
						obj2 = (object)val2;
					}
					PanelSkinController.Awake += (hook_Awake)obj2;
				}
				else
				{
					object obj3 = <>O.<0>__ButtonSkinControllerOnAwake;
					if (obj3 == null)
					{
						hook_Awake val3 = ButtonSkinControllerOnAwake;
						<>O.<0>__ButtonSkinControllerOnAwake = val3;
						obj3 = (object)val3;
					}
					ButtonSkinController.Awake -= (hook_Awake)obj3;
					object obj4 = <>O.<1>__PanelSkinControllerOnAwake;
					if (obj4 == null)
					{
						hook_Awake val4 = PanelSkinControllerOnAwake;
						<>O.<1>__PanelSkinControllerOnAwake = val4;
						obj4 = (object)val4;
					}
					PanelSkinController.Awake -= (hook_Awake)obj4;
				}
			};
			colorButtons = config.Bind<bool>("BNR - UI", "change buttons colors", false, "whether or not to use custom menu button colors,..,");
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(colorButtons));
			buttonNorm = config.Bind<Color>("BNR - UI", "normal button color", Utils.Color255(110, 83, 120), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonNorm));
			buttonHigh = config.Bind<Color>("BNR - UI", "highlighted button coor", Utils.Color255(255, 177, 245), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonHigh));
			buttonPress = config.Bind<Color>("BNR - UI", "pressed button color", Utils.Color255(192, 113, 182), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonPress));
			buttonSelect = config.Bind<Color>("BNR - UI", "selected button color", Utils.Color255(255, 177, 238), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonSelect));
		}
	}
	public class coloredits : PatchBase<coloredits>
	{
		private ConfigEntry<bool> enabled;

		public override void Init()
		{
			applyHooks();
		}

		private void applyHooks()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			if (!enabled.Value)
			{
				return;
			}
			int num = ColorCatalog.indexToColor32.Length - 1;
			for (int i = 1; i < num; i++)
			{
				Color val = Color32.op_Implicit(ColorCatalog.indexToColor32[i]);
				ConfigEntry<Color> newColor = ((BaseUnityPlugin)butterscotchnroses.instance).Config.Bind<Color>("BNR - coloredits", "new color for " + Enum.GetName(typeof(ColorIndex), i), val, "");
				ModSettingsManager.AddOption((BaseOption)new ColorOption(newColor));
				int i2 = i;
				newColor.SettingChanged += delegate
				{
					//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_001b: Unknown result type (might be due to invalid IL or missing references)
					ColorCatalog.indexToColor32[i2] = Color32.op_Implicit(newColor.Value);
				};
				ColorCatalog.indexToColor32[i] = Color32.op_Implicit(newColor.Value);
			}
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - coloredits", "enable patches for coloredits", true, "");
			Utils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				applyHooks();
			};
		}
	}
	public class drifter : PatchBase<drifter>
	{
		private ConfigEntry<bool> enabled;

		private ConfigEntry<bool> neverKillCubes;

		private ConfigEntry<int> cubeCount;

		public override void Init()
		{
			if (enabled.Value)
			{
				applyHooks();
			}
		}

		public void applyHooks()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			if (enabled.Value && butterscotchnroses.clientSide.Value)
			{
				CharacterMaster.GetDeployableSameSlotLimit += new hook_GetDeployableSameSlotLimit(CharacterMasterOnGetDeployableSameSlotLimit);
				Idle.OnEnter += new hook_OnEnter(IdleOnOnEnter);
			}
			else
			{
				CharacterMaster.GetDeployableSameSlotLimit -= new hook_GetDeployableSameSlotLimit(CharacterMasterOnGetDeployableSameSlotLimit);
				Idle.OnEnter -= new hook_OnEnter(IdleOnOnEnter);
			}
		}

		private void IdleOnOnEnter(orig_OnEnter orig, Idle self)
		{
			orig.Invoke(self);
			if (neverKillCubes.Value)
			{
				((EntityState)self).fixedAge = float.NegativeInfinity;
			}
		}

		private int CharacterMasterOnGetDeployableSameSlotLimit(orig_GetDeployableSameSlotLimit orig, CharacterMaster self, DeployableSlot slot)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			if ((int)slot != 22)
			{
				return orig.Invoke(self, slot);
			}
			return cubeCount.Value;
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - drifter", "enable patches for drifter", true, "");
			Utils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				applyHooks();
			};
			cubeCount = config.Bind<int>("BNR - drifter", "junk cube count", 20, "limit of junk cubes !!");
			Utils.SliderConfig(4, 300, cubeCount);
			neverKillCubes = config.Bind<bool>("BNR - drifter", "never kill cubes !!!", true, "byeah ,,.");
			Utils.CheckboxConfig(neverKillCubes);
		}
	}
	public class dronevisibility : PatchBase<dronevisibility>
	{
		private ConfigEntry<bool> enabled;

		private ConfigEntry<bool> useSillyMaterials;

		private ConfigEntry<Color> sillyMaterialColor;

		private ConfigEntry<Color> operatorIndicatorColor;

		private ConfigEntry<float> visibilityDistance;

		private Material operatorMat;

		public override void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			operatorMat = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC3/Drone Tech/matDroneTechCarryRings.mat").WaitForCompletion());
			operatorMat.SetColor("_TintColor", operatorIndicatorColor.Value);
			Hook();
		}

		private void Hook()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			if (enabled.Value)
			{
				HologramProjector.BuildHologram += new hook_BuildHologram(HologramProjectorOnBuildHologram);
				SummonMasterBehavior.OnEnable += new hook_OnEnable(SummonMasterBehaviorOnOnEnable);
			}
			else
			{
				HologramProjector.BuildHologram -= new hook_BuildHologram(HologramProjectorOnBuildHologram);
				SummonMasterBehavior.OnEnable -= new hook_OnEnable(SummonMasterBehaviorOnOnEnable);
			}
		}

		private void SummonMasterBehaviorOnOnEnable(orig_OnEnable orig, SummonMasterBehavior self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<DroneAvailability>()))
			{
				HologramProjector component = ((Component)self).GetComponent<HologramProjector>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.displayDistance = visibilityDistance.Value;
				}
				else
				{
					Log.Warning("failed to find projector on drone !!");
				}
			}
		}

		private void HologramProjectorOnBuildHologram(orig_BuildHologram orig, HologramProjector self)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)((Component)self).gameObject.GetComponent<DroneAvailability>()) || ((Object)((Component)self).gameObject).name.Contains("Turret"))
			{
				return;
			}
			Texture portraitIcon = ((Component)self).gameObject.GetComponent<SummonMasterBehavior>().masterPrefab.GetComponent<CharacterMaster>().bodyPrefab.GetComponent<CharacterBody>().portraitIcon;
			Transform val = ((Component)self).gameObject.transform.Find("HologramPivot");
			GameObject val2 = new GameObject("HologramSprite");
			val2.transform.SetParent(((Component)val).transform);
			val2.AddComponent<HologramHelper>();
			SpriteRenderer val3 = val2.AddComponent<SpriteRenderer>();
			val3.sprite = Sprite.Create((Texture2D)(object)((portraitIcon is Texture2D) ? portraitIcon : null), new Rect(0f, 0f, (float)portraitIcon.width, (float)portraitIcon.height), new Vector2(0.5f, 0.5f));
			val2.transform.localScale = new Vector3(2f, 2f, 1f);
			if (useSillyMaterials.Value)
			{
				((Renderer)val3).sharedMaterial = Addressables.LoadAssetAsync<Material>((object)RoR2_DLC2.matHalcyoniteShrineCrystalGlow_mat).WaitForCompletion();
				((Renderer)val3).sharedMaterial.SetTexture("_Cloud2Tex", Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common.texCloudOrganic2_png).WaitForCompletion());
				((Renderer)val3).sharedMaterial.SetTexture("_Cloud1Tex", Addressables.LoadAssetAsync<Texture>((object)RoR2_DLC2_Child.texChildPrimaryStarCloud_png).WaitForCompletion());
				((Renderer)val3).sharedMaterial.SetColor("_TintColor", sillyMaterialColor.Value);
				((Renderer)val3).sharedMaterial.SetInt("_AlphaBias", 0);
			}
			GameObject val4 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC3/Drone Tech/CommandCarryTransportVFX.prefab").WaitForCompletion(), val2.transform, true);
			for (int i = 0; i < val4.transform.childCount; i++)
			{
				GameObject gameObject = ((Component)val4.transform.GetChild(i)).gameObject;
				if (((Object)gameObject).name != "MainRings")
				{
					Object.Destroy((Object)(object)gameObject);
					continue;
				}
				gameObject.GetComponent<ParticleSystem>().startSpeed = -10f;
				((Renderer)gameObject.GetComponent<ParticleSystemRenderer>()).sharedMaterial = operatorMat;
			}
			val4.transform.position = val4.transform.localPosition;
			val4.transform.localPosition = new Vector3(0f, 0f, 0f);
			val4.transform.position = new Vector3(val4.transform.position.x, val4.transform.position.y - 3.2f, val4.transform.position.z);
		}

		public override void Config(ConfigFile config)
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected O, but got Unknown
			enabled = config.Bind<bool>("BNR - Drone Visibility", "enable patches for drone visibility", false, "");
			Utils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				Hook();
			};
			useSillyMaterials = config.Bind<bool>("BNR - Drone Visibility", "use silly materials for indicator !!", true, "");
			Utils.CheckboxConfig(useSillyMaterials);
			sillyMaterialColor = config.Bind<Color>("BNR - Drone Visibility", "colors for silly sprite hologram thing material !!", Utils.Color255(191, 126, 211), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(sillyMaterialColor));
			operatorIndicatorColor = config.Bind<Color>("BNR - Drone Visibility", "colors for operator vfx thing !!", Utils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(operatorIndicatorColor));
			visibilityDistance = config.Bind<float>("BNR - Drone Visibility", "set distance which hologram becomes visible (set like 99999 for always !!", 99999f, "");
			Utils.SliderConfig(15f, 999f, visibilityDistance);
		}
	}
	public class HologramHelper : MonoBehaviour
	{
		private Transform hologram;

		public Vector3 pos;

		public void OnEnable()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_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)
			hologram = ((Component)this).transform.parent.GetChild(0);
			((Component)this).transform.position = ((Component)this).transform.localPosition;
			((Component)this).transform.localPosition = new Vector3(0f, 0f, 0f);
			((Component)this).transform.position = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y + 2f, ((Component)this).transform.position.z);
		}

		public void FixedUpdate()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)hologram))
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			Vector3 val = default(Vector3);
			val.x = 0f;
			val.y = hologram.eulerAngles.y;
			val.z = hologram.eulerAngles.z;
			((Component)this).transform.rotation = Quaternion.Euler(val);
		}
	}
	public class loadingscreen : PatchBase<loadingscreen>
	{
		private ConfigEntry<float> chanceForRandom;

		private ConfigEntry<bool> enabled;

		public override void Init()
		{
			applyHooks();
		}

		private void applyHooks()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Expected O, but got Unknown
			if (enabled.Value && Random.Range(0f, 100f) <= chanceForRandom.Value)
			{
				RoR2Application.Update += new hook_Update(RoR2ApplicationOnUpdate);
				LoadingScreenCanvas.OnLoadComplete += new hook_OnLoadComplete(LoadingScreenCanvasOnOnLoadComplete);
			}
			void LoadingScreenCanvasOnOnLoadComplete(orig_OnLoadComplete orig, LoadingScreenCanvas self)
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Expected O, but got Unknown
				orig.Invoke(self);
				RoR2Application.Update -= new hook_Update(RoR2ApplicationOnUpdate);
			}
		}

		private void RoR2ApplicationOnUpdate(orig_Update orig, RoR2Application self)
		{
			if (Object.op_Implicit((Object)(object)LoadingScreenCanvas.Instance?.percentage))
			{
				LoadingScreenCanvas.Instance.percentage.SetPercentValue(Random.Range(int.MinValue, int.MaxValue));
			}
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - loadingscreen", "enable patches for loadingscreen", true, "");
			Utils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				applyHooks();
			};
			chanceForRandom = config.Bind<float>("BNR - loadingscreen", "chance for loading screen to show random percents for no reason.,.,", 0.5f, "hehe,. .,");
			Utils.SliderConfig(0f, 100f, chanceForRandom);
		}
	}
	public class malachite : PatchBase<malachite>
	{
		private ConfigEntry<bool> enabled;

		public static ConfigEntry<float> timeBetweenSpawns;

		public override void Init()
		{
			applyHooks();
		}

		private void applyHooks()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			if (enabled.Value && butterscotchnroses.clientSide.Value)
			{
				CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBodyOnOnBuffFirstStackGained);
			}
			else
			{
				CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBodyOnOnBuffFirstStackGained);
			}
		}

		private void CharacterBodyOnOnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef)
		{
			orig.Invoke(self, buffDef);
			if (!((Object)(object)buffDef != (Object)(object)Buffs.AffixPoison))
			{
				((Component)self).gameObject.AddComponent<EvilUrchinSpawner>()._characterBody = self;
			}
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - malachite", "enable patches for malachite (have them naturally spawn urchins ,.,.", true, "");
			Utils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				applyHooks();
			};
			timeBetweenSpawns = config.Bind<float>("BNR - malachite", "time between urchin spawns .,,.", 12f, "byeah.,,");
			Utils.SliderConfig(1f, 30f, timeBetweenSpawns);
		}
	}
	public class EvilUrchinSpawner : MonoBehaviour
	{
		public CharacterBody _characterBody;

		private float urchinSpawnTimer;

		private void OnEnable()
		{
			Log.Debug("added urchin spawner !!", 70);
		}

		private void FixedUpdate()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			urchinSpawnTimer += Time.fixedDeltaTime;
			if (!(urchinSpawnTimer > malachite.timeBetweenSpawns.Value))
			{
				return;
			}
			urchinSpawnTimer = 0f;
			Log.Debug("spawning urgin !!", 80);
			if (!Object.op_Implicit((Object)(object)_characterBody) || !_characterBody.HasBuff(Buffs.AffixPoison))
			{
				Log.Debug("uh oh,,", 84);
				Object.Destroy((Object)(object)this);
				return;
			}
			Vector3 position = ((Component)this).transform.position;
			Ray val = (Ray)(Object.op_Implicit((Object)(object)_characterBody.inputBank) ? _characterBody.inputBank.GetAimRay() : new Ray(((Component)this).transform.position, ((Component)this).transform.rotation * Vector3.forward));
			Quaternion val2 = Quaternion.LookRotation(((Ray)(ref val)).direction);
			GameObject val3 = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/UrchinTurretMaster"), position, val2);
			CharacterMaster component = val3.GetComponent<CharacterMaster>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.teamIndex = _characterBody.teamComponent.teamIndex;
				NetworkServer.Spawn(val3);
				component.SpawnBodyHere();
			}
		}
	}
	public class pingrecolor : PatchBase<pingrecolor>
	{
		private ConfigEntry<Color> pingIndicatorDefault;

		private ConfigEntry<Color> pingIndicatorEnemy;

		private ConfigEntry<Color> pingIndicatorInteractable;

		private ConfigEntry<Color> pingIndicatorCount;

		private ConfigEntry<bool> enabled;

		public override void Init()
		{
			applyHooks();
		}

		private void applyHooks()
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			if (enabled.Value)
			{
				PingIndicator.OnEnable += new hook_OnEnable(PingIndicatorOnOnEnable);
				PingIndicator.RebuildPing += new hook_RebuildPing(PingIndicatorOnRebuildPing);
				PingIndicator.Start += new hook_Start(PingIndicatorOnStart);
				PingIndicator.OnPreRenderOutlineHighlight += new hook_OnPreRenderOutlineHighlight(PingIndicatorOnOnPreRenderOutlineHighlight);
				ChargeIndicatorController.TriggerPing += new hook_TriggerPing(ChargeIndicatorControllerOnTriggerPing);
			}
			else
			{
				PingIndicator.OnEnable -= new hook_OnEnable(PingIndicatorOnOnEnable);
				PingIndicator.RebuildPing -= new hook_RebuildPing(PingIndicatorOnRebuildPing);
				PingIndicator.Start -= new hook_Start(PingIndicatorOnStart);
				PingIndicator.OnPreRenderOutlineHighlight -= new hook_OnPreRenderOutlineHighlight(PingIndicatorOnOnPreRenderOutlineHighlight);
				ChargeIndicatorController.TriggerPing -= new hook_TriggerPing(ChargeIndicatorControllerOnTriggerPing);
			}
		}

		private void ChargeIndicatorControllerOnTriggerPing(orig_TriggerPing orig, ChargeIndicatorController self, string pingownername, bool triggeranimation)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			self.playerPingColor = pingIndicatorInteractable.Value;
			orig.Invoke(self, pingownername, triggeranimation);
		}

		private void PingIndicatorOnOnPreRenderOutlineHighlight(orig_OnPreRenderOutlineHighlight orig, PingIndicator self, OutlineHighlight outlinehighlight)
		{
			recolorPingIndicator(self);
			orig.Invoke(self, outlinehighlight);
		}

		private void PingIndicatorOnStart(orig_Start orig, PingIndicator self)
		{
			recolorPingIndicator(self);
			orig.Invoke(self);
		}

		private void PingIndicatorOnOnEnable(orig_OnEnable orig, PingIndicator self)
		{
			recolorPingIndicator(self);
			orig.Invoke(self);
		}

		private void PingIndicatorOnRebuildPing(orig_RebuildPing orig, PingIndicator self)
		{
			recolorPingIndicator(self);
			orig.Invoke(self);
		}

		private void recolorPingIndicator(PingIndicator pingIndicator)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected I4, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			pingIndicator.defaultPingColor = pingIndicatorDefault.Value;
			pingIndicator.enemyPingColor = pingIndicatorEnemy.Value;
			pingIndicator.interactablePingColor = pingIndicatorInteractable.Value;
			PingType pingType = pingIndicator.pingType;
			pingIndicator.pingColor = (Color)((int)pingType switch
			{
				0 => pingIndicatorDefault.Value, 
				1 => pingIndicatorEnemy.Value, 
				2 => pingIndicatorInteractable.Value, 
				3 => pingIndicatorCount.Value, 
				_ => pingIndicator.pingColor, 
			});
			pingIndicator.activeColor = pingIndicator.pingColor;
			((Component)((Component)pingIndicator).transform.GetChild(0)).GetComponent<ParticleSystem>().startColor = pingIndicatorDefault.Value;
			((Component)((Component)pingIndicator).transform.GetChild(1)).GetComponent<ParticleSystem>().startColor = pingIndicatorInteractable.Value;
			((Component)((Component)pingIndicator).transform.GetChild(2)).GetComponent<ParticleSystem>().startColor = pingIndicatorEnemy.Value;
			((Component)pingIndicator.positionIndicator.alwaysVisibleObject.transform.GetChild(0)).GetComponent<SpriteRenderer>().color = pingIndicatorDefault.Value;
			((Component)pingIndicator.positionIndicator.alwaysVisibleObject.transform.GetChild(1)).GetComponent<SpriteRenderer>().color = pingIndicatorEnemy.Value;
			((Component)pingIndicator.positionIndicator.alwaysVisibleObject.transform.GetChild(2)).GetComponent<SpriteRenderer>().color = pingIndicatorInteractable.Value;
		}

		public override void Config(ConfigFile config)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected O, but got Unknown
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Expected O, but got Unknown
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Expected O, but got Unknown
			enabled = config.Bind<bool>("BNR - pingrecolor", "enable patches for pingrecolor", true, "");
			Utils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				applyHooks();
			};
			pingIndicatorDefault = config.Bind<Color>("BNR - pingrecolor", "ping recolor for default ping !!", Utils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorDefault));
			pingIndicatorEnemy = config.Bind<Color>("BNR - pingrecolor", "ping recolor for enemy ping !!", Utils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorEnemy));
			pingIndicatorInteractable = config.Bind<Color>("BNR - pingrecolor", "ping recolor for interactable ping !!", Utils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorInteractable));
			pingIndicatorCount = config.Bind<Color>("BNR - pingrecolor", "ping recolor for count ping (unsure what this one actually is !! !!", Utils.Color255(252, 142, 249), "");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorCount));
		}
	}
	public class postprocessing : PatchBase<postprocessing>
	{
		private class stagePP
		{
			private PostProcessProfile profile;

			private string forwardFacingName;

			private string[] stageEditsList = Array.Empty<string>();

			public static Dictionary<string, Type> typeStringMatcher = new Dictionary<string, Type>();

			public stagePP(string GUID, string forwardFacingName, string edits)
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				stagePP stagePP = this;
				AsyncOperationHandle<PostProcessProfile> val = Addressables.LoadAssetAsync<PostProcessProfile>((object)GUID);
				val.Completed += delegate(AsyncOperationHandle<PostProcessProfile> handle)
				{
					postProcessProfiles.Add(handle.Result);
					stagePP.profile = handle.Result;
					stagePP.forwardFacingName = forwardFacingName;
					stagePP.stageEditsList = edits.Split(",");
					stagePP.ApplyEdits();
				};
			}

			private void ApplyEdits()
			{
				string[] array = stageEditsList;
				foreach (string text in array)
				{
					Log.Debug("add edit for " + forwardFacingName + " " + text, 118);
					if (!typeStringMatcher.TryGetValue(text, out var value))
					{
						Log.Warning("could not find type " + text + " in supported types !!! supported types below ,. ,");
						{
							foreach (string key in typeStringMatcher.Keys)
							{
								Log.Warning(key);
							}
							break;
						}
					}
					if (!profile.HasSettings(value))
					{
						profile.AddSettings(value);
						Log.Debug($"added type {value} to {forwardFacingName}", 134);
					}
					object obj = typeof(PostProcessProfile).GetMethods().First((MethodInfo m) => m.Name == "GetSetting" && m.IsGenericMethod).MakeGenericMethod(value)
						.Invoke(profile, Array.Empty<object>());
					BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
					foreach (FieldInfo item in obj.GetType().GetFields(bindingAttr).ToList())
					{
						try
						{
							FieldInfo fieldInfo = item.GetValue(obj).GetType().GetFields(bindingAttr)
								.First((FieldInfo fieldInfo2) => fieldInfo2.Name == "value");
							typeof(stagePP).GetMethods().First((MethodInfo m) => m.Name == "ApplyEdit" && m.IsGenericMethod).MakeGenericMethod(fieldInfo.FieldType)
								.Invoke(this, new object[3] { item, text, obj });
						}
						catch (Exception ex)
						{
							if (!(ex is InvalidOperationException))
							{
								if (ex is TargetInvocationException)
								{
									Log.Warning($"was unable to create config for variable {item.Name} of type {item.GetValue(obj)} !!!");
								}
								else
								{
									Log.Error(ex);
								}
							}
							else
							{
								Log.Warning($"variable {item.Name} of typwe {item.GetValue(obj)} had no value variable !!");
							}
						}
					}
				}
			}

			public void ApplyEdit<T>(FieldInfo variable, string editType, object profileSetting)
			{
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Expected O, but got Unknown
				string text = Reflection.GetFieldValue<T>(variable.GetValue(profileSetting), "value").ToString();
				ConfigEntry<T> val = default(ConfigEntry<T>);
				if (!((BaseUnityPlugin)butterscotchnroses.instance).Config.TryGetEntry<T>(new ConfigDefinition("BNR - postprocessing - " + forwardFacingName, editType + " - " + variable.Name), ref val))
				{
					val = ((BaseUnityPlugin)butterscotchnroses.instance).Config.Bind<T>("BNR - postprocessing - " + forwardFacingName, editType + " - " + variable.Name, Reflection.GetFieldValue<T>(variable.GetValue(profileSetting), "value"), "");
				}
				if (!object.Equals(Reflection.GetFieldValue<T>(variable.GetValue(profileSetting), "value"), val.Value))
				{
					Reflection.SetFieldValue<T>(variable.GetValue(profileSetting), "value", val.Value);
					Reflection.SetFieldValue<bool>(variable.GetValue(profileSetting), "overrideState", true);
					Log.Warning(string.Format("{0} of type {1} .,., \nold value {2} ,..,\nnew value {3} !!!", variable.Name, variable.GetValue(profileSetting), text, Reflection.GetFieldValue<T>(variable.GetValue(profileSetting), "value")));
				}
				else
				{
					Log.Debug(string.Format("{0} of type {1} .,., value {2} !!!", variable.Name, variable.GetValue(profileSetting), Reflection.GetFieldValue<T>(variable.GetValue(profileSetting), "value")), 199);
				}
			}
		}

		private static List<PostProcessProfile> postProcessProfiles = new List<PostProcessProfile>();

		private ConfigEntry<bool> enabled;

		private ConfigEntry<string> PPVEdit;

		public override void Init()
		{
			applyHooks();
		}

		private void applyHooks()
		{
			if (!enabled.Value)
			{
				return;
			}
			foreach (Assembly item in new List<Assembly>(2)
			{
				typeof(SobelRain).Assembly,
				typeof(AmbientOcclusion).Assembly
			})
			{
				Type[] array = item.ManifestModule.FindTypes(Module.FilterTypeName, "*");
				Log.Debug($"test count: {array.Length}", 39);
				Type[] array2 = array;
				foreach (Type type in array2)
				{
					if (!type.ToString().Contains("+") && !type.ToString().Contains("[") && !type.ToString().Contains("<") && !stagePP.typeStringMatcher.ContainsKey(type.ToString().Split(".")[^1]))
					{
						stagePP.typeStringMatcher.Add(type.ToString().Split(".")[^1], type);
					}
				}
			}
			string[] array3 = PPVEdit.Value.Split(";");
			foreach (string text in array3)
			{
				Log.Debug("PPV edit string: " + text, 60);
				Log.Debug("GUID/asset psth : " + text.Split(",")[0], 61);
				Log.Debug("forward facing name : " + text.Split(",")[1], 62);
				Log.Debug("regex []: " + Regex.Match(text, "\\[(.*?)\\]").Groups[1].Value, 63);
				new stagePP(text.Split(",")[0], text.Split(",")[1], Regex.Match(text, "\\[(.*?)\\]").Groups[1].Value);
			}
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - postprocessing", "enable patches for postprocessing", true, "");
			Utils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				applyHooks();
			};
			PPVEdit = config.Bind<string>("BNR - postprocessing", "stage edits", "RoR2/Base/title/PostProcessing/ppSceneGolemplainsFoggy.asset,titanic plains,[AmbientOcclusion];RoR2/DLC3/nest/ppSceneNest.asset,pretenders,[AmbientOcclusion]", "(assetpathtopostprocessingvolume),(config name),[(postprocessingtypename),(postprocessingtypename)]");
			Utils.StringConfig(PPVEdit);
		}
	}
	public class quickerhalcshrine : PatchBase<quickerhalcshrine>
	{
		private HalcyoniteShrineInteractable halcshrineinteractable;

		private GameObject bluePortalRef;

		private float startingTickRate;

		private ConfigEntry<bool> enabled;

		private ConfigEntry<float> multiplier;

		private ConfigEntry<int> playerCount;

		private ConfigEntry<bool> scaleTime;

		private ConfigEntry<bool> greenToBlue;

		public override void Init()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			if (enabled.Value)
			{
				GameObject val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2.ShrineHalcyonite_prefab).WaitForCompletion();
				bluePortalRef = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_PortalShop.PortalShop_prefab).WaitForCompletion();
				halcshrineinteractable = val.GetComponent<HalcyoniteShrineInteractable>();
				startingTickRate = halcshrineinteractable.tickRate;
				halcshrineinteractable.tickRate = startingTickRate * multiplier.Value;
				multiplier.SettingChanged += delegate
				{
					halcshrineinteractable.tickRate = startingTickRate * multiplier.Value;
				};
				HalcyoniteShrineInteractable.Start += new hook_Start(HalcyoniteShrineInteractableOnStart);
				GoldSiphonNearbyBodyController.DrainGold += new hook_DrainGold(GoldSiphonNearbyBodyControllerOnDrainGold);
				BossGroup.OnDefeatedServer += new hook_OnDefeatedServer(BossGroupOnOnDefeatedServer);
			}
		}

		private void BossGroupOnOnDefeatedServer(orig_OnDefeatedServer orig, BossGroup self)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (greenToBlue.Value)
			{
				GameObject val = GameObject.Find("PortalColossus(Clone)");
				if (Object.op_Implicit((Object)(object)val))
				{
					GameObject obj = Object.Instantiate<GameObject>(bluePortalRef);
					obj.transform.position = val.transform.position;
					NetworkServer.Spawn(obj);
					Object.Destroy((Object)(object)val);
				}
			}
		}

		private void GoldSiphonNearbyBodyControllerOnDrainGold(orig_DrainGold orig, GoldSiphonNearbyBodyController self)
		{
			orig.Invoke(self);
			if (NetworkServer.active && self.isTetheredToAtLeastOneObject && scaleTime.Value && Run.instance.participatingPlayerCount <= playerCount.Value)
			{
				Run.instance.SetRunStopwatch((Run.instance.GetRunStopwatch() + 1f / self.tickRate) * (multiplier.Value - 1f));
			}
		}

		private void HalcyoniteShrineInteractableOnStart(orig_Start orig, HalcyoniteShrineInteractable self)
		{
			orig.Invoke(self);
			if (NetworkServer.active && Run.instance.participatingPlayerCount <= playerCount.Value)
			{
				self.tickRate = startingTickRate * multiplier.Value;
			}
		}

		public override void Config(ConfigFile config)
		{
			enabled = config.Bind<bool>("BNR - Halyc Shrines", "enable patches for halyc shrines", true, "");
			Utils.CheckboxConfig(enabled);
			enabled.SettingChanged += delegate
			{
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Expected O, but got Unknown
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Expected O, but got Unknown
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Expected O, but got Unknown
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Expected O, but got Unknown
				if (enabled.Value)
				{
					HalcyoniteShrineInteractable.Start += new hook_Start(HalcyoniteShrineInteractableOnStart);
					GoldSiphonNearbyBodyController.DrainGold += new hook_DrainGold(GoldSiphonNearbyBodyControllerOnDrainGold);
				}
				else
				{
					HalcyoniteShrineInteractable.Start -= new hook_Start(HalcyoniteShrineInteractableOnStart);
					GoldSiphonNearbyBodyController.DrainGold -= new hook_DrainGold(GoldSiphonNearbyBodyControllerOnDrainGold);
				}
			};
			multiplier = config.Bind<float>("BNR - Halyc Shrines", "speed up halcyon shrine mutlipler", 2f, "");
			Utils.SliderConfig(1f, 3f, multiplier);
			playerCount = config.Bind<int>("BNR - Halyc Shrines", "only apply multiplier under or equal to x amount of players", 1, "eg. 1 = only singleplayer 2 = only 2 people multiplayer");
			Utils.SliderConfig(1, 4, playerCount);
			scaleTime = config.Bind<bool>("BNR - Halyc Shrines", "speed up time scale as well", true, "make time scale with halcyon shrine speed as well");
			Utils.CheckboxConfig(scaleTime);
			greenToBlue = config.Bind<bool>("BNR - Halyc Shrines", "turn green portal to blue", true, "makes green portals become blue after the boss has been defeated !!!");
			Utils.CheckboxConfig(greenToBlue);
		}
	}
	public class skinrecolors : PatchBase<skinrecolors>
	{
		public class monobehaviorskinloader : MonoBehaviour
		{
			public void OnEnable()
			{
				Log.Debug("starting custom skin loadings coroutine  !", 69);
				((MonoBehaviour)this).StartCoroutine(LoadTextures());
			}
		}

		public class skinrecolorui
		{
			public class tabletop : MonoBehaviour
			{
				public bool isDisabled = true;

				public void FixedUpdate()
				{
					if (isDisabled)
					{
						((Component)this).gameObject.transform.Rotate(0f, 20f * Time.deltaTime, 0f);
					}
				}

				public void Rotate(float rot)
				{
					((Component)this).gameObject.transform.Rotate(0f, rot, 0f);
				}
			}

			[CompilerGenerated]
			private static class <>O
			{
				public static UnityAction<float> <0>__HueSliderListener;

				public static UnityAction<string> <1>__HueInputFieldListener;

				public static UnityAction<float> <2>__SatSliderListener;

				public static UnityAction<string> <3>__SatInputFieldListener;

				public static UnityAction<float> <4>__ValSliderListener;

				public static UnityAction<string> <5>__ValInputFieldListener;

				public static UnityAction<bool> <6>__UseMulitplySatToggleListener;

				public static UnityAction<string> <7>__SkinNameInputFieldListener;

				public static UnityAction <8>__ApplySkinHGButtonListner;

				public static UnityAction <9>__CreateSkinHGButtonListner;

				public static UnityAction <10>__ZoomInHGButtonListner;

				public static UnityAction <11>__ZoomOutHGButtonListner;

				public static UnityAction <12>__RotLHGButtonListner;

				public static UnityAction <13>__RotRHGButtonListner;

				public static UnityAction<bool> <14>__DisableTurntableHGButtonListner;
			}

			public static Slider hueSlider;

			public static TMP_InputField hueInputField;

			public static Slider satSlider;

			public static TMP_InputField satInputField;

			public static Slider valSlider;

			public static TMP_InputField valInputField;

			public static Toggle useMulitplySat;

			public static TMP_InputField skinName;

			public static HGButton applySkin;

			public static HGButton createSkin;

			public static GameObject cameraObject;

			public static HGButton zoomIn;

			public static HGButton zoomOut;

			public static HGButton rotL;

			public static HGButton rotR;

			public static Toggle disableTurntable;

			public static tabletop turntable;

			public static void BuildUI()
			{
				//IL_0348: Unknown result type (might be due to invalid IL or missing references)
				//IL_034d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0353: Expected O, but got Unknown
				//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ca: Expected O, but got Unknown
				//IL_043f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0479: Unknown result type (might be due to invalid IL or missing references)
				//IL_0391: Unknown result type (might be due to invalid IL or missing references)
				//IL_0396: Unknown result type (might be due to invalid IL or missing references)
				//IL_039c: Expected O, but got Unknown
				//IL_0502: Unknown result type (might be due to invalid IL or missing references)
				//IL_0526: Unknown result type (might be due to invalid IL or missing references)
				//IL_057d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0582: Unknown result type (might be due to invalid IL or missing references)
				//IL_0588: Expected O, but got Unknown
				//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_05db: Expected O, but got Unknown
				//IL_0623: Unknown result type (might be due to invalid IL or missing references)
				//IL_0628: Unknown result type (might be due to invalid IL or missing references)
				//IL_062e: Expected O, but got Unknown
				//IL_0676: Unknown result type (might be due to invalid IL or missing references)
				//IL_067b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0681: Expected O, but got Unknown
				GameObject gameObject = ((Component)window.transform.Find("MainPanel")).gameObject;
				hueSlider = ((Component)gameObject.transform.Find("HueSlider")).gameObject.GetComponent<Slider>();
				((UnityEvent<float>)(object)hueSlider.onValueChanged).AddListener((UnityAction<float>)HueSliderListener);
				hueInputField = ((Component)gameObject.transform.Find("HueInputField")).gameObject.GetComponent<TMP_InputField>();
				((UnityEvent<string>)(object)hueInputField.onValueChanged).AddListener((UnityAction<string>)HueInputFieldListener);
				hueSlider.value = hsv[0];
				hueInputField.text = hsv[0].ToString(CultureInfo.InvariantCulture);
				satSlider = ((Component)gameObject.transform.Find("SatSlider")).gameObject.GetComponent<Slider>();
				((UnityEvent<float>)(object)satSlider.onValueChanged).AddListener((UnityAction<float>)SatSliderListener);
				satInputField = ((Component)gameObject.transform.Find("SatInputField")).gameObject.GetComponent<TMP_InputField>();
				((UnityEvent<string>)(object)satInputField.onValueChanged).AddListener((UnityAction<string>)SatInputFieldListener);
				satSlider.value = hsv[1];
				satInputField.text = hsv[1].ToString(CultureInfo.InvariantCulture);
				valSlider = ((Component)gameObject.transform.Find("ValSlider")).gameObject.GetComponent<Slider>();
				((UnityEvent<float>)(object)valSlider.onValueChanged).AddListener((UnityAction<float>)ValSliderListener);
				valInputField = ((Component)gameObject.transform.Find("ValInputField")).gameObject.GetComponent<TMP_InputField>();
				((UnityEvent<string>)(object)valInputField.onValueChanged).AddListener((UnityAction<string>)ValInputFieldListener);
				valSlider.value = hsv[2];
				valInputField.text = hsv[2].ToString(CultureInfo.InvariantCulture);
				useMulitplySat = ((Component)gameObject.transform.Find("SatMultiplyToggle")).gameObject.GetComponent<Toggle>();
				((UnityEvent<bool>)(object)useMulitplySat.onValueChanged).AddListener((UnityAction<bool>)UseMulitplySatToggleListener);
				useMulitplySat.isOn = multiplySat;
				skinName = ((Component)gameObject.transform.Find("SkinName")).gameObject.GetComponent<TMP_InputField>();
				((UnityEvent<string>)(object)skinName.onValueChanged).AddListener((UnityAction<string>)SkinNameInputFieldListener);
				skinName.text = newSkinName;
				applySkin = ((Component)gameObject.transform.Find("ApplySkin")).gameObject.GetComponent<HGButton>();
				ButtonClickedEvent onClick = ((Button)applySkin).onClick;
				object obj = <>O.<8>__ApplySkinHGButtonListner;
				if (obj == null)
				{
					UnityAction val = ApplySkinHGButtonListner;
					<>O.<8>__ApplySkinHGButtonListner = val;
					obj = (object)val;
				}
				((UnityEvent)onClick).AddListener((UnityAction)obj);
				createSkin = ((Component)gameObject.transform.Find("CreateSkin")).gameObject.GetComponent<HGButton>();
				ButtonClickedEvent onClick2 = ((Button)createSkin).onClick;
				object obj2 = <>O.<9>__CreateSkinHGButtonListner;
				if (obj2 == null)
				{
					UnityAction val2 = CreateSkinHGButtonListner;
					<>O.<9>__CreateSkinHGButtonListner = val2;
					obj2 = (object)val2;
				}
				((UnityEvent)onClick2).AddListener((UnityAction)obj2);
				currentBody = PlayerCharacterMasterController.instances[0].master.GetBody();
				cameraObject = new GameObject("Temp Camera");
				cameraObject.transform.SetParent(window.transform);
				Camera obj3 = cameraObject.AddComponent<Camera>();
				Log.Debug($"radius = {currentBody.radius}", 373);
				cameraObject.transform.position = new Vector3(0f, currentBody.radius * 2f, currentBody.radius * -4f);
				cameraObject.layer = (int)(ref LayerIndex.ragdoll);
				obj3.clearFlags = (CameraClearFlags)2;
				obj3.backgroundColor = new Color(0f, 0f, 0f, 0f);
				obj3.cullingMask = (int)(ref LayerIndex.ragdoll);
				obj3.targetTexture = butterscotchnroses.bnrBundle.LoadAsset<RenderTexture>("TestRenderTexture");
				GameObject obj4 = Object.Instantiate<GameObject>(((Component)currentBody.modelLocator.modelTransform).gameObject);
				AimAnimator val3 = default(AimAnimator);
				if (obj4.TryGetComponent<AimAnimator>(ref val3))
				{
					val3.inputBank = null;
					val3.directionComponent = null;
				}
				obj4.transform.SetParent(window.transform);
				obj4.transform.position = new Vector3(0f, 0f, 0f);
				obj4.transform.rotation = new Quaternion(0f, 180f, 0f, 0f);
				turntable = obj4.AddComponent<tabletop>();
				zoomIn = ((Component)gameObject.transform.Find("Preview").Find("ZoomIn")).gameObject.GetComponent<HGButton>();
				ButtonClickedEvent onClick3 = ((Button)zoomIn).onClick;
				object obj5 = <>O.<10>__ZoomInHGButtonListner;
				if (obj5 == null)
				{
					UnityAction val4 = ZoomInHGButtonListner;
					<>O.<10>__ZoomInHGButtonListner = val4;
					obj5 = (object)val4;
				}
				((UnityEvent)onClick3).AddListener((UnityAction)obj5);
				zoomOut = ((Component)gameObject.transform.Find("Preview").Find("ZoomOut")).gameObject.GetComponent<HGButton>();
				ButtonClickedEvent onClick4 = ((Button)zoomOut).onClick;
				object obj6 = <>O.<11>__ZoomOutHGButtonListner;
				if (obj6 == null)
				{
					UnityAction val5 = ZoomOutHGButtonListner;
					<>O.<11>__ZoomOutHGButtonListner = val5;
					obj6 = (object)val5;
				}
				((UnityEvent)onClick4).AddListener((UnityAction)obj6);
				rotL = ((Component)gameObject.transform.Find("Preview").Find("RotL")).gameObject.GetComponent<HGButton>();
				ButtonClickedEvent onClick5 = ((Button)rotL).onClick;
				object obj7 = <>O.<12>__RotLHGButtonListner;
				if (obj7 == null)
				{
					UnityAction val6 = RotLHGButtonListner;
					<>O.<12>__RotLHGButtonListner = val6;
					obj7 = (object)val6;
				}
				((UnityEvent)onClick5).AddListener((UnityAction)obj7);
				rotR = ((Component)gameObject.transform.Find("Preview").Find("RotR")).gameObject.GetComponent<HGButton>();
				ButtonClickedEvent onClick6 = ((Button)rotR).onClick;
				object obj8 = <>O.<13>__RotRHGButtonListner;
				if (obj8 == null)
				{
					UnityAction val7 = RotRHGButtonListner;
					<>O.<13>__RotRHGButtonListner = val7;
					obj8 = (object)val7;
				}
				((UnityEvent)onClick6).AddListener((UnityAction)obj8);
				disableTurntable = ((Component)gameObject.transform.Find("Preview").Find("DisableTurntable")).gameObject.GetComponent<Toggle>();
				((UnityEvent<bool>)(object)disableTurntable.onValueChanged).AddListener((UnityAction<bool>)DisableTurntableHGButtonListner);
			}

			private static void DisableTurntableHGButtonListner(bool isDisabled)
			{
				turntable.isDisabled = !isDisabled;
			}

			private static void RotLHGButtonListner()
			{
				turntable.Rotate(20f);
			}

			private static void RotRHGButtonListner()
			{
				turntable.Rotate(-20f);
			}

			private static void ZoomInHGButtonListner()
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				cameraObject.transform.position = new Vector3(cameraObject.transform.position.x, cameraObject.transform.position.y, cameraObject.transform.position.z + 1f);
			}

			private static void ZoomOutHGButtonListner()
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				cameraObject.transform.position = new Vector3(cameraObject.transform.position.x, cameraObject.transform.position.y, cameraObject.transform.position.z - 1f);
			}

			private static void CreateSkinHGButtonListner()
			{
				string text = ((!string.IsNullOrEmpty(newSkinName)) ? newSkinName : "Generated Skin");
				ConfigEntry<string> skinRecolors = skinrecolors.skinRecolors;
				string value = skinRecolors.Value;
				object[] obj = new object[7]
				{
					((Object)baseSkinName).name,
					null,
					null,
					null,
					null,
					null,
					null
				};
				string name = ((Object)currentBody).name;
				obj[1] = name.Substring(0, name.Length - 7);
				obj[2] = hsv[0];
				obj[3] = hsv[1];
				obj[4] = hsv[2];
				obj[5] = text;
				obj[6] = multiplySat;
				skinRecolors.Value = value + string.Format(";;{0},{1},{2},{3},{4},{5},{6}", obj);
				object[] obj2 = new object[7]
				{
					((Object)baseSkinName).name,
					null,
					null,
					null,
					null,
					null,
					null
				};
				name = ((Object)currentBody).name;
				obj2[1] = name.Substring(0, name.Length - 7);
				obj2[2] = hsv[0];
				obj2[3] = hsv[1];
				obj2[4] = hsv[2];
				obj2[5] = text;
				obj2[6] = multiplySat;
				Log.Debug(string.Format("added ;;{0},{1},{2},{3},{4},{5},{6} to the config !!! restart your game to see it in lobby .,,.", obj2), 456);
			}

			private static void ApplySkinHGButtonListner()
			{
				ModelSkinController modelLocator = Utils.GetModelLocator(((Component)currentBody).gameObject);
				int num = modelLocator.currentSkinIndex;
				if (commands.bodyNameToPrev.TryGetValue(((Object)currentBody).name, out var value))
				{
					num = value;
				}
				else
				{
					commands.bodyNameToPrev.Add(((Object)currentBody).name, modelLocator.currentSkinIndex);
				}
				baseSkinName = modelLocator.skins[num];
				Log.Debug($"baseskin set to {modelLocator.currentSkinIndex}", 474);
				Log.Debug("currentBody set to " + ((Object)currentBody).name, 475);
				Log.Debug($"hsv[0] set to {hsv[0]}", 476);
				Log.Debug($"hsv[1] set to {hsv[1]}", 477);
				Log.Debug($"hsv[2] set to {hsv[2]}", 478);
				Log.Debug("newSkinName set to " + newSkinName, 479);
				Log.Debug($"multiplySat set to {multiplySat}", 480);
				SkinDef val = skinRecolor(((Object)baseSkin).name, ((Object)currentBody).name, hsv[0], hsv[1], hsv[2], (newSkinName == "") ? "Generated Skin" : newSkinName, "", dontAdd: true, multiplySat);
				Array.Resize(ref modelLocator.skins, modelLocator.skins.Length + 1);
				modelLocator.skins[^1] = val;
				modelLocator.currentSkinIndex = modelLocator.skins.Length - 1;
				currentBody.skinIndex = (uint)(modelLocator.skins.Length - 1);
				modelLocator.ApplySkin(modelLocator.currentSkinIndex);
				Array.Resize(ref modelLocator.skins, modelLocator.skins.Length - 1);
			}

			private static void UseMulitplySatToggleListener(bool isOn)
			{
				multiplySat = isOn;
			}

			private static void SkinNameInputFieldListener(string skinNameNew)
			{
				newSkinName = skinNameNew;
			}

			private static void HueInputFieldListener(string hueString)
			{
				Log.Debug("hue input field  = " + hueString, 508);
				if (int.TryParse(hueString, out var result) && !Mathf.Approximately((float)result, hueSlider.value))
				{
					hueSlider.value = result;
					hsv[0] = result;
				}
			}

			private static void HueSliderListener(float hueFloat)
			{
				Log.Debug($"hue = {hueFloat}", 518);
				if (!int.TryParse(hueInputField.text, out var _) || (int.TryParse(hueInputField.text, out var result2) && !Mathf.Approximately((float)result2, hueFloat)))
				{
					hueInputField.text = hueFloat.ToString(CultureInfo.InvariantCulture);
					hsv[0] = hueFloat;
				}
			}

			private static void SatInputFieldListener(string satString)
			{
				Log.Debug("sat inpu